From 3ef72a1c9f20849cf42d3b6d876d5bcdeed08adb Mon Sep 17 00:00:00 2001 From: Chris T Date: Fri, 10 Apr 2020 14:36:16 -0400 Subject: [PATCH 01/71] Move modules into parent projects --- .gitignore | 2 + brapi-client/.gitignore | 4 + brapi-client/README.md | 51 + brapi-client/pom.xml | 64 + .../client/v2/endpoints/BrAPIClient.java | 204 + .../client/v2/endpoints/BrAPIEndpoint.java | 13 + .../v2/endpoints/ResponseHandlerFunction.java | 11 + .../v2/endpoints/model/BrAPIRequest.java | 18 + .../client/v2/endpoints/model/HttpMethod.java | 5 + .../model/exceptions/APIException.java | 23 + .../exceptions/HttpBadRequestException.java | 8 + .../model/exceptions/HttpException.java | 8 + .../exceptions/HttpForbiddenException.java | 9 + .../exceptions/HttpInternalServerError.java | 8 + .../exceptions/HttpNotFoundException.java | 8 + .../exceptions/HttpUnauthorizedException.java | 8 + .../endpoints/model/request/BaseRequest.java | 22 + .../model/request/ProgramsRequest.java | 40 + .../model/response/BrAPIResponse.java | 30 + .../model/response/DataResponse.java | 35 + .../v2/endpoints/model/response/Metadata.java | 33 + .../model/response/MetadataPagination.java | 32 + .../v2/endpoints/model/response/Status.java | 31 + .../modules/core/BrAPICoreEndpoints_V2.java | 16 + .../endpoints/modules/core/ProgramsAPI.java | 80 + .../genotype/BrAPIGenotypeEndpoints_V2.java | 4 + .../germplasm/BrAPIGermplasmEndpoints_V2.java | 4 + .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 + .../client/v2/model/ExternalReference.java | 19 + .../brapi/client/v2/model/Program.java | 27 + .../swagger-generated-client/ApiCallback.java | 59 + .../swagger-generated-client/ApiClient.java | 1204 +++++ .../ApiException.java | 89 + .../swagger-generated-client/ApiResponse.java | 58 + .../Configuration.java | 37 + .../GzipRequestInterceptor.java | 80 + .../swagger-generated-client/JSON.java | 386 ++ .../swagger-generated-client/Pair.java | 50 + .../ProgressRequestBody.java | 76 + .../ProgressResponseBody.java | 75 + .../swagger-generated-client/StringUtil.java | 53 + .../api/AuthenticationApi.java | 281 ++ .../api/CallsApi.java | 203 + .../api/CropsApi.java | 319 ++ .../api/DeprecatedApi.java | 1246 +++++ .../api/GenomeMapsApi.java | 679 +++ .../api/GermplasmApi.java | 1997 ++++++++ .../api/GermplasmAttributesApi.java | 487 ++ .../api/ImagesApi.java | 1020 ++++ .../api/ListsApi.java | 744 +++ .../api/LocationsApi.java | 328 ++ .../api/MarkerProfilesApi.java | 1148 +++++ .../api/MarkersApi.java | 913 ++++ .../api/ObservationVariablesApi.java | 2849 +++++++++++ .../api/ObservationsApi.java | 2328 +++++++++ .../api/PeopleApi.java | 608 +++ .../api/PhenotypesApi.java | 854 ++++ .../api/ProgramsApi.java | 601 +++ .../api/SamplesApi.java | 1019 ++++ .../api/SearchServicesApi.java | 4153 +++++++++++++++++ .../api/StudiesApi.java | 3511 ++++++++++++++ .../api/TrialsApi.java | 358 ++ .../api/VendorApi.java | 1091 +++++ .../auth/ApiKeyAuth.java | 73 + .../auth/Authentication.java | 28 + .../auth/HttpBasicAuth.java | 51 + .../swagger-generated-client/auth/OAuth.java | 37 + .../auth/OAuthFlow.java | 17 + .../model/AlleleMatrixDetails.java | 202 + .../model/AlleleMatrixDetailsResponse.java | 112 + .../AlleleMatrixDetailsResponseResult.java | 95 + .../model/AlleleMatrixSearchRequest.java | 351 ++ .../model/AlleleMatrixValues.java | 97 + .../model/AlleleMatrixValuesResponse.java | 111 + .../model/AlleleMatrixValuesResponse1.java | 112 + .../model/AsynchStatusMetadata.java | 87 + .../swagger-generated-client/model/Body.java | 156 + .../model/BreedingMethod.java | 179 + .../model/BreedingMethodResponse.java | 112 + .../model/BreedingMethodsResponse.java | 112 + .../model/BreedingMethodsResponseResult.java | 95 + .../swagger-generated-client/model/Call.java | 298 ++ .../model/CallsResponse.java | 112 + .../model/CallsResponseResult.java | 95 + .../model/CommonCropNamesResponse.java | 112 + .../model/CommonCropNamesResponseResult.java | 94 + .../model/Contact.java | 202 + .../model/CropsResponse.java | 112 + .../model/CropsResponseResult.java | 97 + .../model/DataLink.java | 156 + .../model/DataTypesResponse.java | 112 + .../model/DataTypesResponseResult.java | 97 + .../model/GenomeMap.java | 363 ++ .../model/GenomeMapDetails.java | 267 ++ .../model/GenomeMapsResponse.java | 112 + .../model/GenomeMapsResponseResult.java | 95 + .../model/GeoJSON.java | 155 + .../model/Germplasm.java | 699 +++ .../model/GermplasmAttribute.java | 179 + .../GermplasmAttributeCategoriesResponse.java | 112 + ...lasmAttributeCategoriesResponseResult.java | 95 + .../model/GermplasmAttributeCategory.java | 133 + .../model/GermplasmAttributeDef.java | 277 ++ .../model/GermplasmAttributeDefsResponse.java | 112 + .../GermplasmAttributeDefsResponseResult.java | 95 + .../model/GermplasmAttributeList.java | 121 + .../model/GermplasmAttributeListResponse.java | 112 + .../model/GermplasmDonors.java | 133 + .../model/GermplasmMCPD.java | 878 ++++ .../GermplasmMCPDBreedingInstitutes.java | 110 + .../model/GermplasmMCPDCollectingInfo.java | 191 + ...CPDCollectingInfoCollectingInstitutes.java | 133 + ...plasmMCPDCollectingInfoCollectingSite.java | 271 ++ .../model/GermplasmMCPDDonorInfo.java | 111 + .../GermplasmMCPDDonorInfoDonorInstitute.java | 110 + .../model/GermplasmMCPDResponse.java | 112 + ...GermplasmMCPDSafetyDuplicateInstitues.java | 110 + .../model/GermplasmMarkerprofilesList.java | 151 + .../GermplasmMarkerprofilesListResponse.java | 112 + .../model/GermplasmResponse.java | 112 + .../model/GermplasmResponse1.java | 112 + .../model/GermplasmResponse1Result.java | 98 + .../model/GermplasmResponse2.java | 112 + .../model/GermplasmResponseResult.java | 95 + .../model/GermplasmSearchRequest.java | 329 ++ .../model/GermplasmSummary.java | 676 +++ .../model/GermplasmSummaryList.java | 144 + .../model/GermplasmSummaryListResponse.java | 112 + .../swagger-generated-client/model/Image.java | 462 ++ .../model/ImageResponse.java | 112 + .../model/ImagesResponse.java | 112 + .../model/ImagesResponseResult.java | 95 + .../model/ImagesSearchRequest.java | 461 ++ .../model/LinearRing.java | 65 + .../model/LinkageGroup.java | 133 + .../model/ListDetails.java | 101 + .../model/ListResponse.java | 112 + .../model/ListSummary.java | 295 ++ .../model/ListSummaryResponse.java | 112 + .../model/ListSummaryResponseResult.java | 95 + .../model/ListTypes.java | 72 + .../model/Location.java | 443 ++ .../model/LocationResponse.java | 112 + .../model/LocationsResponse.java | 112 + .../model/LocationsResponseResult.java | 95 + .../model/MapDetailsResponse.java | 112 + .../model/Marker.java | 251 + .../model/MarkerProfile.java | 233 + .../model/MarkerProfileDescription.java | 248 + .../MarkerProfileDescriptionsResponse.java | 112 + ...rkerProfileDescriptionsResponseResult.java | 95 + .../model/MarkerProfilesResponse.java | 112 + .../model/MarkerResponse.java | 112 + .../model/MarkerSummaryLinkageGroup.java | 133 + .../MarkerSummaryLinkageGroupResponse.java | 112 + ...rkerSummaryLinkageGroupResponseResult.java | 95 + .../model/MarkerSummaryMap.java | 156 + .../model/MarkerSummaryMapResponse.java | 112 + .../model/MarkerSummaryMapResponseResult.java | 95 + .../model/MarkersResponse.java | 112 + .../model/MarkersResponseResult.java | 98 + .../model/MarkersSearchRequest.java | 343 ++ .../model/Measurement.java | 111 + .../model/Metadata.java | 153 + .../model/MetadataPagination.java | 156 + .../model/Method.java | 249 + .../model/MethodResponse.java | 112 + .../model/MethodsResponse.java | 112 + .../model/MethodsResponseResult.java | 95 + .../model/NewImageRequest.java | 416 ++ .../model/NewListRequest.java | 259 + .../model/NewMethodRequest.java | 203 + .../model/NewObservationDbIds.java | 98 + .../NewObservationDbIdsObservations.java | 133 + .../model/NewObservationDbIdsResponse.java | 112 + .../model/NewObservationUnitDbIds.java | 97 + .../NewObservationUnitDbIdsResponse.java | 112 + .../model/NewObservationUnitRequest.java | 651 +++ .../model/NewObservationsRequest.java | 98 + .../NewObservationsRequestDeprecated.java | 144 + .../NewObservationsRequestDeprecatedData.java | 145 + .../NewObservationsRequestObservations.java | 202 + ...wObservationsRequestWrapperDeprecated.java | 112 + .../model/NewObservationsTableRequest.java | 206 + .../NewObservationsTableRequestResult.java | 97 + .../model/NewPersonRequest.java | 248 + .../model/NewSampleDbId.java | 112 + .../model/NewSampleDbIdResult.java | 110 + .../model/NewScaleRequest.java | 205 + .../model/NewTraitRequest.java | 336 ++ .../model/Observation.java | 387 ++ .../model/ObservationLevelsResponse.java | 112 + .../model/ObservationLevelsResponse1.java | 112 + .../ObservationLevelsResponse1Result.java | 94 + .../ObservationLevelsResponseResult.java | 97 + .../model/ObservationSummary.java | 226 + .../model/ObservationSummaryPhenotype.java | 225 + .../model/ObservationTreatment.java | 110 + .../model/ObservationUnit.java | 927 ++++ .../model/ObservationUnitPhenotype.java | 789 ++++ .../model/ObservationUnitPosition.java | 582 +++ .../ObservationUnitPositionsResponse.java | 112 + .../ObservationUnitPositionsResponse1.java | 112 + ...servationUnitPositionsResponse1Result.java | 95 + ...bservationUnitPositionsResponseResult.java | 98 + .../model/ObservationUnitXref.java | 110 + .../model/ObservationUnitsResponse.java | 112 + .../model/ObservationUnitsResponse1.java | 112 + .../ObservationUnitsResponse1Result.java | 98 + .../model/ObservationUnitsResponse2.java | 112 + .../ObservationUnitsResponse2Result.java | 95 + .../model/ObservationUnitsResponseResult.java | 95 + .../model/ObservationUnitsTableResponse.java | 190 + .../model/ObservationUnitsTableResponse1.java | 112 + .../model/ObservationUnitsTableResponse2.java | 112 + .../model/ObservationVariable.java | 162 + .../model/ObservationVariableResponse.java | 112 + .../ObservationVariableSearchRequest.java | 454 ++ .../ObservationVariableSearchRequestDep.java | 361 ++ .../model/ObservationVariablesResponse.java | 112 + .../model/ObservationVariablesResponse1.java | 112 + .../ObservationVariablesResponse1Result.java | 98 + .../ObservationVariablesResponseResult.java | 95 + .../model/ObservationsResponse.java | 112 + .../model/ObservationsResponseResult.java | 95 + .../model/ObservationsTable.java | 248 + .../model/OneOfGeoJSONGeometry.java | 20 + .../model/OntologiesResponse.java | 112 + .../model/OntologiesResponseResult.java | 95 + .../model/Ontology.java | 248 + .../model/OntologyReference.java | 167 + .../OntologyReferenceDocumentationLinks.java | 156 + .../model/Pedigree.java | 510 ++ .../model/PedigreeResponse.java | 112 + .../model/PedigreeSiblings.java | 110 + .../model/Person.java | 271 ++ .../model/PersonResponse.java | 112 + .../model/PersonsResponse.java | 112 + .../model/PersonsResponseResult.java | 95 + .../model/PhenotypesRequest.java | 98 + .../model/PhenotypesRequestData.java | 141 + .../model/PhenotypesRequestObservation.java | 225 + .../model/PhenotypesSearchRequest.java | 399 ++ .../model/PlateFormat.java | 67 + .../model/Polygon.java | 65 + .../model/Position.java | 65 + .../model/Progeny.java | 144 + .../model/ProgenyProgeny.java | 180 + .../model/ProgenyResponse.java | 112 + .../model/Program.java | 294 ++ .../model/ProgramsResponse.java | 112 + .../model/ProgramsResponse1.java | 112 + .../model/ProgramsResponse1Result.java | 98 + .../model/ProgramsResponseResult.java | 95 + .../model/ProgramsSearchRequest.java | 329 ++ .../ProgramsSearchRequestDeprecated.java | 225 + .../model/Sample.java | 363 ++ .../model/SampleResponse.java | 112 + .../model/SampleSearchRequest.java | 236 + .../model/SampleSearchRequestDep.java | 236 + .../model/SamplesResponse.java | 112 + .../model/SamplesResponse1.java | 112 + .../model/SamplesResponse1Result.java | 98 + .../model/SamplesResponseResult.java | 95 + .../swagger-generated-client/model/Scale.java | 251 + .../model/ScaleResponse.java | 112 + .../model/ScalesResponse.java | 112 + .../model/ScalesResponseResult.java | 95 + .../model/Season.java | 133 + .../model/SeasonsResponse.java | 112 + .../model/SeasonsResponseResult.java | 95 + .../model/Status.java | 180 + .../model/StudiesResponse.java | 112 + .../model/StudiesResponse1.java | 112 + .../model/StudiesResponse1Result.java | 98 + .../model/StudiesResponseResult.java | 95 + .../swagger-generated-client/model/Study.java | 565 +++ .../model/StudyLastUpdate.java | 110 + .../model/StudyLayoutRequest.java | 98 + .../model/StudyLayoutRequestLayout.java | 434 ++ .../StudyObservationVariablesResponse.java | 112 + .../StudyObservationVariablesResponse1.java | 112 + ...dyObservationVariablesResponse1Result.java | 141 + ...udyObservationVariablesResponseResult.java | 144 + .../model/StudyResponse.java | 112 + .../model/StudySearchRequest.java | 649 +++ .../model/StudySearchRequestDep.java | 609 +++ .../model/StudySummary.java | 523 +++ .../model/StudyType.java | 156 + .../model/StudyTypesResponse.java | 112 + .../model/StudyTypesResponse1.java | 112 + .../model/StudyTypesResponse1Result.java | 95 + .../model/StudyTypesResponseResult.java | 98 + .../model/StudyobservationsTableResponse.java | 112 + .../model/SuccessfulSearchResponse.java | 112 + .../model/SuccessfulSearchResponseResult.java | 87 + .../model/TaxonID.java | 110 + .../swagger-generated-client/model/Trait.java | 382 ++ .../model/TraitDataType.java | 72 + .../model/TraitResponse.java | 112 + .../model/TraitSummary.java | 235 + .../model/TraitSummaryResponse.java | 112 + .../model/TraitsResponse.java | 112 + .../model/TraitsResponseResult.java | 95 + .../swagger-generated-client/model/Trial.java | 459 ++ .../model/TrialDatasetAuthorship.java | 110 + .../model/TrialDatasetAuthorships.java | 110 + .../model/TrialPublications.java | 110 + .../model/TrialResponse.java | 112 + .../model/TrialStudies.java | 156 + .../model/TrialSummary.java | 339 ++ .../model/TrialsResponse.java | 112 + .../model/TrialsResponseResult.java | 95 + .../model/ValidValues.java | 143 + .../model/VariableBaseClass.java | 501 ++ .../model/VendorContact.java | 271 ++ .../model/VendorOntologyReference.java | 133 + .../model/VendorOrder.java | 189 + .../model/VendorOrderRequest.java | 277 ++ .../model/VendorOrderRequestPlates.java | 168 + .../model/VendorOrderResponse.java | 112 + .../model/VendorOrderResponseResult.java | 121 + ...endorOrderResponseResultShipmentForms.java | 133 + .../model/VendorOrderResultsResponse.java | 112 + .../VendorOrderResultsResponseResult.java | 95 + .../model/VendorOrderStatusResponse.java | 112 + .../VendorOrderStatusResponseResult.java | 135 + .../model/VendorOrdersResponse.java | 112 + .../model/VendorOrdersResponseResult.java | 95 + .../model/VendorPlate.java | 168 + .../model/VendorPlateGetResponse.java | 144 + .../model/VendorPlateGetResponse1.java | 112 + .../model/VendorPlateResponse.java | 112 + .../model/VendorPlatesResponse.java | 112 + .../model/VendorPlatesResponseResult.java | 95 + .../model/VendorPlatesSubmissionRequest.java | 213 + .../model/VendorPlatesSubmissionResponse.java | 87 + .../model/VendorResultFile.java | 219 + .../model/VendorSample.java | 365 ++ .../model/VendorSpecification.java | 155 + .../model/VendorSpecificationResponse.java | 112 + .../model/VendorSpecificationService.java | 247 + .../model/WSMIMEDataTypes.java | 67 + .../brapi/client/BrAPIClientTest.java | 15 + .../modules/core/ProgramsAPITests.java | 76 + brapi-core-model/.gitignore | 25 + brapi-core-model/LICENSE | 21 + brapi-core-model/README.md | 35 + brapi-core-model/pom.xml | 57 + .../org/brapi/v2/core/model/BrApiContact.java | 54 + .../brapi/v2/core/model/BrApiDataFile.java | 51 + .../brapi/v2/core/model/BrApiDataLink.java | 62 + .../core/model/BrApiDatasetAuthorships.java | 30 + .../core/model/BrApiEnvironmentParameter.java | 36 + .../core/model/BrApiExperimentalDesign.java | 21 + .../core/model/BrApiExternalReferences.java | 24 + .../model/BrApiExternalReferencesInner.java | 21 + .../org/brapi/v2/core/model/BrApiGeoJSON.java | 21 + .../v2/core/model/BrApiGrowthFacility.java | 21 + .../brapi/v2/core/model/BrApiLastUpdate.java | 23 + .../brapi/v2/core/model/BrApiLinearRing.java | 15 + .../brapi/v2/core/model/BrApiLocation.java | 76 + ...iModel202AcceptedSearchResponseResult.java | 17 + .../core/model/BrApiOneOfGeoJSONGeometry.java | 9 + .../BrApiOneOfGeoJSONSearchAreaGeometry.java | 9 + .../v2/core/model/BrApiOntologyReference.java | 31 + ...piOntologyReferenceDocumentationLinks.java | 30 + .../org/brapi/v2/core/model/BrApiPerson.java | 52 + .../v2/core/model/BrApiPointGeometry.java | 21 + .../org/brapi/v2/core/model/BrApiPolygon.java | 14 + .../v2/core/model/BrApiPolygonGeometry.java | 21 + .../brapi/v2/core/model/BrApiPosition.java | 16 + .../org/brapi/v2/core/model/BrApiProgram.java | 53 + .../core/model/BrApiRequestPublications.java | 20 + .../org/brapi/v2/core/model/BrApiSeason.java | 27 + .../brapi/v2/core/model/BrApiServerInfo.java | 44 + .../org/brapi/v2/core/model/BrApiService.java | 79 + .../org/brapi/v2/core/model/BrApiStudy.java | 104 + .../org/brapi/v2/core/model/BrApiTrial.java | 72 + .../v2/core/model/BrApiWSMIMEDataTypes.java | 36 + brapi-genotype-model/README.md | 1 + brapi-germplasm-model/README.md | 1 + brapi-pheno-model/.gitignore | 25 + brapi-pheno-model/LICENSE | 21 + brapi-pheno-model/README.md | 82 + brapi-pheno-model/pom.xml | 63 + brapi-pheno-model/settings.xml | 36 + .../v2/phenotyping/model/BrApiEvent.java | 51 + .../model/BrApiEventParameters.java | 24 + .../v2/phenotyping/model/BrApiImage.java | 76 + .../v2/phenotyping/model/BrApiMethod.java | 48 + .../phenotyping/model/BrApiObservation.java | 77 + .../model/BrApiObservationLevel.java | 37 + .../model/BrApiObservationTable.java | 34 + .../model/BrApiObservationTreatment.java | 21 + .../model/BrApiObservationUnit.java | 85 + .../model/BrApiObservationUnitPosition.java | 64 + .../model/BrApiObservationUnitTable.java | 30 + ...ervationUnitTableObservationVariables.java | 21 + .../model/BrApiObservationVariable.java | 21 + .../v2/phenotyping/model/BrApiOntology.java | 46 + .../v2/phenotyping/model/BrApiScale.java | 38 + .../model/BrApiScaleCategories.java | 21 + .../model/BrApiScaleValidValues.java | 28 + .../v2/phenotyping/model/BrApiTrait.java | 58 + .../phenotyping/model/BrApiTraitDataType.java | 39 + .../v2/phenotyping/model/BrApiVariable.java | 76 + .../v2/phenotyping/model/HeaderRowName.java | 46 + 408 files changed, 80673 insertions(+) create mode 100644 brapi-client/.gitignore create mode 100644 brapi-client/README.md create mode 100644 brapi-client/pom.xml create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java create mode 100755 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java create mode 100755 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java create mode 100755 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java create mode 100755 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java create mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ApiCallback.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ApiClient.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ApiException.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ApiResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/Configuration.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/GzipRequestInterceptor.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/JSON.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/Pair.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ProgressRequestBody.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/ProgressResponseBody.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/StringUtil.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/AuthenticationApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/CallsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/CropsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/DeprecatedApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/GenomeMapsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/GermplasmApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/GermplasmAttributesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/ImagesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/ListsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/LocationsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/MarkerProfilesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/MarkersApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/ObservationVariablesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/ObservationsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/PeopleApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/PhenotypesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/ProgramsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/SamplesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/SearchServicesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/StudiesApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/TrialsApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/api/VendorApi.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/auth/ApiKeyAuth.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/auth/Authentication.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/auth/HttpBasicAuth.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/auth/OAuth.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/auth/OAuthFlow.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetails.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValues.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/AsynchStatusMetadata.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Body.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethod.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Call.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CallsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CallsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Contact.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CropsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/CropsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/DataLink.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GenomeMap.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapDetails.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GeoJSON.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Germplasm.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttribute.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategory.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDef.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeList.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeListResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmDonors.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPD.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDBreedingInstitutes.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfo.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingInstitutes.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingSite.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfo.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfoDonorInstitute.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDSafetyDuplicateInstitues.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesList.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesListResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse2.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryList.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryListResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Image.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ImageResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ImagesSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/LinearRing.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/LinkageGroup.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListDetails.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListSummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ListTypes.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Location.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/LocationResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MapDetailsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Marker.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfile.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescription.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfilesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroup.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMap.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MarkersSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Measurement.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Metadata.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MetadataPagination.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Method.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MethodResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewImageRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewListRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewMethodRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIds.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsObservations.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIds.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIdsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecated.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecatedData.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestObservations.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestWrapperDeprecated.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequestResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewPersonRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbId.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbIdResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewScaleRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/NewTraitRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Observation.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummaryPhenotype.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationTreatment.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnit.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPhenotype.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPosition.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitXref.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse2.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariable.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequestDep.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ObservationsTable.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/OneOfGeoJSONGeometry.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Ontology.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/OntologyReference.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/OntologyReferenceDocumentationLinks.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Pedigree.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PedigreeResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PedigreeSiblings.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Person.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PersonResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestData.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestObservation.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/PlateFormat.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Polygon.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Position.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Progeny.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgenyProgeny.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgenyResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Program.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequestDeprecated.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Sample.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SampleResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequestDep.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Scale.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ScaleResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Season.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Status.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Study.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyLastUpdate.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequestLayout.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequestDep.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudySummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyType.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1Result.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/StudyobservationsTableResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TaxonID.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Trait.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitDataType.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitSummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitSummaryResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/Trial.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorship.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorships.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialPublications.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialStudies.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialSummary.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/ValidValues.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VariableBaseClass.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorContact.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOntologyReference.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrder.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequestPlates.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResultShipmentForms.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlate.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse1.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponseResult.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionRequest.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorResultFile.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorSample.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecification.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationResponse.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationService.java create mode 100755 brapi-client/src/main/resources/swagger-generated-client/model/WSMIMEDataTypes.java create mode 100644 brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java create mode 100644 brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java create mode 100644 brapi-core-model/.gitignore create mode 100644 brapi-core-model/LICENSE create mode 100644 brapi-core-model/README.md create mode 100644 brapi-core-model/pom.xml create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java create mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java create mode 100644 brapi-genotype-model/README.md create mode 100644 brapi-germplasm-model/README.md create mode 100644 brapi-pheno-model/.gitignore create mode 100644 brapi-pheno-model/LICENSE create mode 100644 brapi-pheno-model/README.md create mode 100644 brapi-pheno-model/pom.xml create mode 100644 brapi-pheno-model/settings.xml create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java create mode 100755 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java diff --git a/.gitignore b/.gitignore index a1c2a238..27d44eaa 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* + +.idea \ No newline at end of file diff --git a/brapi-client/.gitignore b/brapi-client/.gitignore new file mode 100644 index 00000000..c2d37565 --- /dev/null +++ b/brapi-client/.gitignore @@ -0,0 +1,4 @@ +.idea/* +target/ +*.iml +*.orig diff --git a/brapi-client/README.md b/brapi-client/README.md new file mode 100644 index 00000000..db458164 --- /dev/null +++ b/brapi-client/README.md @@ -0,0 +1,51 @@ +# BrAPI Java Client + +This is a Java client library for making calls to a BrAPI-compliant service. + +The library is currently in development to support BrAPI v2.0. + +## Usage +Each API group that has been defined in the BrAPI specification as a correlating class. Each class exposes public methods to make appropriate calls for that type. For example, the `CallsAPI` class can make a `GET` request to retrieve a list of available calls that the target service supports. + +The `BrAPIClient` is a central execution wrapper that is responsible for executing REST calls to the BrAPI service. It is recommended that a single instance of `BrAPIClient` be created per BrAPI service you are communicating with. This allows for shared authorization across all calls. + +## Building the project + +If using IntelliJ, create a new configuration for Maven to build your project. + +``` +Working Directory: /brapi-client +Command: clean install +``` + +If not using IntelliJ, running the command + +```mvn clean install``` + +when in your brapi-client directory will build the project. + +## Running the tests + +Every endpoint will have tests written for that endpoint. The tests are written in JUnit and can be run in IntelliJ by right clicking on the `src/test/java` folder and selecting `Run 'All Tests'`. + +You can run all of the tests via terminal by using mvn `mvn test`. + +## Development +The `CallsAPI` can be used as a template for creating additional API classes. You will notice that the `CallsAPI` extends `BrAPIEndpoint`, and that `CallsAPI` calls to the `BrAPIEndpoint` constructor via `super`.

+Each REST method in an API class should call the `BrAPIClient` to execute the request. This ensures that consistent code is used for creating the request, as well as parsing the main response structure. When executing a request, call to either `BrAPIClient#execute(BrAPIRequest)` or `BrAPIClient#execute(BrAPIRequest, ResponseHandlerFunction)`.

+`BrAPIClient#execute(BrAPIRequest)` is meant for requests that do not need to process the response.
+`BrAPIClient#execute(BrAPIRequest, ResponseHandlerFunction)` is meant for requests that return a body that needs further processing. The `ResponseHandlerFunction` parameter is a lambda function that passes the `Metadata`, result object and a `GSON` parser. An example that returns a list of `Call` objects: +```java +brapiClient.execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse result = gson.fromJson(resultJson, resultGsonType); + return result.data(); + }) +``` + +Every endpoint should have at least one test + +## Developing Tests + +Each endpoint should have at least one test that uses the BrAPI test server as the destination. The `test` package should match the project structure, which endpoint test methods within the API classes. diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml new file mode 100644 index 00000000..0a9102ab --- /dev/null +++ b/brapi-client/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + org.breedinginsight + brapi-client + 1.0-SNAPSHOT + + + 8 + 4.1.0 + 1.18.8 + 2.8.5 + 5.6.1 + 3.0.0-M4 + + + + + com.squareup.okhttp3 + okhttp + ${okhttp.version} + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + com.google.code.gson + gson + ${gson.version} + + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + + + + + + maven-compiler-plugin + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${mvnsurefire.version} + + + + \ No newline at end of file diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java new file mode 100644 index 00000000..02076c1c --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java @@ -0,0 +1,204 @@ +package org.breedinginsight.brapi.client.v2.endpoints; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import lombok.Getter; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okhttp3.RequestBody; +import okhttp3.MediaType; +import okhttp3.internal.http.HttpMethod; +import lombok.experimental.Accessors; +import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.APIException; +import org.breedinginsight.brapi.client.v2.endpoints.model.BrAPIRequest; +import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.*; +import org.breedinginsight.brapi.client.v2.endpoints.model.response.Metadata; + +import java.io.File; +import java.io.IOException; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Accessors(fluent=true) +public class BrAPIClient { + private final String brapiURI; + @Getter + private final Gson gson; + private String authToken; + + public BrAPIClient(String brapiURI) { + this.brapiURI = brapiURI; + this.gson = new Gson(); + } + + /** + * Execute a request to the BrAPI service and don't process the response. + * @param request + * @throws APIException + */ + public void execute(BrAPIRequest request) throws HttpException, APIException { + execute(request, Optional.empty()); + } + + /** + * Execute a request to the BrAPI service, and process the response via the {@link ResponseHandlerFunction} + * @param request + * @param responseHandler User defined function to handle the result section of the {@link org.breedinginsight.brapi.client.v2.endpoints.model.response.BrAPIResponse} + * @param Object that the user expects. {@link ResponseHandlerFunction} must return this type. + * @return + * @throws APIException + */ + public Optional execute(BrAPIRequest request, ResponseHandlerFunction responseHandler) throws HttpException, APIException { + return execute(request, Optional.of(responseHandler)); + } + + /** + * Executes a user defined function to fetch an auth token from the BrAPI service, and store it in the {@link BrAPIClient} + * @param authHandler User defined function to retrieve an auth token + * @return true if auth succeeded, false otherwise + * @throws APIException + */ + public boolean authenticate(Function authHandler) throws APIException { + Optional authToken = Optional.ofNullable(authHandler.apply(null)); + if(authToken.isPresent()) { + this.authToken = authToken.get(); + return true; + } else { + return false; + } + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws APIException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws APIException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create(MediaType.parse(contentType), (File) obj); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = gson.toJson(obj); + } else { + content = null; + } + return RequestBody.create(MediaType.parse(contentType), content); + } else { + throw new APIException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Actual code to execute a request to the BrAPI service, and process the response via the {@link ResponseHandlerFunction} + * @param request + * @param responseHandler User defined function to handle the result section of the {@link org.breedinginsight.brapi.client.v2.endpoints.model.response.BrAPIResponse} + * @param Object that the user expects. {@link ResponseHandlerFunction} must return this type. + * @return + * @throws APIException + */ + private Optional execute(BrAPIRequest request, Optional> responseHandler) throws HttpException, APIException { + OkHttpClient client = getHttpClient(); + String contentType = request.getContentType(); + + // default to application/json + if (contentType == null) { + contentType = "application/json"; + } + + RequestBody reqBody; + if (!HttpMethod.permitsRequestBody(request.getMethod().name())) { + reqBody = null; + } else { + reqBody = serialize(request.getData(), contentType); + } + + Request.Builder httpReq = new Request.Builder().method(request.getMethod().name(), reqBody ); + if(this.authToken != null) { + httpReq.addHeader("Authorization", "Bearer " + authToken); + } + + StringBuilder url = new StringBuilder(request.getTarget()); + if(request.getParameters() != null && !request.getParameters().isEmpty()) { + url.append("?") + .append(request.getParameters() + .entrySet() + .stream() + .map(entry -> entry.getKey() + "=" + entry.getValue()) + .collect(Collectors.joining("&"))); + } + + httpReq.url(this.brapiURI + url.toString()); + + try(Response response = client.newCall(httpReq.build()).execute()) { + if (response.code() == 400) { + throw new HttpBadRequestException(response.body().string()); + } + else if (response.code() == 401) { + throw new HttpUnauthorizedException(response.body().string()); + } + else if (response.code() == 403) { + throw new HttpForbiddenException(response.body().string()); + } + else if (response.code() == 404){ + throw new HttpNotFoundException(response.body().string()); + } + else if (response.code() == 500) { + throw new HttpInternalServerError(response.body().string()); + } + if(response.isSuccessful()) { + // If a callback function was passed. Run it now. + if (responseHandler.isPresent()) { + try (ResponseBody body = response.body()) { + if(body != null) { + JsonObject responseJson = gson.fromJson(body.string(), JsonObject.class); + JsonElement resultJson = responseJson.get("result"); + Metadata metadata = gson.fromJson(responseJson.get("metadata"), Metadata.class); + + return Optional.ofNullable(responseHandler.get().apply(metadata, resultJson, gson())); + } + } + } + } + else { + throw new APIException(response.body().toString()); + } + } catch (IOException e) { + throw new APIException(e); + } + + return Optional.empty(); + } + + private OkHttpClient getHttpClient() { + return new OkHttpClient(); //have this here in case we want to configure the client later + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java new file mode 100644 index 00000000..d849106e --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java @@ -0,0 +1,13 @@ +package org.breedinginsight.brapi.client.v2.endpoints; + +import lombok.AccessLevel; +import lombok.Getter; + +public abstract class BrAPIEndpoint { + @Getter(AccessLevel.PROTECTED) + private BrAPIClient brAPIClient; + + protected BrAPIEndpoint(BrAPIClient brAPIClient) { + this.brAPIClient = brAPIClient; + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java new file mode 100644 index 00000000..7137d2de --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java @@ -0,0 +1,11 @@ +package org.breedinginsight.brapi.client.v2.endpoints; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import org.breedinginsight.brapi.client.v2.endpoints.model.response.Metadata; + +@FunctionalInterface +public interface ResponseHandlerFunction { + R apply(Metadata metadata, JsonElement resultJson, Gson gson); +} + diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java new file mode 100644 index 00000000..96b8d55d --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java @@ -0,0 +1,18 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model; + +import lombok.Builder; +import lombok.Getter; +import lombok.Singular; + +import java.util.Map; + +@Getter +@Builder +public class BrAPIRequest { + private final String target; + @Singular + private final Map parameters; + private final Object data; + private final String contentType; + private final HttpMethod method; +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java new file mode 100644 index 00000000..b8b29577 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java @@ -0,0 +1,5 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model; + +public enum HttpMethod { + GET, POST, PUT, DELETE +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java new file mode 100644 index 00000000..07713352 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java @@ -0,0 +1,23 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class APIException extends Exception { + public APIException() { + super(); + } + + public APIException(String message) { + super(message); + } + + public APIException(String message, Throwable cause) { + super(message, cause); + } + + public APIException(Throwable cause) { + super(cause); + } + + public APIException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java new file mode 100644 index 00000000..1eb5758f --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java @@ -0,0 +1,8 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpBadRequestException extends HttpException { + + public HttpBadRequestException(String message) { + super(message); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java new file mode 100644 index 00000000..b7316ff9 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java @@ -0,0 +1,8 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpException extends Exception { + + public HttpException(String message) { + super(message); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java new file mode 100644 index 00000000..d1e836c2 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java @@ -0,0 +1,9 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpForbiddenException extends HttpException { + + public HttpForbiddenException(String message) { + super(message); + } + +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java new file mode 100644 index 00000000..89c9a0ad --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java @@ -0,0 +1,8 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpInternalServerError extends HttpException { + + public HttpInternalServerError(String message) { + super(message); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java new file mode 100644 index 00000000..b5d39422 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java @@ -0,0 +1,8 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpNotFoundException extends HttpException { + + public HttpNotFoundException(String message) { + super(message); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java new file mode 100644 index 00000000..506453e9 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java @@ -0,0 +1,8 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; + +public class HttpUnauthorizedException extends HttpException { + + public HttpUnauthorizedException(String message) { + super(message); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java new file mode 100644 index 00000000..a8836baa --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java @@ -0,0 +1,22 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.request; + + +import java.util.HashMap; +import java.util.Map; + +public abstract class BaseRequest { + + protected Integer page; + protected Integer pageSize; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + if (page != null) params.put("page", page.toString()); + if (pageSize != null) params.put("pageSize", pageSize.toString()); + + return params; + } + +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java new file mode 100644 index 00000000..fceca97a --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java @@ -0,0 +1,40 @@ +package org.breedinginsight.brapi.client.v2.endpoints.model.request; + +import lombok.*; +import lombok.experimental.Accessors; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class ProgramsRequest extends BaseRequest { + + private String commonCropName; + private String programDbId; + private String programName; + private String abbreviation; + private String externalReferenceID; + private String externalReferenceSource; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + if (page != null) params.put("page", page.toString()); + if (pageSize != null) params.put("pageSize", pageSize.toString()); + if (commonCropName != null) params.put("commonCropName", commonCropName); + if (programDbId != null) params.put("programDbId", programDbId); + if (programName != null) params.put("programName", programName); + if (abbreviation != null) params.put("abbreviation", abbreviation); + if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); + if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); + + return params; + + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java new file mode 100755 index 00000000..06543daa --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java @@ -0,0 +1,30 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.breedinginsight.brapi.client.v2.endpoints.model.response; + +import lombok.*; +import lombok.experimental.Accessors; +/** + * CallsResponse + */ + +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@EqualsAndHashCode +@ToString +public class BrAPIResponse { + private Metadata metadata; + private T result; +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java new file mode 100644 index 00000000..c7b72cd1 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java @@ -0,0 +1,35 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.breedinginsight.brapi.client.v2.endpoints.model.response; + +import com.google.gson.annotations.SerializedName; + +import lombok.*; +import lombok.experimental.Accessors; + +import java.util.List; +/** + * CallsResponseResult + */ + +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@EqualsAndHashCode +@ToString +public class DataResponse { + @SerializedName(value="data", alternate={"observations", "test"}) + private List data; + +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java new file mode 100755 index 00000000..034a21dc --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java @@ -0,0 +1,33 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.breedinginsight.brapi.client.v2.endpoints.model.response; + +import lombok.*; +import lombok.experimental.Accessors; + +import java.util.List; +/** + * Metadata + */ + +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@EqualsAndHashCode +@ToString +public class Metadata { + private List datafiles; + private MetadataPagination pagination; + private List status; +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java new file mode 100755 index 00000000..a3f7104e --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java @@ -0,0 +1,32 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.breedinginsight.brapi.client.v2.endpoints.model.response; + +import lombok.*; +import lombok.experimental.Accessors; + +/** + * The pagination object is applicable only when the payload contains a \"data\" key. It describes the pagination of the data contained in the \"data\" array, as a way to identify which subset of data is being returned. Pages are zero indexed, so the first page will be page 0 (zero). + */ +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@EqualsAndHashCode +@ToString +public class MetadataPagination { + private Integer currentPage; + private Integer pageSize; + private Integer totalCount; + private Integer totalPages; +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java new file mode 100755 index 00000000..b6b7ee7d --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java @@ -0,0 +1,31 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.breedinginsight.brapi.client.v2.endpoints.model.response; + +import lombok.*; +import lombok.experimental.Accessors; + +/** + * Status + */ +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@EqualsAndHashCode +@ToString +public class Status { + private String code; + private String message; + private String messageType; +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java new file mode 100644 index 00000000..cb125482 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java @@ -0,0 +1,16 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.core; + +public class BrAPICoreEndpoints_V2 { + + public static String getRootPath() { + return "/brapi/v2"; + } + + public static String getProgramsPath() { + return getRootPath() + "/programs"; + } + + public static String getProgramsByIdPath(String programID) { + return String.format(getRootPath() + "/programs/%s", programID); + } +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java new file mode 100644 index 00000000..01bcdc79 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java @@ -0,0 +1,80 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.core; + +import com.google.gson.reflect.TypeToken; +import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.APIException; +import org.breedinginsight.brapi.client.v2.endpoints.model.BrAPIRequest; +import org.breedinginsight.brapi.client.v2.endpoints.model.HttpMethod; +import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.*; +import org.breedinginsight.brapi.client.v2.endpoints.model.response.DataResponse; +import org.breedinginsight.brapi.client.v2.endpoints.BrAPIClient; +import org.breedinginsight.brapi.client.v2.endpoints.BrAPIEndpoint; +import org.breedinginsight.brapi.client.v2.model.Program; +import org.breedinginsight.brapi.client.v2.endpoints.model.request.ProgramsRequest; + +import javax.swing.text.html.Option; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class ProgramsAPI extends BrAPIEndpoint { + + public ProgramsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } + + public List getPrograms(ProgramsRequest programFilter) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (programFilter == null) { + programFilter = new ProgramsRequest(); + } + + // Build our request + String endpoint = String.format(BrAPICoreEndpoints_V2.getProgramsPath()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(programFilter.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getPrograms() throws HttpException, APIException { + try { + return getPrograms(null); + } catch (APIException e){ + throw new APIException(e.getMessage()); + } + } + + public Optional getProgramById(String programID) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (programID == null) { + throw new APIException("Must specify programID for the getProgramById endpoint."); + } + + // Build our request + String endpoint = BrAPICoreEndpoints_V2.getProgramsByIdPath(programID); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Program resultResponse = gson.fromJson(resultJson, Program.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } + +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java new file mode 100644 index 00000000..c2a8e18a --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.genotype; + +public class BrAPIGenotypeEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java new file mode 100644 index 00000000..3cef40b0 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.germplasm; + +public class BrAPIGermplasmEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java new file mode 100644 index 00000000..3b791a92 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.phenotype; + +public class BrAPIPhenotypeEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java new file mode 100644 index 00000000..c46ae089 --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java @@ -0,0 +1,19 @@ +package org.breedinginsight.brapi.client.v2.model; + +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@RequiredArgsConstructor +public class ExternalReference { + + private final String referenceID; + private final String referenceSource; + +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java new file mode 100644 index 00000000..3bbc0dda --- /dev/null +++ b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java @@ -0,0 +1,27 @@ +package org.breedinginsight.brapi.client.v2.model; + +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +@Getter +@Setter +@Builder +@Accessors(fluent = true) +@RequiredArgsConstructor +public class Program { + + private final String abbreviation; + private final String commonCropName; + private final String documentationUrl; + private final List externalReferences; + private final String leadPersonDbId; + private final String leadPersonName; + private final String objective; + private final String programDbId; + private final String programName; +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ApiCallback.java b/brapi-client/src/main/resources/swagger-generated-client/ApiCallback.java new file mode 100755 index 00000000..772a68ff --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ApiCallback.java @@ -0,0 +1,59 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API downlond processing. + * + * @param bytesRead bytes Read + * @param contentLength content lenngth of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ApiClient.java b/brapi-client/src/main/resources/swagger-generated-client/ApiClient.java new file mode 100755 index 00000000..dc7a8d0c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ApiClient.java @@ -0,0 +1,1204 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.*; +import com.squareup.okhttp.internal.http.HttpMethod; +import com.squareup.okhttp.logging.HttpLoggingInterceptor; +import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; +import okio.BufferedSink; +import okio.Okio; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.swagger.client.auth.Authentication; +import io.swagger.client.auth.HttpBasicAuth; +import io.swagger.client.auth.ApiKeyAuth; +import io.swagger.client.auth.OAuth; + +public class ApiClient { + + private String basePath = "https://test-server.brapi.org/brapi/v1"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /* + * Constructor for ApiClient + */ + public ApiClient() { + httpClient = new OkHttpClient(); + + + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("Swagger-Codegen/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + authentications.put("AuthorizationToken", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Get base path + * + * @return Baes path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://test-server.brapi.org/brapi/v1 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client + * + * @param httpClient An instance of OkHttpClient + * @return Api Client + */ + public ApiClient setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + public DateFormat getDateFormat() { + return dateFormat; + } + + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient.interceptors().add(loggingInterceptor); + } else { + httpClient.interceptors().remove(loggingInterceptor); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.getConnectTimeout(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.getReadTimeout(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.getWriteTimeout(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create(MediaType.parse(contentType), (File) obj); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(MediaType.parse(contentType), content); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @throws IOException If fail to prepare file for download + * @return Prepared file for the download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @throws ApiException If fail to execute the call + * @return ApiResponse<T> + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @see #execute(Call, Type) + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Request request, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + * @return Type + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP call + * @throws ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams); + + final String url = buildUrl(path, queryParams, collectionQueryParams); + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + + String contentType = (String) headerParams.get("Content-Type"); + // ensuring a default content type + if (contentType == null) { + contentType = "application/json"; + } + + RequestBody reqBody; + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create(MediaType.parse(contentType), ""); + } + } else { + reqBody = serialize(body, contentType); + } + + Request request = null; + + if(progressRequestListener != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the ofrm of Map + * @param reqBuilder Reqeust.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + FormEncodingBuilder formBuilder = new FormEncodingBuilder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers = null; + HostnameVerifier hostnameVerifier = null; + if (!verifyingSsl) { + TrustManager trustAll = new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public X509Certificate[] getAcceptedIssuers() { return null; } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + trustManagers = new TrustManager[]{ trustAll }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { return true; } + }; + } else if (sslCaCert != null) { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(caKeyStore); + trustManagers = trustManagerFactory.getTrustManagers(); + } + + if (keyManagers != null || trustManagers != null) { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient.setSslSocketFactory(sslContext.getSocketFactory()); + } else { + httpClient.setSslSocketFactory(null); + } + httpClient.setHostnameVerifier(hostnameVerifier); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ApiException.java b/brapi-client/src/main/resources/swagger-generated-client/ApiException.java new file mode 100755 index 00000000..0c8a6dea --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ApiException.java @@ -0,0 +1,89 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ApiResponse.java b/brapi-client/src/main/resources/swagger-generated-client/ApiResponse.java new file mode 100755 index 00000000..fe9b1a6c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ApiResponse.java @@ -0,0 +1,58 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/Configuration.java b/brapi-client/src/main/resources/swagger-generated-client/Configuration.java new file mode 100755 index 00000000..64cf9262 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/Configuration.java @@ -0,0 +1,37 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/GzipRequestInterceptor.java b/brapi-client/src/main/resources/swagger-generated-client/GzipRequestInterceptor.java new file mode 100755 index 00000000..58bfa85a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/GzipRequestInterceptor.java @@ -0,0 +1,80 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/brapi-client/src/main/resources/swagger-generated-client/JSON.java b/brapi-client/src/main/resources/swagger-generated-client/JSON.java new file mode 100755 index 00000000..9fa1c072 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/JSON.java @@ -0,0 +1,386 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import io.swagger.client.model.*; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; + +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(VariableBaseClass.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map> classByDiscriminatorValue = new HashMap<>(); + + classByDiscriminatorValue.put("germplasmAttributeDef".toUpperCase(), GermplasmAttributeDef.class); + classByDiscriminatorValue.put("observationVariable".toUpperCase(), ObservationVariable.class); + classByDiscriminatorValue.put("VariableBaseClass".toUpperCase(), VariableBaseClass.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "")); + } + }) + .registerTypeSelector(ListSummary.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map> classByDiscriminatorValue = new HashMap<>(); + + classByDiscriminatorValue.put("listDetails".toUpperCase(), ListDetails.class); + classByDiscriminatorValue.put("ListSummary".toUpperCase(), ListSummary.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "")); + } + }) + ; + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map> classByDiscriminatorValue, String discriminatorValue) { + Class clazz = classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + * @return JSON + */ + public JSON setGson(Gson gson) { + this.gson = gson; + return this; + } + + public JSON setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + return this; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) + return (T) body; + else throw (e); + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() { + } + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() { + } + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public JSON setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + return this; + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/Pair.java b/brapi-client/src/main/resources/swagger-generated-client/Pair.java new file mode 100755 index 00000000..fa3d1446 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/Pair.java @@ -0,0 +1,50 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) return; + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) return; + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; + + return true; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ProgressRequestBody.java b/brapi-client/src/main/resources/swagger-generated-client/ProgressRequestBody.java new file mode 100755 index 00000000..ba7014e0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ProgressRequestBody.java @@ -0,0 +1,76 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + public interface ProgressRequestListener { + void onRequestProgress(long bytesWritten, long contentLength, boolean done); + } + + private final RequestBody requestBody; + + private final ProgressRequestListener progressListener; + + public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { + this.requestBody = requestBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/ProgressResponseBody.java b/brapi-client/src/main/resources/swagger-generated-client/ProgressResponseBody.java new file mode 100755 index 00000000..4411cdff --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/ProgressResponseBody.java @@ -0,0 +1,75 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + public interface ProgressListener { + void update(long bytesRead, long contentLength, boolean done); + } + + private final ResponseBody responseBody; + private final ProgressListener progressListener; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + this.responseBody = responseBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() throws IOException { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} + + diff --git a/brapi-client/src/main/resources/swagger-generated-client/StringUtil.java b/brapi-client/src/main/resources/swagger-generated-client/StringUtil.java new file mode 100755 index 00000000..60700cca --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/StringUtil.java @@ -0,0 +1,53 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/AuthenticationApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/AuthenticationApi.java new file mode 100755 index 00000000..2dc9256b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/AuthenticationApi.java @@ -0,0 +1,281 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import java.io.IOException; + + +import io.swagger.client.model.Body; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuthenticationApi { + private ApiClient apiClient; + + public AuthenticationApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuthenticationApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for loginPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginPostCall(Body body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/login"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call loginPostValidateBeforeCall(Body body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = loginPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Login + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void loginPost(Body body) throws ApiException { + loginPostWithHttpInfo(body); + } + + /** + * Login + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse loginPostWithHttpInfo(Body body) throws ApiException { + com.squareup.okhttp.Call call = loginPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Login (asynchronously) + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call loginPostAsync(Body body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = loginPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for logoutDelete + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutDeleteCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/logout"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call logoutDeleteValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = logoutDeleteCall(progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Logout + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void logoutDelete() throws ApiException { + logoutDeleteWithHttpInfo(); + } + + /** + * Logout + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse logoutDeleteWithHttpInfo() throws ApiException { + com.squareup.okhttp.Call call = logoutDeleteValidateBeforeCall(null, null); + return apiClient.execute(call); + } + + /** + * Logout (asynchronously) + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call logoutDeleteAsync(final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = logoutDeleteValidateBeforeCall(progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/CallsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/CallsApi.java new file mode 100755 index 00000000..69fca703 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/CallsApi.java @@ -0,0 +1,203 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.CallsResponse; +import io.swagger.client.model.WSMIMEDataTypes; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CallsApi { + private ApiClient apiClient; + + public CallsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CallsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for callsGet + * @param datatype DEPRECATED in v1.3 - see dataType (camel case) (optional) + * @param dataType The data format supported by the call. Example: `json` (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call callsGetCall(String datatype, WSMIMEDataTypes dataType, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/calls"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (datatype != null) + localVarQueryParams.addAll(apiClient.parameterToPair("datatype", datatype)); + if (dataType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dataType", dataType)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call callsGetValidateBeforeCall(String datatype, WSMIMEDataTypes dataType, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = callsGetCall(datatype, dataType, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the list of implemented Calls + * Implementation Notes Having a consistent structure for the path string of each call is very important for teams to be able to connect and find errors. Read more on Github. Here are the rules for the path of each call that should be returned Every word in the call path should match the documentation exactly, both in spelling and capitalization. Note that path strings are all lower case, but path parameters are camel case. Each path should start relative to \"/\" and therefore should not include \"/\" No leading or trailing slashes (\"/\") Path parameters are wrapped in curly braces (\"{}\"). The name of the path parameter should be spelled exactly as it is specified in the documentation. Examples GOOD \"call\": \"germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"germplasm/{id}/markerprofiles\" BAD \"call\": \"germplasm/{germplasmDbId}/markerProfiles\" BAD \"call\": \"germplasm/{germplasmdbid}/markerprofiles\" BAD \"call\": \"brapi/v1/germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"/germplasm/{germplasmDbId}/markerprofiles/\" BAD \"call\": \"germplasm/<germplasmDbId>/markerprofiles\" test-server.brapi.org/brapi/v1/calls + * @param datatype DEPRECATED in v1.3 - see dataType (camel case) (optional) + * @param dataType The data format supported by the call. Example: `json` (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return CallsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CallsResponse callsGet(String datatype, WSMIMEDataTypes dataType, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = callsGetWithHttpInfo(datatype, dataType, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the list of implemented Calls + * Implementation Notes Having a consistent structure for the path string of each call is very important for teams to be able to connect and find errors. Read more on Github. Here are the rules for the path of each call that should be returned Every word in the call path should match the documentation exactly, both in spelling and capitalization. Note that path strings are all lower case, but path parameters are camel case. Each path should start relative to \"/\" and therefore should not include \"/\" No leading or trailing slashes (\"/\") Path parameters are wrapped in curly braces (\"{}\"). The name of the path parameter should be spelled exactly as it is specified in the documentation. Examples GOOD \"call\": \"germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"germplasm/{id}/markerprofiles\" BAD \"call\": \"germplasm/{germplasmDbId}/markerProfiles\" BAD \"call\": \"germplasm/{germplasmdbid}/markerprofiles\" BAD \"call\": \"brapi/v1/germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"/germplasm/{germplasmDbId}/markerprofiles/\" BAD \"call\": \"germplasm/<germplasmDbId>/markerprofiles\" test-server.brapi.org/brapi/v1/calls + * @param datatype DEPRECATED in v1.3 - see dataType (camel case) (optional) + * @param dataType The data format supported by the call. Example: `json` (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<CallsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse callsGetWithHttpInfo(String datatype, WSMIMEDataTypes dataType, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = callsGetValidateBeforeCall(datatype, dataType, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the list of implemented Calls (asynchronously) + * Implementation Notes Having a consistent structure for the path string of each call is very important for teams to be able to connect and find errors. Read more on Github. Here are the rules for the path of each call that should be returned Every word in the call path should match the documentation exactly, both in spelling and capitalization. Note that path strings are all lower case, but path parameters are camel case. Each path should start relative to \"/\" and therefore should not include \"/\" No leading or trailing slashes (\"/\") Path parameters are wrapped in curly braces (\"{}\"). The name of the path parameter should be spelled exactly as it is specified in the documentation. Examples GOOD \"call\": \"germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"germplasm/{id}/markerprofiles\" BAD \"call\": \"germplasm/{germplasmDbId}/markerProfiles\" BAD \"call\": \"germplasm/{germplasmdbid}/markerprofiles\" BAD \"call\": \"brapi/v1/germplasm/{germplasmDbId}/markerprofiles\" BAD \"call\": \"/germplasm/{germplasmDbId}/markerprofiles/\" BAD \"call\": \"germplasm/<germplasmDbId>/markerprofiles\" test-server.brapi.org/brapi/v1/calls + * @param datatype DEPRECATED in v1.3 - see dataType (camel case) (optional) + * @param dataType The data format supported by the call. Example: `json` (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call callsGetAsync(String datatype, WSMIMEDataTypes dataType, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = callsGetValidateBeforeCall(datatype, dataType, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/CropsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/CropsApi.java new file mode 100755 index 00000000..11728caa --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/CropsApi.java @@ -0,0 +1,319 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.CommonCropNamesResponse; +import io.swagger.client.model.CropsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CropsApi { + private ApiClient apiClient; + + public CropsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CropsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for commoncropnamesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call commoncropnamesGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/commoncropnames"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call commoncropnamesGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = commoncropnamesGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Common Crop Names + * List the common crop names for the crops available in a database server. This call is **required** for multi-crop systems where data from multiple crops may be stored in the same database server. A distinct database server is defined by everything in the URL before \"/brapi/v1\", including host name and base path. This call is recommended for single crop systems to be compatible with multi-crop clients. For a single crop system the response should contain an array with exactly 1 element. The common crop name can be used as a search parameter for Programs, Studies, and Germplasm. test-server.brapi.org/brapi/v1/commonCropNames + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return CommonCropNamesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CommonCropNamesResponse commoncropnamesGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = commoncropnamesGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Common Crop Names + * List the common crop names for the crops available in a database server. This call is **required** for multi-crop systems where data from multiple crops may be stored in the same database server. A distinct database server is defined by everything in the URL before \"/brapi/v1\", including host name and base path. This call is recommended for single crop systems to be compatible with multi-crop clients. For a single crop system the response should contain an array with exactly 1 element. The common crop name can be used as a search parameter for Programs, Studies, and Germplasm. test-server.brapi.org/brapi/v1/commonCropNames + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<CommonCropNamesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse commoncropnamesGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = commoncropnamesGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Common Crop Names (asynchronously) + * List the common crop names for the crops available in a database server. This call is **required** for multi-crop systems where data from multiple crops may be stored in the same database server. A distinct database server is defined by everything in the URL before \"/brapi/v1\", including host name and base path. This call is recommended for single crop systems to be compatible with multi-crop clients. For a single crop system the response should contain an array with exactly 1 element. The common crop name can be used as a search parameter for Programs, Studies, and Germplasm. test-server.brapi.org/brapi/v1/commonCropNames + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call commoncropnamesGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = commoncropnamesGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for cropsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call cropsGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crops"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call cropsGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = cropsGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * List supported crops + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return CropsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CropsResponse cropsGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = cropsGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * List supported crops + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<CropsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse cropsGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = cropsGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * List supported crops (asynchronously) + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call cropsGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = cropsGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/DeprecatedApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/DeprecatedApi.java new file mode 100755 index 00000000..0281ca51 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/DeprecatedApi.java @@ -0,0 +1,1246 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.AlleleMatrixSearchRequest; +import io.swagger.client.model.AlleleMatrixValuesResponse1; +import io.swagger.client.model.Body; +import io.swagger.client.model.CropsResponse; +import io.swagger.client.model.NewObservationUnitDbIdsResponse; +import io.swagger.client.model.NewObservationsRequestWrapperDeprecated; +import io.swagger.client.model.ObservationLevelsResponse; +import io.swagger.client.model.StudyObservationVariablesResponse; +import io.swagger.client.model.StudyTypesResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DeprecatedApi { + private ApiClient apiClient; + + public DeprecatedApi() { + this(Configuration.getDefaultApiClient()); + } + + public DeprecatedApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for allelematrixSearchGet + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchGetCall(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/allelematrix-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (markerprofileDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerprofileDbId", markerprofileDbId)); + if (markerDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerDbId", markerDbId)); + if (matrixDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "matrixDbId", matrixDbId)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (expandHomozygotes != null) + localVarQueryParams.addAll(apiClient.parameterToPair("expandHomozygotes", expandHomozygotes)); + if (unknownString != null) + localVarQueryParams.addAll(apiClient.parameterToPair("unknownString", unknownString)); + if (sepPhased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepPhased", sepPhased)); + if (sepUnphased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepUnphased", sepUnphased)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematrixSearchGetValidateBeforeCall(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = allelematrixSearchGetCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Scores through GET + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return AlleleMatrixValuesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse1 allelematrixSearchGet(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = allelematrixSearchGetWithHttpInfo(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize); + return resp.getData(); + } + + /** + * Scores through GET + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<AlleleMatrixValuesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematrixSearchGetWithHttpInfo(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = allelematrixSearchGetValidateBeforeCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Scores through GET (asynchronously) + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchGetAsync(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematrixSearchGetValidateBeforeCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for allelematrixSearchPost + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchPostCall(AlleleMatrixSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/allelematrix-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "application/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematrixSearchPostValidateBeforeCall(AlleleMatrixSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling allelematrixSearchPost(Async)"); + } + + com.squareup.okhttp.Call call = allelematrixSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Scores through POST + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @return AlleleMatrixValuesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse1 allelematrixSearchPost(AlleleMatrixSearchRequest body) throws ApiException { + ApiResponse resp = allelematrixSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Scores through POST + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @return ApiResponse<AlleleMatrixValuesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematrixSearchPostWithHttpInfo(AlleleMatrixSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = allelematrixSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Scores through POST (asynchronously) + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchPostAsync(AlleleMatrixSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematrixSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for cropsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call cropsGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/crops"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call cropsGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = cropsGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * List supported crops + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return CropsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CropsResponse cropsGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = cropsGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * List supported crops + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<CropsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse cropsGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = cropsGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * List supported crops (asynchronously) + * For multi crop systems this is a useful call to list all the supported crops. test-server.brapi.org/brapi/v1/crops + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call cropsGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = cropsGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for loginPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call loginPostCall(Body body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/login"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call loginPostValidateBeforeCall(Body body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = loginPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Login + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void loginPost(Body body) throws ApiException { + loginPostWithHttpInfo(body); + } + + /** + * Login + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse loginPostWithHttpInfo(Body body) throws ApiException { + com.squareup.okhttp.Call call = loginPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Login (asynchronously) + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS Response data types Exception: the result is not embeded in a \"result\" structure in order to be (one day) OAuth2 compliant. It's also why the anwser mixes snake_case and camelCase. For login, returns a hash with the user name and the token as the value. A metadata key is also present (but usually set to null, unless an error condition occurs). For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. |Variable|Datatype|Description|Required| |------|------|------|:-----:| | userDisplayName| string| the display name of the user | Y | | access_token | string | the access token for the session | Y | | expires_in | integer | The lifetime in seconds of the access token | Y | + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call loginPostAsync(Body body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = loginPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for logoutDelete + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call logoutDeleteCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/logout"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call logoutDeleteValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = logoutDeleteCall(progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Logout + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void logoutDelete() throws ApiException { + logoutDeleteWithHttpInfo(); + } + + /** + * Logout + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse logoutDeleteWithHttpInfo() throws ApiException { + com.squareup.okhttp.Call call = logoutDeleteValidateBeforeCall(null, null); + return apiClient.execute(call); + } + + /** + * Logout (asynchronously) + * Implemented by: Tripal Brapi module, Cassavabase, Germinate, BMS Used by: Flapjack, BMS For logout, returns an empty resource. A token to remove could be provided (amdin interface) but it is not required. By default, current user token will be removed. + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call logoutDeleteAsync(final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = logoutDeleteValidateBeforeCall(progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for observationLevelsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call observationLevelsGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/observationLevels"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call observationLevelsGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = observationLevelsGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated List observation levels + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationLevelsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationLevelsResponse observationLevelsGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = observationLevelsGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * Deprecated List observation levels + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationLevelsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse observationLevelsGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = observationLevelsGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated List observation levels (asynchronously) + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call observationLevelsGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = observationLevelsGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationVariablesGet + * @param studyDbId string database unique identifier (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationVariables" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetValidateBeforeCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationVariablesGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetCall(studyDbId, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return StudyObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyObservationVariablesResponse studiesStudyDbIdObservationVariablesGet(String studyDbId) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationVariablesGetWithHttpInfo(studyDbId); + return resp.getData(); + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return ApiResponse<StudyObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationVariablesGetWithHttpInfo(String studyDbId) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Retrieve study observation variables (asynchronously) + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetAsync(String studyDbId, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsPost + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostValidateBeforeCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException("Missing the required parameter 'format' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsPost(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsPostWithHttpInfo(format, studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsPostWithHttpInfo(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Save Observation Unit Phenotypes (asynchronously) + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostAsync(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studyTypesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studyTypesGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studyTypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studyTypesGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studyTypesGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated List study types + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return StudyTypesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyTypesResponse studyTypesGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = studyTypesGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * Deprecated List study types + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<StudyTypesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studyTypesGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = studyTypesGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated List study types (asynchronously) + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studyTypesGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studyTypesGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/GenomeMapsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/GenomeMapsApi.java new file mode 100755 index 00000000..8baa68cc --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/GenomeMapsApi.java @@ -0,0 +1,679 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.GenomeMapsResponse; +import io.swagger.client.model.MapDetailsResponse; +import io.swagger.client.model.MarkerSummaryLinkageGroupResponse; +import io.swagger.client.model.MarkerSummaryMapResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GenomeMapsApi { + private ApiClient apiClient; + + public GenomeMapsApi() { + this(Configuration.getDefaultApiClient()); + } + + public GenomeMapsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for mapsGet + * @param species DEPRECATED in v1.3 - See \"scientificName\" (optional) + * @param commonCropName The common name of the crop, found from \"GET /commoncropnames\" (optional) + * @param scientificName Full scientific binomial format name. This includes Genus, Species, and Sub-species (optional) + * @param type Type of map (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call mapsGetCall(String species, String commonCropName, String scientificName, String type, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/maps"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (species != null) + localVarQueryParams.addAll(apiClient.parameterToPair("species", species)); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (scientificName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scientificName", scientificName)); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call mapsGetValidateBeforeCall(String species, String commonCropName, String scientificName, String type, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = mapsGetCall(species, commonCropName, scientificName, type, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Genomic Maps + * Get list of maps + * @param species DEPRECATED in v1.3 - See \"scientificName\" (optional) + * @param commonCropName The common name of the crop, found from \"GET /commoncropnames\" (optional) + * @param scientificName Full scientific binomial format name. This includes Genus, Species, and Sub-species (optional) + * @param type Type of map (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GenomeMapsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GenomeMapsResponse mapsGet(String species, String commonCropName, String scientificName, String type, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = mapsGetWithHttpInfo(species, commonCropName, scientificName, type, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Genomic Maps + * Get list of maps + * @param species DEPRECATED in v1.3 - See \"scientificName\" (optional) + * @param commonCropName The common name of the crop, found from \"GET /commoncropnames\" (optional) + * @param scientificName Full scientific binomial format name. This includes Genus, Species, and Sub-species (optional) + * @param type Type of map (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GenomeMapsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse mapsGetWithHttpInfo(String species, String commonCropName, String scientificName, String type, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = mapsGetValidateBeforeCall(species, commonCropName, scientificName, type, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Genomic Maps (asynchronously) + * Get list of maps + * @param species DEPRECATED in v1.3 - See \"scientificName\" (optional) + * @param commonCropName The common name of the crop, found from \"GET /commoncropnames\" (optional) + * @param scientificName Full scientific binomial format name. This includes Genus, Species, and Sub-species (optional) + * @param type Type of map (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call mapsGetAsync(String species, String commonCropName, String scientificName, String type, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = mapsGetValidateBeforeCall(species, commonCropName, scientificName, type, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for mapsMapDbIdGet + * @param mapDbId The internal db id of a selected map (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdGetCall(String mapDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/maps/{mapDbId}" + .replaceAll("\\{" + "mapDbId" + "\\}", apiClient.escapeString(mapDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call mapsMapDbIdGetValidateBeforeCall(String mapDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'mapDbId' is set + if (mapDbId == null) { + throw new ApiException("Missing the required parameter 'mapDbId' when calling mapsMapDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = mapsMapDbIdGetCall(mapDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Genomic Map + * Provides the number of markers on each linkageGroup and the max position on the linkageGroup + * @param mapDbId The internal db id of a selected map (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MapDetailsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MapDetailsResponse mapsMapDbIdGet(String mapDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = mapsMapDbIdGetWithHttpInfo(mapDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Genomic Map + * Provides the number of markers on each linkageGroup and the max position on the linkageGroup + * @param mapDbId The internal db id of a selected map (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MapDetailsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse mapsMapDbIdGetWithHttpInfo(String mapDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = mapsMapDbIdGetValidateBeforeCall(mapDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Genomic Map (asynchronously) + * Provides the number of markers on each linkageGroup and the max position on the linkageGroup + * @param mapDbId The internal db id of a selected map (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdGetAsync(String mapDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = mapsMapDbIdGetValidateBeforeCall(mapDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for mapsMapDbIdPositionsGet + * @param mapDbId unique id of the map (required) + * @param linkageGroupId Deprecated Use linkageGroupName instead (optional) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdPositionsGetCall(String mapDbId, String linkageGroupId, String linkageGroupName, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/maps/{mapDbId}/positions" + .replaceAll("\\{" + "mapDbId" + "\\}", apiClient.escapeString(mapDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (linkageGroupId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("linkageGroupId", linkageGroupId)); + if (linkageGroupName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("linkageGroupName", linkageGroupName)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call mapsMapDbIdPositionsGetValidateBeforeCall(String mapDbId, String linkageGroupId, String linkageGroupName, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'mapDbId' is set + if (mapDbId == null) { + throw new ApiException("Missing the required parameter 'mapDbId' when calling mapsMapDbIdPositionsGet(Async)"); + } + + com.squareup.okhttp.Call call = mapsMapDbIdPositionsGetCall(mapDbId, linkageGroupId, linkageGroupName, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the positions of Markers inside a specific Genomic Map + * All the markers in a given Map, ordered by linkageGroup and position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupId Deprecated Use linkageGroupName instead (optional) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkerSummaryMapResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkerSummaryMapResponse mapsMapDbIdPositionsGet(String mapDbId, String linkageGroupId, String linkageGroupName, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = mapsMapDbIdPositionsGetWithHttpInfo(mapDbId, linkageGroupId, linkageGroupName, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the positions of Markers inside a specific Genomic Map + * All the markers in a given Map, ordered by linkageGroup and position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupId Deprecated Use linkageGroupName instead (optional) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkerSummaryMapResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse mapsMapDbIdPositionsGetWithHttpInfo(String mapDbId, String linkageGroupId, String linkageGroupName, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = mapsMapDbIdPositionsGetValidateBeforeCall(mapDbId, linkageGroupId, linkageGroupName, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the positions of Markers inside a specific Genomic Map (asynchronously) + * All the markers in a given Map, ordered by linkageGroup and position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupId Deprecated Use linkageGroupName instead (optional) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdPositionsGetAsync(String mapDbId, String linkageGroupId, String linkageGroupName, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = mapsMapDbIdPositionsGetValidateBeforeCall(mapDbId, linkageGroupId, linkageGroupName, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for mapsMapDbIdPositionsLinkageGroupNameGet + * @param mapDbId unique id of the map (required) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (required) + * @param min minimum position on linkage group (optional) + * @param max maximum position on linkage group (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdPositionsLinkageGroupNameGetCall(String mapDbId, String linkageGroupName, Integer min, Integer max, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/maps/{mapDbId}/positions/{linkageGroupName}" + .replaceAll("\\{" + "mapDbId" + "\\}", apiClient.escapeString(mapDbId.toString())) + .replaceAll("\\{" + "linkageGroupName" + "\\}", apiClient.escapeString(linkageGroupName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (min != null) + localVarQueryParams.addAll(apiClient.parameterToPair("min", min)); + if (max != null) + localVarQueryParams.addAll(apiClient.parameterToPair("max", max)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call mapsMapDbIdPositionsLinkageGroupNameGetValidateBeforeCall(String mapDbId, String linkageGroupName, Integer min, Integer max, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'mapDbId' is set + if (mapDbId == null) { + throw new ApiException("Missing the required parameter 'mapDbId' when calling mapsMapDbIdPositionsLinkageGroupNameGet(Async)"); + } + // verify the required parameter 'linkageGroupName' is set + if (linkageGroupName == null) { + throw new ApiException("Missing the required parameter 'linkageGroupName' when calling mapsMapDbIdPositionsLinkageGroupNameGet(Async)"); + } + + com.squareup.okhttp.Call call = mapsMapDbIdPositionsLinkageGroupNameGetCall(mapDbId, linkageGroupName, min, max, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the positions of Markers inside a specific Linkage Group + * All the markers in a specific Linkage Group (aka Chromasome) inside a particular Map, ordered by position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (required) + * @param min minimum position on linkage group (optional) + * @param max maximum position on linkage group (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkerSummaryLinkageGroupResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkerSummaryLinkageGroupResponse mapsMapDbIdPositionsLinkageGroupNameGet(String mapDbId, String linkageGroupName, Integer min, Integer max, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = mapsMapDbIdPositionsLinkageGroupNameGetWithHttpInfo(mapDbId, linkageGroupName, min, max, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the positions of Markers inside a specific Linkage Group + * All the markers in a specific Linkage Group (aka Chromasome) inside a particular Map, ordered by position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (required) + * @param min minimum position on linkage group (optional) + * @param max maximum position on linkage group (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkerSummaryLinkageGroupResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse mapsMapDbIdPositionsLinkageGroupNameGetWithHttpInfo(String mapDbId, String linkageGroupName, Integer min, Integer max, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = mapsMapDbIdPositionsLinkageGroupNameGetValidateBeforeCall(mapDbId, linkageGroupName, min, max, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the positions of Markers inside a specific Linkage Group (asynchronously) + * All the markers in a specific Linkage Group (aka Chromasome) inside a particular Map, ordered by position. + * @param mapDbId unique id of the map (required) + * @param linkageGroupName The chromosome identifier or the generic linkage group identifier if the chromosome is not applicable. (required) + * @param min minimum position on linkage group (optional) + * @param max maximum position on linkage group (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call mapsMapDbIdPositionsLinkageGroupNameGetAsync(String mapDbId, String linkageGroupName, Integer min, Integer max, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = mapsMapDbIdPositionsLinkageGroupNameGetValidateBeforeCall(mapDbId, linkageGroupName, min, max, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmApi.java new file mode 100755 index 00000000..e0f53e83 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmApi.java @@ -0,0 +1,1997 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.BreedingMethodResponse; +import io.swagger.client.model.BreedingMethodsResponse; +import io.swagger.client.model.GermplasmAttributeListResponse; +import io.swagger.client.model.GermplasmMCPDResponse; +import io.swagger.client.model.GermplasmMarkerprofilesListResponse; +import io.swagger.client.model.GermplasmResponse; +import io.swagger.client.model.GermplasmResponse1; +import io.swagger.client.model.GermplasmResponse2; +import io.swagger.client.model.GermplasmSearchRequest; +import io.swagger.client.model.GermplasmSummaryListResponse; +import io.swagger.client.model.PedigreeResponse; +import io.swagger.client.model.ProgenyResponse; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GermplasmApi { + private ApiClient apiClient; + + public GermplasmApi() { + this(Configuration.getDefaultApiClient()); + } + + public GermplasmApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for breedingmethodsBreedingMethodDbIdGet + * @param breedingMethodDbId Internal database identifier for a breeding method (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call breedingmethodsBreedingMethodDbIdGetCall(String breedingMethodDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/breedingmethods/{breedingMethodDbId}" + .replaceAll("\\{" + "breedingMethodDbId" + "\\}", apiClient.escapeString(breedingMethodDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call breedingmethodsBreedingMethodDbIdGetValidateBeforeCall(String breedingMethodDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'breedingMethodDbId' is set + if (breedingMethodDbId == null) { + throw new ApiException("Missing the required parameter 'breedingMethodDbId' when calling breedingmethodsBreedingMethodDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = breedingmethodsBreedingMethodDbIdGetCall(breedingMethodDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Breeding Method + * Get the details of a specific Breeding Method used to produce Germplasm + * @param breedingMethodDbId Internal database identifier for a breeding method (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return BreedingMethodResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public BreedingMethodResponse breedingmethodsBreedingMethodDbIdGet(String breedingMethodDbId, String authorization) throws ApiException { + ApiResponse resp = breedingmethodsBreedingMethodDbIdGetWithHttpInfo(breedingMethodDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Breeding Method + * Get the details of a specific Breeding Method used to produce Germplasm + * @param breedingMethodDbId Internal database identifier for a breeding method (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<BreedingMethodResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse breedingmethodsBreedingMethodDbIdGetWithHttpInfo(String breedingMethodDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = breedingmethodsBreedingMethodDbIdGetValidateBeforeCall(breedingMethodDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Breeding Method (asynchronously) + * Get the details of a specific Breeding Method used to produce Germplasm + * @param breedingMethodDbId Internal database identifier for a breeding method (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call breedingmethodsBreedingMethodDbIdGetAsync(String breedingMethodDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = breedingmethodsBreedingMethodDbIdGetValidateBeforeCall(breedingMethodDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for breedingmethodsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call breedingmethodsGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/breedingmethods"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call breedingmethodsGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = breedingmethodsGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Breeding Methods + * Get the list of germplasm breeding methods available in a system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return BreedingMethodsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public BreedingMethodsResponse breedingmethodsGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = breedingmethodsGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Breeding Methods + * Get the list of germplasm breeding methods available in a system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<BreedingMethodsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse breedingmethodsGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = breedingmethodsGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Breeding Methods (asynchronously) + * Get the list of germplasm breeding methods available in a system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call breedingmethodsGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = breedingmethodsGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdAttributesGet + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetCall(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/attributes" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (attributeDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "attributeDbIds", attributeDbIds)); + if (attributeList != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "attributeList", attributeList)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetValidateBeforeCall(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdAttributesGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmAttributeListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmAttributeListResponse germplasmGermplasmDbIdAttributesGet(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdAttributesGetWithHttpInfo(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmAttributeListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdAttributesGetWithHttpInfo(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetValidateBeforeCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm (asynchronously) + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetAsync(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetValidateBeforeCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdGet + * @param germplasmDbId The internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdGetCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdGetValidateBeforeCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdGetCall(germplasmDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Germplasm + * Germplasm Details by germplasmDbId was merged with Germplasm Multi Crop Passport Data. The MCPD fields are optional and marked with the prefix [MCPD]. + * @param germplasmDbId The internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse2 germplasmGermplasmDbIdGet(String germplasmDbId, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdGetWithHttpInfo(germplasmDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Germplasm + * Germplasm Details by germplasmDbId was merged with Germplasm Multi Crop Passport Data. The MCPD fields are optional and marked with the prefix [MCPD]. + * @param germplasmDbId The internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdGetWithHttpInfo(String germplasmDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdGetValidateBeforeCall(germplasmDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Germplasm (asynchronously) + * Germplasm Details by germplasmDbId was merged with Germplasm Multi Crop Passport Data. The MCPD fields are optional and marked with the prefix [MCPD]. + * @param germplasmDbId The internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdGetAsync(String germplasmDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdGetValidateBeforeCall(germplasmDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdMarkerprofilesGet + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdMarkerprofilesGetCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/markerprofiles" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdMarkerprofilesGetValidateBeforeCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdMarkerprofilesGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMarkerprofilesGetCall(germplasmDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Marker Profiles associated with a specific Germplasm + * Retrieve the markerProfileDbIds for a given Germplasm ID + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmMarkerprofilesListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmMarkerprofilesListResponse germplasmGermplasmDbIdMarkerprofilesGet(String germplasmDbId, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdMarkerprofilesGetWithHttpInfo(germplasmDbId, authorization); + return resp.getData(); + } + + /** + * Get the Marker Profiles associated with a specific Germplasm + * Retrieve the markerProfileDbIds for a given Germplasm ID + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmMarkerprofilesListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdMarkerprofilesGetWithHttpInfo(String germplasmDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMarkerprofilesGetValidateBeforeCall(germplasmDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Marker Profiles associated with a specific Germplasm (asynchronously) + * Retrieve the markerProfileDbIds for a given Germplasm ID + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdMarkerprofilesGetAsync(String germplasmDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMarkerprofilesGetValidateBeforeCall(germplasmDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdMcpdGet + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdMcpdGetCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/mcpd" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdMcpdGetValidateBeforeCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdMcpdGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMcpdGetCall(germplasmDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specifc Germplasm in MCPD format + * Get all MCPD details of a germplasm <a target=\"_blank\" href=\"https://www.bioversityinternational.org/fileadmin/user_upload/online_library/publications/pdfs/FAOBIOVERSITY_MULTI-CROP_PASSPORT_DESCRIPTORS_V.2.1_2015_2020.pdf\"> MCPD v2.1 spec can be found here </a> Implementation Notes - When the MCPD spec identifies a field which can have multiple values returned, the JSON response should be an array instead of a semi-colon seperated string. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmMCPDResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmMCPDResponse germplasmGermplasmDbIdMcpdGet(String germplasmDbId, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdMcpdGetWithHttpInfo(germplasmDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specifc Germplasm in MCPD format + * Get all MCPD details of a germplasm <a target=\"_blank\" href=\"https://www.bioversityinternational.org/fileadmin/user_upload/online_library/publications/pdfs/FAOBIOVERSITY_MULTI-CROP_PASSPORT_DESCRIPTORS_V.2.1_2015_2020.pdf\"> MCPD v2.1 spec can be found here </a> Implementation Notes - When the MCPD spec identifies a field which can have multiple values returned, the JSON response should be an array instead of a semi-colon seperated string. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmMCPDResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdMcpdGetWithHttpInfo(String germplasmDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMcpdGetValidateBeforeCall(germplasmDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specifc Germplasm in MCPD format (asynchronously) + * Get all MCPD details of a germplasm <a target=\"_blank\" href=\"https://www.bioversityinternational.org/fileadmin/user_upload/online_library/publications/pdfs/FAOBIOVERSITY_MULTI-CROP_PASSPORT_DESCRIPTORS_V.2.1_2015_2020.pdf\"> MCPD v2.1 spec can be found here </a> Implementation Notes - When the MCPD spec identifies a field which can have multiple values returned, the JSON response should be an array instead of a semi-colon seperated string. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdMcpdGetAsync(String germplasmDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdMcpdGetValidateBeforeCall(germplasmDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdPedigreeGet + * @param germplasmDbId the internal id of the germplasm (required) + * @param notation text representation of the pedigree (optional) + * @param includeSiblings include array of siblings in response (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdPedigreeGetCall(String germplasmDbId, String notation, Boolean includeSiblings, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/pedigree" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (notation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("notation", notation)); + if (includeSiblings != null) + localVarQueryParams.addAll(apiClient.parameterToPair("includeSiblings", includeSiblings)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdPedigreeGetValidateBeforeCall(String germplasmDbId, String notation, Boolean includeSiblings, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdPedigreeGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdPedigreeGetCall(germplasmDbId, notation, includeSiblings, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the pedigree details of a specific Germplasm + * Get the parentage information of a specific Germplasm + * @param germplasmDbId the internal id of the germplasm (required) + * @param notation text representation of the pedigree (optional) + * @param includeSiblings include array of siblings in response (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return PedigreeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public PedigreeResponse germplasmGermplasmDbIdPedigreeGet(String germplasmDbId, String notation, Boolean includeSiblings, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdPedigreeGetWithHttpInfo(germplasmDbId, notation, includeSiblings, authorization); + return resp.getData(); + } + + /** + * Get the pedigree details of a specific Germplasm + * Get the parentage information of a specific Germplasm + * @param germplasmDbId the internal id of the germplasm (required) + * @param notation text representation of the pedigree (optional) + * @param includeSiblings include array of siblings in response (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<PedigreeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdPedigreeGetWithHttpInfo(String germplasmDbId, String notation, Boolean includeSiblings, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdPedigreeGetValidateBeforeCall(germplasmDbId, notation, includeSiblings, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the pedigree details of a specific Germplasm (asynchronously) + * Get the parentage information of a specific Germplasm + * @param germplasmDbId the internal id of the germplasm (required) + * @param notation text representation of the pedigree (optional) + * @param includeSiblings include array of siblings in response (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdPedigreeGetAsync(String germplasmDbId, String notation, Boolean includeSiblings, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdPedigreeGetValidateBeforeCall(germplasmDbId, notation, includeSiblings, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdProgenyGet + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdProgenyGetCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/progeny" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdProgenyGetValidateBeforeCall(String germplasmDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdProgenyGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdProgenyGetCall(germplasmDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the progeny details of a specific Germplasm + * Get the germplasmDbIds for all the Progeny of a particular germplasm. Implementation Notes - Regarding the 'parentType' field in the progeny object. Given a germplasm A having a progeny B and C, 'parentType' for progeny B refers to the 'parentType' of A toward B. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ProgenyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgenyResponse germplasmGermplasmDbIdProgenyGet(String germplasmDbId, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdProgenyGetWithHttpInfo(germplasmDbId, authorization); + return resp.getData(); + } + + /** + * Get the progeny details of a specific Germplasm + * Get the germplasmDbIds for all the Progeny of a particular germplasm. Implementation Notes - Regarding the 'parentType' field in the progeny object. Given a germplasm A having a progeny B and C, 'parentType' for progeny B refers to the 'parentType' of A toward B. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ProgenyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdProgenyGetWithHttpInfo(String germplasmDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdProgenyGetValidateBeforeCall(germplasmDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the progeny details of a specific Germplasm (asynchronously) + * Get the germplasmDbIds for all the Progeny of a particular germplasm. Implementation Notes - Regarding the 'parentType' field in the progeny object. Given a germplasm A having a progeny B and C, 'parentType' for progeny B refers to the 'parentType' of A toward B. + * @param germplasmDbId the internal id of the germplasm (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdProgenyGetAsync(String germplasmDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdProgenyGetValidateBeforeCall(germplasmDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGet + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGetCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmPUI != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmPUI", germplasmPUI)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (germplasmName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmName", germplasmName)); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGetValidateBeforeCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = germplasmGetCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm + * Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse germplasmGet(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = germplasmGetWithHttpInfo(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm + * Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGetWithHttpInfo(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm (asynchronously) + * Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGetAsync(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmSearchGet + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmSearchGetCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmPUI != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmPUI", germplasmPUI)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (germplasmName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmName", germplasmName)); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmSearchGetValidateBeforeCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = germplasmSearchGetCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Germplasm search through GET + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return GermplasmResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse1 germplasmSearchGet(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = germplasmSearchGetWithHttpInfo(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize); + return resp.getData(); + } + + /** + * Germplasm search through GET + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<GermplasmResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmSearchGetWithHttpInfo(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = germplasmSearchGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Germplasm search through GET (asynchronously) + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmSearchGetAsync(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmSearchGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmSearchPostCall(GermplasmSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/germplasm-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmSearchPostValidateBeforeCall(GermplasmSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = germplasmSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Germplasm search through POST + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @return GermplasmResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse1 germplasmSearchPost(GermplasmSearchRequest body) throws ApiException { + ApiResponse resp = germplasmSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Germplasm search through POST + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @return ApiResponse<GermplasmResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmSearchPostWithHttpInfo(GermplasmSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = germplasmSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Germplasm search through POST (asynchronously) + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmSearchPostAsync(GermplasmSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchGermplasmPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchGermplasmPostCall(GermplasmSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/germplasm"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchGermplasmPostValidateBeforeCall(GermplasmSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchGermplasmPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Germplasm + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchGermplasmPost(GermplasmSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchGermplasmPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Germplasm + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchGermplasmPostWithHttpInfo(GermplasmSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchGermplasmPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Germplasm (asynchronously) + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchGermplasmPostAsync(GermplasmSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchGermplasmPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchGermplasmSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/germplasm/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchGermplasmSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Germplasm search request + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse searchGermplasmSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchGermplasmSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Germplasm search request + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchGermplasmSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Germplasm search request (asynchronously) + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdGermplasmGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/germplasm" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdGermplasmGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm associated with a specific Study + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmSummaryListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmSummaryListResponse studiesStudyDbIdGermplasmGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdGermplasmGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm associated with a specific Study + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmSummaryListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdGermplasmGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm associated with a specific Study (asynchronously) + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmAttributesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmAttributesApi.java new file mode 100755 index 00000000..87379cc8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/GermplasmAttributesApi.java @@ -0,0 +1,487 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.GermplasmAttributeCategoriesResponse; +import io.swagger.client.model.GermplasmAttributeDefsResponse; +import io.swagger.client.model.GermplasmAttributeListResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GermplasmAttributesApi { + private ApiClient apiClient; + + public GermplasmAttributesApi() { + this(Configuration.getDefaultApiClient()); + } + + public GermplasmAttributesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for attributesCategoriesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call attributesCategoriesGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/attributes/categories"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call attributesCategoriesGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = attributesCategoriesGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Categories of Germplasm Attributes + * List all available attribute categories. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmAttributeCategoriesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmAttributeCategoriesResponse attributesCategoriesGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = attributesCategoriesGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Categories of Germplasm Attributes + * List all available attribute categories. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmAttributeCategoriesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse attributesCategoriesGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = attributesCategoriesGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Categories of Germplasm Attributes (asynchronously) + * List all available attribute categories. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call attributesCategoriesGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = attributesCategoriesGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for attributesGet + * @param attributeCategoryDbId Unique identifier for the general category for the attribute. very similar to Trait class. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call attributesGetCall(String attributeCategoryDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/attributes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (attributeCategoryDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("attributeCategoryDbId", attributeCategoryDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call attributesGetValidateBeforeCall(String attributeCategoryDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = attributesGetCall(attributeCategoryDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm Attributes + * List available attributes. + * @param attributeCategoryDbId Unique identifier for the general category for the attribute. very similar to Trait class. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmAttributeDefsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmAttributeDefsResponse attributesGet(String attributeCategoryDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = attributesGetWithHttpInfo(attributeCategoryDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm Attributes + * List available attributes. + * @param attributeCategoryDbId Unique identifier for the general category for the attribute. very similar to Trait class. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmAttributeDefsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse attributesGetWithHttpInfo(String attributeCategoryDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = attributesGetValidateBeforeCall(attributeCategoryDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm Attributes (asynchronously) + * List available attributes. + * @param attributeCategoryDbId Unique identifier for the general category for the attribute. very similar to Trait class. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call attributesGetAsync(String attributeCategoryDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = attributesGetValidateBeforeCall(attributeCategoryDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmGermplasmDbIdAttributesGet + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetCall(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm/{germplasmDbId}/attributes" + .replaceAll("\\{" + "germplasmDbId" + "\\}", apiClient.escapeString(germplasmDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (attributeDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "attributeDbIds", attributeDbIds)); + if (attributeList != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "attributeList", attributeList)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetValidateBeforeCall(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'germplasmDbId' is set + if (germplasmDbId == null) { + throw new ApiException("Missing the required parameter 'germplasmDbId' when calling germplasmGermplasmDbIdAttributesGet(Async)"); + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmAttributeListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmAttributeListResponse germplasmGermplasmDbIdAttributesGet(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = germplasmGermplasmDbIdAttributesGetWithHttpInfo(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmAttributeListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmGermplasmDbIdAttributesGetWithHttpInfo(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetValidateBeforeCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm Attributes associated with a specific Germplasm (asynchronously) + * Values for all attributes by default. + * @param germplasmDbId The germplasm characterized (required) + * @param attributeDbIds Restrict the response to only the listed attributeDbIds. (optional) + * @param attributeList **Deprecated** Use \"attributeDbIds\" instead (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmGermplasmDbIdAttributesGetAsync(String germplasmDbId, List attributeDbIds, List attributeList, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmGermplasmDbIdAttributesGetValidateBeforeCall(germplasmDbId, attributeDbIds, attributeList, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/ImagesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/ImagesApi.java new file mode 100755 index 00000000..7273cb42 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/ImagesApi.java @@ -0,0 +1,1020 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.ImageResponse; +import io.swagger.client.model.ImagesResponse; +import io.swagger.client.model.ImagesSearchRequest; +import io.swagger.client.model.NewImageRequest; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ImagesApi { + private ApiClient apiClient; + + public ImagesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ImagesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for imagesGet + * @param imageDbId The unique identifier for a image (optional) + * @param imageName The human readable name of an image (optional) + * @param observationUnitDbId The unique identifier of the observation unit an image is portraying (optional) + * @param observationDbId The unique identifier of the observation an image is accosiated with (optional) + * @param descriptiveOntologyTerm A descriptive term associated with an image (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call imagesGetCall(String imageDbId, String imageName, String observationUnitDbId, String observationDbId, String descriptiveOntologyTerm, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/images"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (imageDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageDbId", imageDbId)); + if (imageName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("imageName", imageName)); + if (observationUnitDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationUnitDbId", observationUnitDbId)); + if (observationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationDbId", observationDbId)); + if (descriptiveOntologyTerm != null) + localVarQueryParams.addAll(apiClient.parameterToPair("descriptiveOntologyTerm", descriptiveOntologyTerm)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call imagesGetValidateBeforeCall(String imageDbId, String imageName, String observationUnitDbId, String observationDbId, String descriptiveOntologyTerm, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = imagesGetCall(imageDbId, imageName, observationUnitDbId, observationDbId, descriptiveOntologyTerm, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the image meta data summaries + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (optional) + * @param imageName The human readable name of an image (optional) + * @param observationUnitDbId The unique identifier of the observation unit an image is portraying (optional) + * @param observationDbId The unique identifier of the observation an image is accosiated with (optional) + * @param descriptiveOntologyTerm A descriptive term associated with an image (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImagesResponse imagesGet(String imageDbId, String imageName, String observationUnitDbId, String observationDbId, String descriptiveOntologyTerm, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = imagesGetWithHttpInfo(imageDbId, imageName, observationUnitDbId, observationDbId, descriptiveOntologyTerm, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the image meta data summaries + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (optional) + * @param imageName The human readable name of an image (optional) + * @param observationUnitDbId The unique identifier of the observation unit an image is portraying (optional) + * @param observationDbId The unique identifier of the observation an image is accosiated with (optional) + * @param descriptiveOntologyTerm A descriptive term associated with an image (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse imagesGetWithHttpInfo(String imageDbId, String imageName, String observationUnitDbId, String observationDbId, String descriptiveOntologyTerm, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = imagesGetValidateBeforeCall(imageDbId, imageName, observationUnitDbId, observationDbId, descriptiveOntologyTerm, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the image meta data summaries (asynchronously) + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (optional) + * @param imageName The human readable name of an image (optional) + * @param observationUnitDbId The unique identifier of the observation unit an image is portraying (optional) + * @param observationDbId The unique identifier of the observation an image is accosiated with (optional) + * @param descriptiveOntologyTerm A descriptive term associated with an image (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call imagesGetAsync(String imageDbId, String imageName, String observationUnitDbId, String observationDbId, String descriptiveOntologyTerm, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = imagesGetValidateBeforeCall(imageDbId, imageName, observationUnitDbId, observationDbId, descriptiveOntologyTerm, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for imagesImageDbIdGet + * @param imageDbId The unique identifier for a image (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdGetCall(String imageDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/images/{imageDbId}" + .replaceAll("\\{" + "imageDbId" + "\\}", apiClient.escapeString(imageDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call imagesImageDbIdGetValidateBeforeCall(String imageDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'imageDbId' is set + if (imageDbId == null) { + throw new ApiException("Missing the required parameter 'imageDbId' when calling imagesImageDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = imagesImageDbIdGetCall(imageDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the an image meta data summary + * Get one image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImageResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImageResponse imagesImageDbIdGet(String imageDbId, String authorization) throws ApiException { + ApiResponse resp = imagesImageDbIdGetWithHttpInfo(imageDbId, authorization); + return resp.getData(); + } + + /** + * Get the an image meta data summary + * Get one image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImageResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse imagesImageDbIdGetWithHttpInfo(String imageDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = imagesImageDbIdGetValidateBeforeCall(imageDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the an image meta data summary (asynchronously) + * Get one image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param imageDbId The unique identifier for a image (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdGetAsync(String imageDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = imagesImageDbIdGetValidateBeforeCall(imageDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for imagesImageDbIdImagecontentPut + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdImagecontentPutCall(String imageDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/images/{imageDbId}/imagecontent" + .replaceAll("\\{" + "imageDbId" + "\\}", apiClient.escapeString(imageDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "image/_*" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call imagesImageDbIdImagecontentPutValidateBeforeCall(String imageDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'imageDbId' is set + if (imageDbId == null) { + throw new ApiException("Missing the required parameter 'imageDbId' when calling imagesImageDbIdImagecontentPut(Async)"); + } + + com.squareup.okhttp.Call call = imagesImageDbIdImagecontentPutCall(imageDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an image with the image file content + * Update an image with the image file content Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \"imageURL\" for retrieving the image, wherever it happens to live. + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImageResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImageResponse imagesImageDbIdImagecontentPut(String imageDbId, Object body, String authorization) throws ApiException { + ApiResponse resp = imagesImageDbIdImagecontentPutWithHttpInfo(imageDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an image with the image file content + * Update an image with the image file content Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \"imageURL\" for retrieving the image, wherever it happens to live. + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImageResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse imagesImageDbIdImagecontentPutWithHttpInfo(String imageDbId, Object body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = imagesImageDbIdImagecontentPutValidateBeforeCall(imageDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an image with the image file content (asynchronously) + * Update an image with the image file content Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \"imageURL\" for retrieving the image, wherever it happens to live. + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdImagecontentPutAsync(String imageDbId, Object body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = imagesImageDbIdImagecontentPutValidateBeforeCall(imageDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for imagesImageDbIdPut + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdPutCall(String imageDbId, NewImageRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/images/{imageDbId}" + .replaceAll("\\{" + "imageDbId" + "\\}", apiClient.escapeString(imageDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call imagesImageDbIdPutValidateBeforeCall(String imageDbId, NewImageRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'imageDbId' is set + if (imageDbId == null) { + throw new ApiException("Missing the required parameter 'imageDbId' when calling imagesImageDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = imagesImageDbIdPutCall(imageDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an image meta data + * Update an image meta data object Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}/imagecontent' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \\\"imageURL\\\" as an absolute path for retrieving the image, wherever it happens to live. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. ' + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImageResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImageResponse imagesImageDbIdPut(String imageDbId, NewImageRequest body, String authorization) throws ApiException { + ApiResponse resp = imagesImageDbIdPutWithHttpInfo(imageDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an image meta data + * Update an image meta data object Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}/imagecontent' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \\\"imageURL\\\" as an absolute path for retrieving the image, wherever it happens to live. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. ' + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImageResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse imagesImageDbIdPutWithHttpInfo(String imageDbId, NewImageRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = imagesImageDbIdPutValidateBeforeCall(imageDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an image meta data (asynchronously) + * Update an image meta data object Implementation Notes - This call should be paired with 'PUT /images/{imageDbId}/imagecontent' for full capability - A server may choose to modify the image meta data object based on the actually image which has been uploaded. - Image data may be stored in a database or file system. Servers should generate and provide the \\\"imageURL\\\" as an absolute path for retrieving the image, wherever it happens to live. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. ' + * @param imageDbId The unique identifier for a image (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call imagesImageDbIdPutAsync(String imageDbId, NewImageRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = imagesImageDbIdPutValidateBeforeCall(imageDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for imagesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call imagesPostCall(NewImageRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/images"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call imagesPostValidateBeforeCall(NewImageRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = imagesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Create a new image meta data object + * Create a new image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImageResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImageResponse imagesPost(NewImageRequest body, String authorization) throws ApiException { + ApiResponse resp = imagesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Create a new image meta data object + * Create a new image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImageResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse imagesPostWithHttpInfo(NewImageRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = imagesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create a new image meta data object (asynchronously) + * Create a new image meta data object Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. - The `/images` calls support a GeoJSON object structure for describing their location. The BrAPI spec for GeoJSON only supports two of the possible geometries: Points and Polygons. - With most images, the Point geometry should be used, and it should indicate the longitude and latitude of the camera. - For top down images (ie from drones, cranes, etc), the Point geometry may be used to indicate the longitude and latitude of the centroid of the image content, and the Polygon geometry may be used to indicate the border of the image content. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call imagesPostAsync(NewImageRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = imagesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchImagesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchImagesPostCall(ImagesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/images"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchImagesPostValidateBeforeCall(ImagesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchImagesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Images + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchImagesPost(ImagesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchImagesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Images + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchImagesPostWithHttpInfo(ImagesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchImagesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Images (asynchronously) + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchImagesPostAsync(ImagesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchImagesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchImagesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/images/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchImagesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of an Images search request + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImagesResponse searchImagesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchImagesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of an Images search request + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchImagesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of an Images search request (asynchronously) + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/ListsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/ListsApi.java new file mode 100755 index 00000000..97d57021 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/ListsApi.java @@ -0,0 +1,744 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.ListResponse; +import io.swagger.client.model.ListSummaryResponse; +import io.swagger.client.model.ListTypes; +import io.swagger.client.model.NewListRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ListsApi { + private ApiClient apiClient; + + public ListsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ListsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for listsGet + * @param listType The type of objects contained by this generic list (optional) + * @param listName The human readable name of this generic list (optional) + * @param listDbId The unique ID of this generic list (optional) + * @param listSource The source tag of this generic list (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call listsGetCall(ListTypes listType, String listName, String listDbId, String listSource, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/lists"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (listType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("listType", listType)); + if (listName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("listName", listName)); + if (listDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("listDbId", listDbId)); + if (listSource != null) + localVarQueryParams.addAll(apiClient.parameterToPair("listSource", listSource)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call listsGetValidateBeforeCall(ListTypes listType, String listName, String listDbId, String listSource, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = listsGetCall(listType, listName, listDbId, listSource, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the List Summaries + * Get filtered set of generic lists + * @param listType The type of objects contained by this generic list (optional) + * @param listName The human readable name of this generic list (optional) + * @param listDbId The unique ID of this generic list (optional) + * @param listSource The source tag of this generic list (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ListSummaryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ListSummaryResponse listsGet(ListTypes listType, String listName, String listDbId, String listSource, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = listsGetWithHttpInfo(listType, listName, listDbId, listSource, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the List Summaries + * Get filtered set of generic lists + * @param listType The type of objects contained by this generic list (optional) + * @param listName The human readable name of this generic list (optional) + * @param listDbId The unique ID of this generic list (optional) + * @param listSource The source tag of this generic list (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ListSummaryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse listsGetWithHttpInfo(ListTypes listType, String listName, String listDbId, String listSource, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = listsGetValidateBeforeCall(listType, listName, listDbId, listSource, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the List Summaries (asynchronously) + * Get filtered set of generic lists + * @param listType The type of objects contained by this generic list (optional) + * @param listName The human readable name of this generic list (optional) + * @param listDbId The unique ID of this generic list (optional) + * @param listSource The source tag of this generic list (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call listsGetAsync(ListTypes listType, String listName, String listDbId, String listSource, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = listsGetValidateBeforeCall(listType, listName, listDbId, listSource, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for listsListDbIdGet + * @param listDbId The unique ID of this generic list (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call listsListDbIdGetCall(String listDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/lists/{listDbId}" + .replaceAll("\\{" + "listDbId" + "\\}", apiClient.escapeString(listDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call listsListDbIdGetValidateBeforeCall(String listDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'listDbId' is set + if (listDbId == null) { + throw new ApiException("Missing the required parameter 'listDbId' when calling listsListDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = listsListDbIdGetCall(listDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific List + * Get a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ListResponse listsListDbIdGet(String listDbId, String authorization) throws ApiException { + ApiResponse resp = listsListDbIdGetWithHttpInfo(listDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific List + * Get a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse listsListDbIdGetWithHttpInfo(String listDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = listsListDbIdGetValidateBeforeCall(listDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific List (asynchronously) + * Get a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call listsListDbIdGetAsync(String listDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = listsListDbIdGetValidateBeforeCall(listDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for listsListDbIdItemsPost + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call listsListDbIdItemsPostCall(String listDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/lists/{listDbId}/items" + .replaceAll("\\{" + "listDbId" + "\\}", apiClient.escapeString(listDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call listsListDbIdItemsPostValidateBeforeCall(String listDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'listDbId' is set + if (listDbId == null) { + throw new ApiException("Missing the required parameter 'listDbId' when calling listsListDbIdItemsPost(Async)"); + } + + com.squareup.okhttp.Call call = listsListDbIdItemsPostCall(listDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add Items to a specific List + * Add new data to a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ListResponse listsListDbIdItemsPost(String listDbId, List body, String authorization) throws ApiException { + ApiResponse resp = listsListDbIdItemsPostWithHttpInfo(listDbId, body, authorization); + return resp.getData(); + } + + /** + * Add Items to a specific List + * Add new data to a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse listsListDbIdItemsPostWithHttpInfo(String listDbId, List body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = listsListDbIdItemsPostValidateBeforeCall(listDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add Items to a specific List (asynchronously) + * Add new data to a specific generic lists + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call listsListDbIdItemsPostAsync(String listDbId, List body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = listsListDbIdItemsPostValidateBeforeCall(listDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for listsListDbIdPut + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call listsListDbIdPutCall(String listDbId, NewListRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/lists/{listDbId}" + .replaceAll("\\{" + "listDbId" + "\\}", apiClient.escapeString(listDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call listsListDbIdPutValidateBeforeCall(String listDbId, NewListRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'listDbId' is set + if (listDbId == null) { + throw new ApiException("Missing the required parameter 'listDbId' when calling listsListDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = listsListDbIdPutCall(listDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update a specific List + * Update an existing generic list + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ListResponse listsListDbIdPut(String listDbId, NewListRequest body, String authorization) throws ApiException { + ApiResponse resp = listsListDbIdPutWithHttpInfo(listDbId, body, authorization); + return resp.getData(); + } + + /** + * Update a specific List + * Update an existing generic list + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse listsListDbIdPutWithHttpInfo(String listDbId, NewListRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = listsListDbIdPutValidateBeforeCall(listDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update a specific List (asynchronously) + * Update an existing generic list + * @param listDbId The unique ID of this generic list (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call listsListDbIdPutAsync(String listDbId, NewListRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = listsListDbIdPutValidateBeforeCall(listDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for listsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call listsPostCall(NewListRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/lists"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call listsPostValidateBeforeCall(NewListRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = listsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Create a New List + * Create a new list + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ListResponse listsPost(NewListRequest body, String authorization) throws ApiException { + ApiResponse resp = listsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Create a New List + * Create a new list + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse listsPostWithHttpInfo(NewListRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = listsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create a New List (asynchronously) + * Create a new list + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call listsPostAsync(NewListRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = listsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/LocationsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/LocationsApi.java new file mode 100755 index 00000000..8656fae4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/LocationsApi.java @@ -0,0 +1,328 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.LocationResponse; +import io.swagger.client.model.LocationsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LocationsApi { + private ApiClient apiClient; + + public LocationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public LocationsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for locationsGet + * @param locationType Filter by location type specified. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call locationsGetCall(String locationType, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/locations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (locationType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationType", locationType)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call locationsGetValidateBeforeCall(String locationType, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = locationsGetCall(locationType, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Locations + * Implemented by: Germinate Get a list of locations. * The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. * `altitude` is in meters. **Note**: Consider revising to describe polygon lat/lan points and check if adopting http://geojson.org/ is worth doing for v1. + * @param locationType Filter by location type specified. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return LocationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public LocationsResponse locationsGet(String locationType, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = locationsGetWithHttpInfo(locationType, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Locations + * Implemented by: Germinate Get a list of locations. * The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. * `altitude` is in meters. **Note**: Consider revising to describe polygon lat/lan points and check if adopting http://geojson.org/ is worth doing for v1. + * @param locationType Filter by location type specified. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<LocationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse locationsGetWithHttpInfo(String locationType, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = locationsGetValidateBeforeCall(locationType, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Locations (asynchronously) + * Implemented by: Germinate Get a list of locations. * The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. * `altitude` is in meters. **Note**: Consider revising to describe polygon lat/lan points and check if adopting http://geojson.org/ is worth doing for v1. + * @param locationType Filter by location type specified. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call locationsGetAsync(String locationType, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = locationsGetValidateBeforeCall(locationType, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for locationsLocationDbIdGet + * @param locationDbId The internal DB id for a location (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call locationsLocationDbIdGetCall(String locationDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/locations/{locationDbId}" + .replaceAll("\\{" + "locationDbId" + "\\}", apiClient.escapeString(locationDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call locationsLocationDbIdGetValidateBeforeCall(String locationDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'locationDbId' is set + if (locationDbId == null) { + throw new ApiException("Missing the required parameter 'locationDbId' when calling locationsLocationDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = locationsLocationDbIdGetCall(locationDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Location + * Get details for a location. - The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. - `altitude` is in meters. + * @param locationDbId The internal DB id for a location (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return LocationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public LocationResponse locationsLocationDbIdGet(String locationDbId, String authorization) throws ApiException { + ApiResponse resp = locationsLocationDbIdGetWithHttpInfo(locationDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Location + * Get details for a location. - The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. - `altitude` is in meters. + * @param locationDbId The internal DB id for a location (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<LocationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse locationsLocationDbIdGetWithHttpInfo(String locationDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = locationsLocationDbIdGetValidateBeforeCall(locationDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Location (asynchronously) + * Get details for a location. - The `countryCode` is as per [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec. - `altitude` is in meters. + * @param locationDbId The internal DB id for a location (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call locationsLocationDbIdGetAsync(String locationDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = locationsLocationDbIdGetValidateBeforeCall(locationDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/MarkerProfilesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/MarkerProfilesApi.java new file mode 100755 index 00000000..e738ea3b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/MarkerProfilesApi.java @@ -0,0 +1,1148 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.AlleleMatrixDetailsResponse; +import io.swagger.client.model.AlleleMatrixSearchRequest; +import io.swagger.client.model.AlleleMatrixValuesResponse; +import io.swagger.client.model.AlleleMatrixValuesResponse1; +import io.swagger.client.model.MarkerProfileDescriptionsResponse; +import io.swagger.client.model.MarkerProfilesResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MarkerProfilesApi { + private ApiClient apiClient; + + public MarkerProfilesApi() { + this(Configuration.getDefaultApiClient()); + } + + public MarkerProfilesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for allelematricesGet + * @param studyDbId restricts the list of matrices to a specific study. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematricesGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/allelematrices"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematricesGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling allelematricesGet(Async)"); + } + + com.squareup.okhttp.Call call = allelematricesGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Allele Matrix summaries + * This resource is used for reading and writing genomic matrices GET provides a list of available matrices, optionally filtered by study; + * @param studyDbId restricts the list of matrices to a specific study. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return AlleleMatrixDetailsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixDetailsResponse allelematricesGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = allelematricesGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Allele Matrix summaries + * This resource is used for reading and writing genomic matrices GET provides a list of available matrices, optionally filtered by study; + * @param studyDbId restricts the list of matrices to a specific study. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<AlleleMatrixDetailsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematricesGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = allelematricesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Allele Matrix summaries (asynchronously) + * This resource is used for reading and writing genomic matrices GET provides a list of available matrices, optionally filtered by study; + * @param studyDbId restricts the list of matrices to a specific study. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematricesGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematricesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for allelematricesSearchGet + * @param markerprofileDbId DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) (optional) + * @param markerProfileDbId The marker Profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerProfileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematricesSearchGetCall(List markerprofileDbId, List markerProfileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/allelematrices-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (markerprofileDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerprofileDbId", markerprofileDbId)); + if (markerProfileDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerProfileDbId", markerProfileDbId)); + if (markerDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerDbId", markerDbId)); + if (matrixDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "matrixDbId", matrixDbId)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (expandHomozygotes != null) + localVarQueryParams.addAll(apiClient.parameterToPair("expandHomozygotes", expandHomozygotes)); + if (unknownString != null) + localVarQueryParams.addAll(apiClient.parameterToPair("unknownString", unknownString)); + if (sepPhased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepPhased", sepPhased)); + if (sepUnphased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepUnphased", sepUnphased)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematricesSearchGetValidateBeforeCall(List markerprofileDbId, List markerProfileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = allelematricesSearchGetCall(markerprofileDbId, markerProfileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the a Matrix of Allele data + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) (optional) + * @param markerProfileDbId The marker Profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerProfileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return AlleleMatrixValuesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse allelematricesSearchGet(List markerprofileDbId, List markerProfileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = allelematricesSearchGetWithHttpInfo(markerprofileDbId, markerProfileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the a Matrix of Allele data + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) (optional) + * @param markerProfileDbId The marker Profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerProfileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<AlleleMatrixValuesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematricesSearchGetWithHttpInfo(List markerprofileDbId, List markerProfileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = allelematricesSearchGetValidateBeforeCall(markerprofileDbId, markerProfileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the a Matrix of Allele data (asynchronously) + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) (optional) + * @param markerProfileDbId The marker Profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerProfileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematricesSearchGetAsync(List markerprofileDbId, List markerProfileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematricesSearchGetValidateBeforeCall(markerprofileDbId, markerProfileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for allelematricesSearchPost + * @param body The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematricesSearchPostCall(AlleleMatrixSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/allelematrices-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "application/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematricesSearchPostValidateBeforeCall(AlleleMatrixSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling allelematricesSearchPost(Async)"); + } + + com.squareup.okhttp.Call call = allelematricesSearchPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a request to get a Matrix of Allele data + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats)' + * @param body The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return AlleleMatrixValuesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse allelematricesSearchPost(AlleleMatrixSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = allelematricesSearchPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a request to get a Matrix of Allele data + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats)' + * @param body The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<AlleleMatrixValuesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematricesSearchPostWithHttpInfo(AlleleMatrixSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = allelematricesSearchPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a request to get a Matrix of Allele data (asynchronously) + * See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats)' + * @param body The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematricesSearchPostAsync(AlleleMatrixSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematricesSearchPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for allelematrixSearchGet + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchGetCall(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/allelematrix-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (markerprofileDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerprofileDbId", markerprofileDbId)); + if (markerDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerDbId", markerDbId)); + if (matrixDbId != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "matrixDbId", matrixDbId)); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + if (expandHomozygotes != null) + localVarQueryParams.addAll(apiClient.parameterToPair("expandHomozygotes", expandHomozygotes)); + if (unknownString != null) + localVarQueryParams.addAll(apiClient.parameterToPair("unknownString", unknownString)); + if (sepPhased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepPhased", sepPhased)); + if (sepUnphased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepUnphased", sepUnphased)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematrixSearchGetValidateBeforeCall(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = allelematrixSearchGetCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Scores through GET + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return AlleleMatrixValuesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse1 allelematrixSearchGet(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = allelematrixSearchGetWithHttpInfo(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize); + return resp.getData(); + } + + /** + * Scores through GET + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<AlleleMatrixValuesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematrixSearchGetWithHttpInfo(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = allelematrixSearchGetValidateBeforeCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Scores through GET (asynchronously) + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use GET when parameter size is less than 2K bytes. This method may support asynchronous processing. + * @param markerprofileDbId The marker profile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (optional) + * @param markerDbId ids of the markers. if none are specified, results are returned for all markers in the database. Not Required if 'markerprofileDbId' or 'matrixDbId' is present. (optional) + * @param matrixDbId (optional) + * @param format format for the datafile to be downloaded. tsv and csv currently supported; flapjack may be supported. (optional) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single occurrence? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchGetAsync(List markerprofileDbId, List markerDbId, List matrixDbId, String format, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematrixSearchGetValidateBeforeCall(markerprofileDbId, markerDbId, matrixDbId, format, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for allelematrixSearchPost + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchPostCall(AlleleMatrixSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/allelematrix-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "application/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call allelematrixSearchPostValidateBeforeCall(AlleleMatrixSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling allelematrixSearchPost(Async)"); + } + + com.squareup.okhttp.Call call = allelematrixSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Scores through POST + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @return AlleleMatrixValuesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public AlleleMatrixValuesResponse1 allelematrixSearchPost(AlleleMatrixSearchRequest body) throws ApiException { + ApiResponse resp = allelematrixSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Scores through POST + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @return ApiResponse<AlleleMatrixValuesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse allelematrixSearchPostWithHttpInfo(AlleleMatrixSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = allelematrixSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Scores through POST (asynchronously) + * Status: ACCEPTED. Implemented by: Germinate (POST only), Cassavabase Used by: Flapjack (POST only) See Search Services for additional implementation details. This uses a more efficient data structure and pagination for large number of markers. Use POST when parameter size is greater than 2K bytes. - If no format is specified, this call returns the data in JSON form. - If a format (other than JSON) is specified and the server supports this format, it will return the link to the exported data file in the \"datafiles\" field of the \"metadata\". - If more than one format is requested at a time, the server will throw a \"501 Not Implemented\" error. The format of the tsv response can be found on GitHub (https://github.com/plantbreeding/Documentation/wiki/BrAPI-TSV-Expected-Formats) + * @param body The markerprofile db ids. Not Required if 'markerDbId' or 'matrixDbId' is present. (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call allelematrixSearchPostAsync(AlleleMatrixSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = allelematrixSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for markerprofilesGet + * @param germplasmDbId The server's internal ids for the Germplasm IDs, as returned by the Find marker profile by Germplasm service. (optional) + * @param studyDbId The server's internal id for the StudyDbId (optional) + * @param sampleDbId The server's internal id for the SampleDbId (optional) + * @param extractDbId The server's internal id for the ExtractDbId (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markerprofilesGetCall(String germplasmDbId, String studyDbId, String sampleDbId, String extractDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/markerprofiles"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (sampleDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sampleDbId", sampleDbId)); + if (extractDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("extractDbId", extractDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markerprofilesGetValidateBeforeCall(String germplasmDbId, String studyDbId, String sampleDbId, String extractDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = markerprofilesGetCall(germplasmDbId, studyDbId, sampleDbId, extractDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Marker Profiles + * For the requested Germplasm Id and/or Extract Id, returns the Markerprofile Id and number of non-missing allele calls (marker/allele pairs). + * @param germplasmDbId The server's internal ids for the Germplasm IDs, as returned by the Find marker profile by Germplasm service. (optional) + * @param studyDbId The server's internal id for the StudyDbId (optional) + * @param sampleDbId The server's internal id for the SampleDbId (optional) + * @param extractDbId The server's internal id for the ExtractDbId (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkerProfileDescriptionsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkerProfileDescriptionsResponse markerprofilesGet(String germplasmDbId, String studyDbId, String sampleDbId, String extractDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = markerprofilesGetWithHttpInfo(germplasmDbId, studyDbId, sampleDbId, extractDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Marker Profiles + * For the requested Germplasm Id and/or Extract Id, returns the Markerprofile Id and number of non-missing allele calls (marker/allele pairs). + * @param germplasmDbId The server's internal ids for the Germplasm IDs, as returned by the Find marker profile by Germplasm service. (optional) + * @param studyDbId The server's internal id for the StudyDbId (optional) + * @param sampleDbId The server's internal id for the SampleDbId (optional) + * @param extractDbId The server's internal id for the ExtractDbId (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkerProfileDescriptionsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markerprofilesGetWithHttpInfo(String germplasmDbId, String studyDbId, String sampleDbId, String extractDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = markerprofilesGetValidateBeforeCall(germplasmDbId, studyDbId, sampleDbId, extractDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Marker Profiles (asynchronously) + * For the requested Germplasm Id and/or Extract Id, returns the Markerprofile Id and number of non-missing allele calls (marker/allele pairs). + * @param germplasmDbId The server's internal ids for the Germplasm IDs, as returned by the Find marker profile by Germplasm service. (optional) + * @param studyDbId The server's internal id for the StudyDbId (optional) + * @param sampleDbId The server's internal id for the SampleDbId (optional) + * @param extractDbId The server's internal id for the ExtractDbId (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markerprofilesGetAsync(String germplasmDbId, String studyDbId, String sampleDbId, String extractDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markerprofilesGetValidateBeforeCall(germplasmDbId, studyDbId, sampleDbId, extractDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for markerprofilesMarkerProfileDbIdGet + * @param markerProfileDbId The server's internal id for the marker profile (required) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single orrucance? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markerprofilesMarkerProfileDbIdGetCall(String markerProfileDbId, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/markerprofiles/{markerProfileDbId}" + .replaceAll("\\{" + "markerProfileDbId" + "\\}", apiClient.escapeString(markerProfileDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (expandHomozygotes != null) + localVarQueryParams.addAll(apiClient.parameterToPair("expandHomozygotes", expandHomozygotes)); + if (unknownString != null) + localVarQueryParams.addAll(apiClient.parameterToPair("unknownString", unknownString)); + if (sepPhased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepPhased", sepPhased)); + if (sepUnphased != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sepUnphased", sepUnphased)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markerprofilesMarkerProfileDbIdGetValidateBeforeCall(String markerProfileDbId, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'markerProfileDbId' is set + if (markerProfileDbId == null) { + throw new ApiException("Missing the required parameter 'markerProfileDbId' when calling markerprofilesMarkerProfileDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = markerprofilesMarkerProfileDbIdGetCall(markerProfileDbId, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Marker Profile + * For the requested marker profile ID, returns the allele call for each marker. Allele encodings - Unknown data will by default be encoded by \\\"N\\\" - Homozygotes are returned as a single occurance, e.g. AA -> A, GG -> G - Phased heterozygotes are by default separated by a pipe (\\\"|\\\") and unphased heterozygotes are by default separated by a forward slash (\\\"/\\\") - Dominant markers such as DArTs: 1 for present, 0 for absent - If the user would like to use an empty string (\\\"\\\") for any of the parameters, the value should be set to the reserved word \\\"empty_string\\\", e.g. sepUnphased=empty_string. Open issue: The pages of data will need to be sorted sensibly in order for the requested page to be delivered consistently. By map or genome position? Alphabetically?'\" + * @param markerProfileDbId The server's internal id for the marker profile (required) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single orrucance? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkerProfilesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkerProfilesResponse markerprofilesMarkerProfileDbIdGet(String markerProfileDbId, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = markerprofilesMarkerProfileDbIdGetWithHttpInfo(markerProfileDbId, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Marker Profile + * For the requested marker profile ID, returns the allele call for each marker. Allele encodings - Unknown data will by default be encoded by \\\"N\\\" - Homozygotes are returned as a single occurance, e.g. AA -> A, GG -> G - Phased heterozygotes are by default separated by a pipe (\\\"|\\\") and unphased heterozygotes are by default separated by a forward slash (\\\"/\\\") - Dominant markers such as DArTs: 1 for present, 0 for absent - If the user would like to use an empty string (\\\"\\\") for any of the parameters, the value should be set to the reserved word \\\"empty_string\\\", e.g. sepUnphased=empty_string. Open issue: The pages of data will need to be sorted sensibly in order for the requested page to be delivered consistently. By map or genome position? Alphabetically?'\" + * @param markerProfileDbId The server's internal id for the marker profile (required) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single orrucance? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkerProfilesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markerprofilesMarkerProfileDbIdGetWithHttpInfo(String markerProfileDbId, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = markerprofilesMarkerProfileDbIdGetValidateBeforeCall(markerProfileDbId, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Marker Profile (asynchronously) + * For the requested marker profile ID, returns the allele call for each marker. Allele encodings - Unknown data will by default be encoded by \\\"N\\\" - Homozygotes are returned as a single occurance, e.g. AA -> A, GG -> G - Phased heterozygotes are by default separated by a pipe (\\\"|\\\") and unphased heterozygotes are by default separated by a forward slash (\\\"/\\\") - Dominant markers such as DArTs: 1 for present, 0 for absent - If the user would like to use an empty string (\\\"\\\") for any of the parameters, the value should be set to the reserved word \\\"empty_string\\\", e.g. sepUnphased=empty_string. Open issue: The pages of data will need to be sorted sensibly in order for the requested page to be delivered consistently. By map or genome position? Alphabetically?'\" + * @param markerProfileDbId The server's internal id for the marker profile (required) + * @param expandHomozygotes Should homozygotes NOT be collapsed into a single orrucance? (optional) + * @param unknownString The string to use as a representation for missing data or the reserved word \"empty_string\". (optional) + * @param sepPhased The string to use as a separator for phased allele calls or the reserved word \"empty_string\". (optional) + * @param sepUnphased The string to use as a separator for unphased allele calls or the reserved word \"empty_string\". (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markerprofilesMarkerProfileDbIdGetAsync(String markerProfileDbId, Boolean expandHomozygotes, String unknownString, String sepPhased, String sepUnphased, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markerprofilesMarkerProfileDbIdGetValidateBeforeCall(markerProfileDbId, expandHomozygotes, unknownString, sepPhased, sepUnphased, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/MarkersApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/MarkersApi.java new file mode 100755 index 00000000..56a5d76b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/MarkersApi.java @@ -0,0 +1,913 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.MarkerResponse; +import io.swagger.client.model.MarkersResponse; +import io.swagger.client.model.MarkersSearchRequest; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MarkersApi { + private ApiClient apiClient; + + public MarkersApi() { + this(Configuration.getDefaultApiClient()); + } + + public MarkersApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for markersGet + * @param markerDbId The database ID of the markers to search for (optional) + * @param markerName The search paramater for a marker name or synonym. (optional) + * @param name DEPRECAED in v1.3 - see \"markerName\" (optional) + * @param matchMethod DEPRECAED in v1.3 - see /search/markers (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param include DEPRECATED in v1.1 - see \"includeSynonyms\" (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markersGetCall(String markerDbId, String markerName, String name, String matchMethod, Boolean includeSynonyms, String include, String type, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/markers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (markerDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("markerDbId", markerDbId)); + if (markerName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("markerName", markerName)); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + if (matchMethod != null) + localVarQueryParams.addAll(apiClient.parameterToPair("matchMethod", matchMethod)); + if (includeSynonyms != null) + localVarQueryParams.addAll(apiClient.parameterToPair("includeSynonyms", includeSynonyms)); + if (include != null) + localVarQueryParams.addAll(apiClient.parameterToPair("include", include)); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markersGetValidateBeforeCall(String markerDbId, String markerName, String name, String matchMethod, Boolean includeSynonyms, String include, String type, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = markersGetCall(markerDbId, markerName, name, matchMethod, includeSynonyms, include, type, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Markers + * Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbId The database ID of the markers to search for (optional) + * @param markerName The search paramater for a marker name or synonym. (optional) + * @param name DEPRECAED in v1.3 - see \"markerName\" (optional) + * @param matchMethod DEPRECAED in v1.3 - see /search/markers (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param include DEPRECATED in v1.1 - see \"includeSynonyms\" (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkersResponse markersGet(String markerDbId, String markerName, String name, String matchMethod, Boolean includeSynonyms, String include, String type, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = markersGetWithHttpInfo(markerDbId, markerName, name, matchMethod, includeSynonyms, include, type, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Markers + * Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbId The database ID of the markers to search for (optional) + * @param markerName The search paramater for a marker name or synonym. (optional) + * @param name DEPRECAED in v1.3 - see \"markerName\" (optional) + * @param matchMethod DEPRECAED in v1.3 - see /search/markers (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param include DEPRECATED in v1.1 - see \"includeSynonyms\" (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markersGetWithHttpInfo(String markerDbId, String markerName, String name, String matchMethod, Boolean includeSynonyms, String include, String type, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = markersGetValidateBeforeCall(markerDbId, markerName, name, matchMethod, includeSynonyms, include, type, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Markers (asynchronously) + * Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbId The database ID of the markers to search for (optional) + * @param markerName The search paramater for a marker name or synonym. (optional) + * @param name DEPRECAED in v1.3 - see \"markerName\" (optional) + * @param matchMethod DEPRECAED in v1.3 - see /search/markers (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param include DEPRECATED in v1.1 - see \"includeSynonyms\" (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markersGetAsync(String markerDbId, String markerName, String name, String matchMethod, Boolean includeSynonyms, String include, String type, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markersGetValidateBeforeCall(markerDbId, markerName, name, matchMethod, includeSynonyms, include, type, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for markersMarkerDbIdGet + * @param markerDbId the internal id of the marker (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markersMarkerDbIdGetCall(String markerDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/markers/{markerDbId}" + .replaceAll("\\{" + "markerDbId" + "\\}", apiClient.escapeString(markerDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markersMarkerDbIdGetValidateBeforeCall(String markerDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'markerDbId' is set + if (markerDbId == null) { + throw new ApiException("Missing the required parameter 'markerDbId' when calling markersMarkerDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = markersMarkerDbIdGetCall(markerDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Marker + * Status: ACCEPTED Implemented By: + * @param markerDbId the internal id of the marker (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkerResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkerResponse markersMarkerDbIdGet(String markerDbId, String authorization) throws ApiException { + ApiResponse resp = markersMarkerDbIdGetWithHttpInfo(markerDbId, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Marker + * Status: ACCEPTED Implemented By: + * @param markerDbId the internal id of the marker (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkerResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markersMarkerDbIdGetWithHttpInfo(String markerDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = markersMarkerDbIdGetValidateBeforeCall(markerDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Marker (asynchronously) + * Status: ACCEPTED Implemented By: + * @param markerDbId the internal id of the marker (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markersMarkerDbIdGetAsync(String markerDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markersMarkerDbIdGetValidateBeforeCall(markerDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for markersSearchGet + * @param markerDbIds The database IDs of the markers to search for (optional) + * @param name The search pattern for a marker name or synonym. Examples: \"11_10002\" \"11_1%\" \"11_1*\" \"11_10?02\" (optional) + * @param matchMethod Possible values are 'case_insensitive', 'exact' (case sensitive), 'wildcard' (which is case insensitive). Wildcard uses both '*' and '%' for any number of characters and '?' for one character matching. Default is exact. (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markersSearchGetCall(List markerDbIds, String name, String matchMethod, Boolean includeSynonyms, String type, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/markers-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (markerDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "markerDbIds", markerDbIds)); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + if (matchMethod != null) + localVarQueryParams.addAll(apiClient.parameterToPair("matchMethod", matchMethod)); + if (includeSynonyms != null) + localVarQueryParams.addAll(apiClient.parameterToPair("includeSynonyms", includeSynonyms)); + if (type != null) + localVarQueryParams.addAll(apiClient.parameterToPair("type", type)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markersSearchGetValidateBeforeCall(List markerDbIds, String name, String matchMethod, Boolean includeSynonyms, String type, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = markersSearchGetCall(markerDbIds, name, matchMethod, includeSynonyms, type, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Markers Search (GET) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbIds The database IDs of the markers to search for (optional) + * @param name The search pattern for a marker name or synonym. Examples: \"11_10002\" \"11_1%\" \"11_1*\" \"11_10?02\" (optional) + * @param matchMethod Possible values are 'case_insensitive', 'exact' (case sensitive), 'wildcard' (which is case insensitive). Wildcard uses both '*' and '%' for any number of characters and '?' for one character matching. Default is exact. (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return MarkersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkersResponse markersSearchGet(List markerDbIds, String name, String matchMethod, Boolean includeSynonyms, String type, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = markersSearchGetWithHttpInfo(markerDbIds, name, matchMethod, includeSynonyms, type, page, pageSize); + return resp.getData(); + } + + /** + * Markers Search (GET) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbIds The database IDs of the markers to search for (optional) + * @param name The search pattern for a marker name or synonym. Examples: \"11_10002\" \"11_1%\" \"11_1*\" \"11_10?02\" (optional) + * @param matchMethod Possible values are 'case_insensitive', 'exact' (case sensitive), 'wildcard' (which is case insensitive). Wildcard uses both '*' and '%' for any number of characters and '?' for one character matching. Default is exact. (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<MarkersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markersSearchGetWithHttpInfo(List markerDbIds, String name, String matchMethod, Boolean includeSynonyms, String type, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = markersSearchGetValidateBeforeCall(markerDbIds, name, matchMethod, includeSynonyms, type, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Markers Search (GET) (asynchronously) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param markerDbIds The database IDs of the markers to search for (optional) + * @param name The search pattern for a marker name or synonym. Examples: \"11_10002\" \"11_1%\" \"11_1*\" \"11_10?02\" (optional) + * @param matchMethod Possible values are 'case_insensitive', 'exact' (case sensitive), 'wildcard' (which is case insensitive). Wildcard uses both '*' and '%' for any number of characters and '?' for one character matching. Default is exact. (optional) + * @param includeSynonyms Whether to include synonyms in the output. (optional) + * @param type The type of the marker. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markersSearchGetAsync(List markerDbIds, String name, String matchMethod, Boolean includeSynonyms, String type, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markersSearchGetValidateBeforeCall(markerDbIds, name, matchMethod, includeSynonyms, type, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for markersSearchPost + * @param body The database IDs of the markers to search for (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call markersSearchPostCall(MarkersSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/markers-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call markersSearchPostValidateBeforeCall(MarkersSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = markersSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Markers Search (POST) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param body The database IDs of the markers to search for (optional) + * @return MarkersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkersResponse markersSearchPost(MarkersSearchRequest body) throws ApiException { + ApiResponse resp = markersSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Markers Search (POST) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param body The database IDs of the markers to search for (optional) + * @return ApiResponse<MarkersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse markersSearchPostWithHttpInfo(MarkersSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = markersSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Markers Search (POST) (asynchronously) + * Scope: CORE. Status: ACCEPTED. Implemented by: Germinate See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. + * @param body The database IDs of the markers to search for (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call markersSearchPostAsync(MarkersSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = markersSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchMarkersPost + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchMarkersPostCall(MarkersSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/markers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchMarkersPostValidateBeforeCall(MarkersSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchMarkersPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Markers + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchMarkersPost(MarkersSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchMarkersPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Markers + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchMarkersPostWithHttpInfo(MarkersSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchMarkersPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Markers (asynchronously) + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchMarkersPostAsync(MarkersSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchMarkersPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchMarkersSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/markers/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchMarkersSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Markers search request + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkersResponse searchMarkersSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchMarkersSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Markers search request + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchMarkersSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Markers search request (asynchronously) + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/ObservationVariablesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/ObservationVariablesApi.java new file mode 100755 index 00000000..be05be0e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/ObservationVariablesApi.java @@ -0,0 +1,2849 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.DataTypesResponse; +import io.swagger.client.model.MethodResponse; +import io.swagger.client.model.MethodsResponse; +import io.swagger.client.model.NewMethodRequest; +import io.swagger.client.model.NewScaleRequest; +import io.swagger.client.model.NewTraitRequest; +import io.swagger.client.model.ObservationVariableResponse; +import io.swagger.client.model.ObservationVariableSearchRequest; +import io.swagger.client.model.ObservationVariableSearchRequestDep; +import io.swagger.client.model.ObservationVariablesResponse; +import io.swagger.client.model.ObservationVariablesResponse1; +import io.swagger.client.model.OntologiesResponse; +import io.swagger.client.model.ScaleResponse; +import io.swagger.client.model.ScalesResponse; +import io.swagger.client.model.StudyObservationVariablesResponse; +import io.swagger.client.model.StudyObservationVariablesResponse1; +import io.swagger.client.model.SuccessfulSearchResponse; +import io.swagger.client.model.TraitResponse; +import io.swagger.client.model.TraitSummaryResponse; +import io.swagger.client.model.TraitsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ObservationVariablesApi { + private ApiClient apiClient; + + public ObservationVariablesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ObservationVariablesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for methodsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call methodsGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/methods"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call methodsGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = methodsGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Methods + * Returns a list of Methods available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MethodsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MethodsResponse methodsGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = methodsGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Methods + * Returns a list of Methods available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MethodsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse methodsGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = methodsGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Methods (asynchronously) + * Returns a list of Methods available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call methodsGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = methodsGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for methodsMethodDbIdGet + * @param methodDbId Id of the method to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call methodsMethodDbIdGetCall(String methodDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/methods/{methodDbId}" + .replaceAll("\\{" + "methodDbId" + "\\}", apiClient.escapeString(methodDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call methodsMethodDbIdGetValidateBeforeCall(String methodDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'methodDbId' is set + if (methodDbId == null) { + throw new ApiException("Missing the required parameter 'methodDbId' when calling methodsMethodDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = methodsMethodDbIdGetCall(methodDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Method + * Retrieve details about a specific method An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param methodDbId Id of the method to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MethodResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MethodResponse methodsMethodDbIdGet(String methodDbId, String authorization) throws ApiException { + ApiResponse resp = methodsMethodDbIdGetWithHttpInfo(methodDbId, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Method + * Retrieve details about a specific method An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param methodDbId Id of the method to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MethodResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse methodsMethodDbIdGetWithHttpInfo(String methodDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = methodsMethodDbIdGetValidateBeforeCall(methodDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Method (asynchronously) + * Retrieve details about a specific method An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param methodDbId Id of the method to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call methodsMethodDbIdGetAsync(String methodDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = methodsMethodDbIdGetValidateBeforeCall(methodDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for methodsMethodDbIdPut + * @param methodDbId Id of the method to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call methodsMethodDbIdPutCall(String methodDbId, NewMethodRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/methods/{methodDbId}" + .replaceAll("\\{" + "methodDbId" + "\\}", apiClient.escapeString(methodDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call methodsMethodDbIdPutValidateBeforeCall(String methodDbId, NewMethodRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'methodDbId' is set + if (methodDbId == null) { + throw new ApiException("Missing the required parameter 'methodDbId' when calling methodsMethodDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = methodsMethodDbIdPutCall(methodDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an existing Method + * Update the details of an existing method + * @param methodDbId Id of the method to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MethodResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MethodResponse methodsMethodDbIdPut(String methodDbId, NewMethodRequest body, String authorization) throws ApiException { + ApiResponse resp = methodsMethodDbIdPutWithHttpInfo(methodDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an existing Method + * Update the details of an existing method + * @param methodDbId Id of the method to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MethodResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse methodsMethodDbIdPutWithHttpInfo(String methodDbId, NewMethodRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = methodsMethodDbIdPutValidateBeforeCall(methodDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an existing Method (asynchronously) + * Update the details of an existing method + * @param methodDbId Id of the method to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call methodsMethodDbIdPutAsync(String methodDbId, NewMethodRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = methodsMethodDbIdPutValidateBeforeCall(methodDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for methodsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call methodsPostCall(NewMethodRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/methods"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call methodsPostValidateBeforeCall(NewMethodRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = methodsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add a new Method + * Create a new method object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MethodResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MethodResponse methodsPost(NewMethodRequest body, String authorization) throws ApiException { + ApiResponse resp = methodsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Add a new Method + * Create a new method object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MethodResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse methodsPostWithHttpInfo(NewMethodRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = methodsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add a new Method (asynchronously) + * Create a new method object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call methodsPostAsync(NewMethodRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = methodsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for ontologiesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call ontologiesGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/ontologies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call ontologiesGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = ontologiesGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Ontologies + * Call to retrieve a list of observation variable ontologies available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return OntologiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public OntologiesResponse ontologiesGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = ontologiesGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Ontologies + * Call to retrieve a list of observation variable ontologies available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<OntologiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse ontologiesGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = ontologiesGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Ontologies (asynchronously) + * Call to retrieve a list of observation variable ontologies available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call ontologiesGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = ontologiesGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for scalesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scalesGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/scales"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scalesGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = scalesGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Scales + * Returns a list of Scales available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ScalesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ScalesResponse scalesGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = scalesGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Scales + * Returns a list of Scales available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ScalesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scalesGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = scalesGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Scales (asynchronously) + * Returns a list of Scales available on a server. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scalesGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scalesGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for scalesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scalesPostCall(NewScaleRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/scales"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scalesPostValidateBeforeCall(NewScaleRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = scalesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add a new Scale + * Create a new scale object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ScaleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ScaleResponse scalesPost(NewScaleRequest body, String authorization) throws ApiException { + ApiResponse resp = scalesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Add a new Scale + * Create a new scale object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ScaleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scalesPostWithHttpInfo(NewScaleRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = scalesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add a new Scale (asynchronously) + * Create a new scale object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scalesPostAsync(NewScaleRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scalesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for scalesScaleDbIdGet + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scalesScaleDbIdGetCall(String scaleDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/scales/{scaleDbId}" + .replaceAll("\\{" + "scaleDbId" + "\\}", apiClient.escapeString(scaleDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scalesScaleDbIdGetValidateBeforeCall(String scaleDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'scaleDbId' is set + if (scaleDbId == null) { + throw new ApiException("Missing the required parameter 'scaleDbId' when calling scalesScaleDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = scalesScaleDbIdGetCall(scaleDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Scale + * Retrieve details about a specific scale An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ScaleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ScaleResponse scalesScaleDbIdGet(String scaleDbId, String authorization) throws ApiException { + ApiResponse resp = scalesScaleDbIdGetWithHttpInfo(scaleDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Scale + * Retrieve details about a specific scale An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ScaleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scalesScaleDbIdGetWithHttpInfo(String scaleDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = scalesScaleDbIdGetValidateBeforeCall(scaleDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Scale (asynchronously) + * Retrieve details about a specific scale An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scalesScaleDbIdGetAsync(String scaleDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scalesScaleDbIdGetValidateBeforeCall(scaleDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for scalesScaleDbIdPut + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scalesScaleDbIdPutCall(String scaleDbId, NewScaleRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/scales/{scaleDbId}" + .replaceAll("\\{" + "scaleDbId" + "\\}", apiClient.escapeString(scaleDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scalesScaleDbIdPutValidateBeforeCall(String scaleDbId, NewScaleRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'scaleDbId' is set + if (scaleDbId == null) { + throw new ApiException("Missing the required parameter 'scaleDbId' when calling scalesScaleDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = scalesScaleDbIdPutCall(scaleDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an existing Scale + * Update the details of an existing scale + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ScaleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ScaleResponse scalesScaleDbIdPut(String scaleDbId, NewScaleRequest body, String authorization) throws ApiException { + ApiResponse resp = scalesScaleDbIdPutWithHttpInfo(scaleDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an existing Scale + * Update the details of an existing scale + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ScaleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scalesScaleDbIdPutWithHttpInfo(String scaleDbId, NewScaleRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = scalesScaleDbIdPutValidateBeforeCall(scaleDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an existing Scale (asynchronously) + * Update the details of an existing scale + * @param scaleDbId Id of the scale to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scalesScaleDbIdPutAsync(String scaleDbId, NewScaleRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scalesScaleDbIdPutValidateBeforeCall(scaleDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchVariablesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchVariablesPostCall(ObservationVariableSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/variables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchVariablesPostValidateBeforeCall(ObservationVariableSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchVariablesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Observation Variables + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchVariablesPost(ObservationVariableSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchVariablesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Observation Variables + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchVariablesPostWithHttpInfo(ObservationVariableSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchVariablesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Observation Variables (asynchronously) + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchVariablesPostAsync(ObservationVariableSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchVariablesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchVariablesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/variables/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchVariablesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Observation Variable search request + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationVariablesResponse searchVariablesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchVariablesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Observation Variable search request + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchVariablesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Observation Variable search request (asynchronously) + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationVariablesGet + * @param studyDbId string database unique identifier (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationVariables" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetValidateBeforeCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationVariablesGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetCall(studyDbId, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return StudyObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyObservationVariablesResponse studiesStudyDbIdObservationVariablesGet(String studyDbId) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationVariablesGetWithHttpInfo(studyDbId); + return resp.getData(); + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return ApiResponse<StudyObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationVariablesGetWithHttpInfo(String studyDbId) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Retrieve study observation variables (asynchronously) + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetAsync(String studyDbId, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationvariablesGet + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationvariables" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationvariablesGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Variables for a specific Study + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudyObservationVariablesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyObservationVariablesResponse1 studiesStudyDbIdObservationvariablesGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationvariablesGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Variables for a specific Study + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudyObservationVariablesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationvariablesGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Variables for a specific Study (asynchronously) + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for traitsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call traitsGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/traits"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call traitsGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = traitsGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Traits + * Call to retrieve a list of traits available in the system and their associated variables. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TraitsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TraitsResponse traitsGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = traitsGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Traits + * Call to retrieve a list of traits available in the system and their associated variables. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TraitsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse traitsGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = traitsGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Traits (asynchronously) + * Call to retrieve a list of traits available in the system and their associated variables. An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call traitsGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = traitsGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for traitsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call traitsPostCall(NewTraitRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/traits"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call traitsPostValidateBeforeCall(NewTraitRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = traitsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add a new Trait + * Create a new trait object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TraitResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TraitResponse traitsPost(NewTraitRequest body, String authorization) throws ApiException { + ApiResponse resp = traitsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Add a new Trait + * Create a new trait object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TraitResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse traitsPostWithHttpInfo(NewTraitRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = traitsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add a new Trait (asynchronously) + * Create a new trait object in the database + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call traitsPostAsync(NewTraitRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = traitsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for traitsTraitDbIdGet + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call traitsTraitDbIdGetCall(String traitDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/traits/{traitDbId}" + .replaceAll("\\{" + "traitDbId" + "\\}", apiClient.escapeString(traitDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call traitsTraitDbIdGetValidateBeforeCall(String traitDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'traitDbId' is set + if (traitDbId == null) { + throw new ApiException("Missing the required parameter 'traitDbId' when calling traitsTraitDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = traitsTraitDbIdGetCall(traitDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Trait + * Retrieve the details of a single trait An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TraitSummaryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TraitSummaryResponse traitsTraitDbIdGet(String traitDbId, String authorization) throws ApiException { + ApiResponse resp = traitsTraitDbIdGetWithHttpInfo(traitDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Trait + * Retrieve the details of a single trait An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TraitSummaryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse traitsTraitDbIdGetWithHttpInfo(String traitDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = traitsTraitDbIdGetValidateBeforeCall(traitDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Trait (asynchronously) + * Retrieve the details of a single trait An Observation Variable has 3 critical parts: A Trait being observed, a Method for making the observation, and a Scale on which the observation can be measured and compared with other observations. + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call traitsTraitDbIdGetAsync(String traitDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = traitsTraitDbIdGetValidateBeforeCall(traitDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for traitsTraitDbIdPut + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call traitsTraitDbIdPutCall(String traitDbId, NewTraitRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/traits/{traitDbId}" + .replaceAll("\\{" + "traitDbId" + "\\}", apiClient.escapeString(traitDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call traitsTraitDbIdPutValidateBeforeCall(String traitDbId, NewTraitRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'traitDbId' is set + if (traitDbId == null) { + throw new ApiException("Missing the required parameter 'traitDbId' when calling traitsTraitDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = traitsTraitDbIdPutCall(traitDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an existing Trait + * Update an existing trait + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TraitResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TraitResponse traitsTraitDbIdPut(String traitDbId, NewTraitRequest body, String authorization) throws ApiException { + ApiResponse resp = traitsTraitDbIdPutWithHttpInfo(traitDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an existing Trait + * Update an existing trait + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TraitResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse traitsTraitDbIdPutWithHttpInfo(String traitDbId, NewTraitRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = traitsTraitDbIdPutValidateBeforeCall(traitDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an existing Trait (asynchronously) + * Update an existing trait + * @param traitDbId Id of the trait to retrieve details of. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call traitsTraitDbIdPutAsync(String traitDbId, NewTraitRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = traitsTraitDbIdPutValidateBeforeCall(traitDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for variablesDatatypesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call variablesDatatypesGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/variables/datatypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call variablesDatatypesGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = variablesDatatypesGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Variable data type list + * DEPRECATED in v1.3 - See documentation on BrAPI fixed set of data types, references from the Crop Ontology + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return DataTypesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public DataTypesResponse variablesDatatypesGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = variablesDatatypesGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * Variable data type list + * DEPRECATED in v1.3 - See documentation on BrAPI fixed set of data types, references from the Crop Ontology + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<DataTypesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse variablesDatatypesGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = variablesDatatypesGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Variable data type list (asynchronously) + * DEPRECATED in v1.3 - See documentation on BrAPI fixed set of data types, references from the Crop Ontology + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call variablesDatatypesGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = variablesDatatypesGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for variablesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param observationVariableDbId Variable's unique ID (optional) + * @param traitClass Variable's trait class (phenological, physiological, morphological, etc.) (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call variablesGetCall(Integer page, Integer pageSize, String authorization, String observationVariableDbId, String traitClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/variables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + if (observationVariableDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationVariableDbId", observationVariableDbId)); + if (traitClass != null) + localVarQueryParams.addAll(apiClient.parameterToPair("traitClass", traitClass)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call variablesGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, String observationVariableDbId, String traitClass, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = variablesGetCall(page, pageSize, authorization, observationVariableDbId, traitClass, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Variables + * Call to retrieve a list of observationVariables available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param observationVariableDbId Variable's unique ID (optional) + * @param traitClass Variable's trait class (phenological, physiological, morphological, etc.) (optional) + * @return ObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationVariablesResponse variablesGet(Integer page, Integer pageSize, String authorization, String observationVariableDbId, String traitClass) throws ApiException { + ApiResponse resp = variablesGetWithHttpInfo(page, pageSize, authorization, observationVariableDbId, traitClass); + return resp.getData(); + } + + /** + * Get the Observation Variables + * Call to retrieve a list of observationVariables available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param observationVariableDbId Variable's unique ID (optional) + * @param traitClass Variable's trait class (phenological, physiological, morphological, etc.) (optional) + * @return ApiResponse<ObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse variablesGetWithHttpInfo(Integer page, Integer pageSize, String authorization, String observationVariableDbId, String traitClass) throws ApiException { + com.squareup.okhttp.Call call = variablesGetValidateBeforeCall(page, pageSize, authorization, observationVariableDbId, traitClass, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Variables (asynchronously) + * Call to retrieve a list of observationVariables available in the system. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param observationVariableDbId Variable's unique ID (optional) + * @param traitClass Variable's trait class (phenological, physiological, morphological, etc.) (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call variablesGetAsync(Integer page, Integer pageSize, String authorization, String observationVariableDbId, String traitClass, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = variablesGetValidateBeforeCall(page, pageSize, authorization, observationVariableDbId, traitClass, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for variablesObservationVariableDbIdGet + * @param observationVariableDbId string id of the variable (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call variablesObservationVariableDbIdGetCall(String observationVariableDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/variables/{observationVariableDbId}" + .replaceAll("\\{" + "observationVariableDbId" + "\\}", apiClient.escapeString(observationVariableDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call variablesObservationVariableDbIdGetValidateBeforeCall(String observationVariableDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'observationVariableDbId' is set + if (observationVariableDbId == null) { + throw new ApiException("Missing the required parameter 'observationVariableDbId' when calling variablesObservationVariableDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = variablesObservationVariableDbIdGetCall(observationVariableDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Observation Variable + * Retrieve variable details + * @param observationVariableDbId string id of the variable (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationVariableResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationVariableResponse variablesObservationVariableDbIdGet(String observationVariableDbId, String authorization) throws ApiException { + ApiResponse resp = variablesObservationVariableDbIdGetWithHttpInfo(observationVariableDbId, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Observation Variable + * Retrieve variable details + * @param observationVariableDbId string id of the variable (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationVariableResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse variablesObservationVariableDbIdGetWithHttpInfo(String observationVariableDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = variablesObservationVariableDbIdGetValidateBeforeCall(observationVariableDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Observation Variable (asynchronously) + * Retrieve variable details + * @param observationVariableDbId string id of the variable (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call variablesObservationVariableDbIdGetAsync(String observationVariableDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = variablesObservationVariableDbIdGetValidateBeforeCall(observationVariableDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for variablesSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call variablesSearchPostCall(ObservationVariableSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/variables-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call variablesSearchPostValidateBeforeCall(ObservationVariableSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = variablesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Variable search + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @return ObservationVariablesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationVariablesResponse1 variablesSearchPost(ObservationVariableSearchRequestDep body) throws ApiException { + ApiResponse resp = variablesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Variable search + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @return ApiResponse<ObservationVariablesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse variablesSearchPostWithHttpInfo(ObservationVariableSearchRequestDep body) throws ApiException { + com.squareup.okhttp.Call call = variablesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Variable search (asynchronously) + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call variablesSearchPostAsync(ObservationVariableSearchRequestDep body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = variablesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/ObservationsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/ObservationsApi.java new file mode 100755 index 00000000..44f3158e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/ObservationsApi.java @@ -0,0 +1,2328 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.NewObservationDbIdsResponse; +import io.swagger.client.model.NewObservationUnitDbIdsResponse; +import io.swagger.client.model.NewObservationUnitRequest; +import io.swagger.client.model.NewObservationsRequest; +import io.swagger.client.model.NewObservationsRequestWrapperDeprecated; +import io.swagger.client.model.NewObservationsTableRequest; +import io.swagger.client.model.ObservationLevelsResponse; +import io.swagger.client.model.ObservationLevelsResponse1; +import io.swagger.client.model.ObservationUnitsResponse; +import io.swagger.client.model.ObservationUnitsResponse2; +import io.swagger.client.model.ObservationUnitsTableResponse2; +import io.swagger.client.model.ObservationsResponse; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.PhenotypesRequest; +import io.swagger.client.model.PhenotypesSearchRequest; +import io.swagger.client.model.SuccessfulSearchResponse; +import io.swagger.client.model.WSMIMEDataTypes; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ObservationsApi { + private ApiClient apiClient; + + public ObservationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ObservationsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for observationLevelsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call observationLevelsGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/observationLevels"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call observationLevelsGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = observationLevelsGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated List observation levels + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationLevelsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationLevelsResponse observationLevelsGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = observationLevelsGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * Deprecated List observation levels + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationLevelsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse observationLevelsGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = observationLevelsGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated List observation levels (asynchronously) + * ** DEPRECTED ** Use /observationlevels Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call observationLevelsGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = observationLevelsGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for observationlevelsGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call observationlevelsGetCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/observationlevels"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call observationlevelsGetValidateBeforeCall(Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = observationlevelsGetCall(page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Levels + * Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationLevelsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationLevelsResponse1 observationlevelsGet(Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = observationlevelsGetWithHttpInfo(page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Levels + * Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationLevelsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse observationlevelsGetWithHttpInfo(Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = observationlevelsGetValidateBeforeCall(page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Levels (asynchronously) + * Call to retrieve the list of supported observation levels. Observation levels indicate the granularity level at which the measurements are taken. The values are used to supply the `observationLevel` parameter in the observation unit details call. + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call observationlevelsGetAsync(Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = observationlevelsGetValidateBeforeCall(page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for observationunitsGet + * @param germplasmDbId The unique ID of a germplasm (accession) to filter on (optional) + * @param observationVariableDbId The unique ID of an observation variable (optional) + * @param studyDbId The unique ID of a studies to filter on (optional) + * @param locationDbId The unique ID of a location where these observations were collected (optional) + * @param trialDbId The unique ID of a trial to filter on (optional) + * @param programDbId The unique ID of a program to filter on (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call observationunitsGetCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/observationunits"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (observationVariableDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationVariableDbId", observationVariableDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (observationLevel != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationLevel", observationLevel)); + if (observationTimeStampRangeStart != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeStart", observationTimeStampRangeStart)); + if (observationTimeStampRangeEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeEnd", observationTimeStampRangeEnd)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call observationunitsGetValidateBeforeCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = observationunitsGetCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Units + * Get a set of observation units + * @param germplasmDbId The unique ID of a germplasm (accession) to filter on (optional) + * @param observationVariableDbId The unique ID of an observation variable (optional) + * @param studyDbId The unique ID of a studies to filter on (optional) + * @param locationDbId The unique ID of a location where these observations were collected (optional) + * @param trialDbId The unique ID of a trial to filter on (optional) + * @param programDbId The unique ID of a program to filter on (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse observationunitsGet(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = observationunitsGetWithHttpInfo(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Units + * Get a set of observation units + * @param germplasmDbId The unique ID of a germplasm (accession) to filter on (optional) + * @param observationVariableDbId The unique ID of an observation variable (optional) + * @param studyDbId The unique ID of a studies to filter on (optional) + * @param locationDbId The unique ID of a location where these observations were collected (optional) + * @param trialDbId The unique ID of a trial to filter on (optional) + * @param programDbId The unique ID of a program to filter on (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse observationunitsGetWithHttpInfo(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = observationunitsGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Units (asynchronously) + * Get a set of observation units + * @param germplasmDbId The unique ID of a germplasm (accession) to filter on (optional) + * @param observationVariableDbId The unique ID of an observation variable (optional) + * @param studyDbId The unique ID of a studies to filter on (optional) + * @param locationDbId The unique ID of a location where these observations were collected (optional) + * @param trialDbId The unique ID of a trial to filter on (optional) + * @param programDbId The unique ID of a program to filter on (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call observationunitsGetAsync(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = observationunitsGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesPostCall(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesPostValidateBeforeCall(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesPostCall(body, authorization, format, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add new Observation Unit Phenotypes + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse phenotypesPost(PhenotypesRequest body, String authorization, WSMIMEDataTypes format) throws ApiException { + ApiResponse resp = phenotypesPostWithHttpInfo(body, authorization, format); + return resp.getData(); + } + + /** + * Add new Observation Unit Phenotypes + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesPostWithHttpInfo(PhenotypesRequest body, String authorization, WSMIMEDataTypes format) throws ApiException { + com.squareup.okhttp.Call call = phenotypesPostValidateBeforeCall(body, authorization, format, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add new Observation Unit Phenotypes (asynchronously) + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesPostAsync(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesPostValidateBeforeCall(body, authorization, format, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationtablesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesPostCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/observationtables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationtablesPostValidateBeforeCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchObservationtablesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for a table of Observations + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchObservationtablesPost(PhenotypesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchObservationtablesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for a table of Observations + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationtablesPostWithHttpInfo(PhenotypesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationtablesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for a table of Observations (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesPostAsync(PhenotypesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationtablesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationtablesSearchResultsDbIdGet + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetCall(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/observationtables/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (accept != null) + localVarHeaderParams.put("Accept", apiClient.parameterToString(accept)); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv", "text/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'accept' is set + if (accept == null) { + throw new ApiException("Missing the required parameter 'accept' when calling searchObservationtablesSearchResultsDbIdGet(Async)"); + } + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchObservationtablesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetCall(accept, searchResultsDbId, authorization, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Observation table search request + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationUnitsTableResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsTableResponse2 searchObservationtablesSearchResultsDbIdGet(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = searchObservationtablesSearchResultsDbIdGetWithHttpInfo(accept, searchResultsDbId, authorization, page, pageSize); + return resp.getData(); + } + + /** + * Get the results of a Observation table search request + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationUnitsTableResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationtablesSearchResultsDbIdGetWithHttpInfo(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(accept, searchResultsDbId, authorization, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Observation table search request (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetAsync(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(accept, searchResultsDbId, authorization, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationunitsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsPostCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/observationunits"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationunitsPostValidateBeforeCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchObservationunitsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Observation Units + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchObservationunitsPost(PhenotypesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchObservationunitsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Observation Units + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationunitsPostWithHttpInfo(PhenotypesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationunitsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Observation Units (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsPostAsync(PhenotypesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationunitsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationunitsSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/observationunits/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchObservationunitsSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Observation Unit Search + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitsResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse2 searchObservationunitsSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchObservationunitsSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Observation Unit Search + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitsResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationunitsSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Observation Unit Search (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationsGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsGetCall(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observations" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (observationVariableDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "observationVariableDbIds", observationVariableDbIds)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationsGetValidateBeforeCall(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationsGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observations associated with a specific Study + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationsResponse studiesStudyDbIdObservationsGet(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationsGetWithHttpInfo(studyDbId, observationVariableDbIds, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observations associated with a specific Study + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationsGetWithHttpInfo(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetValidateBeforeCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observations associated with a specific Study (asynchronously) + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsGetAsync(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetValidateBeforeCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationsPut + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsPutCall(String studyDbId, NewObservationsRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observations" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationsPutValidateBeforeCall(String studyDbId, NewObservationsRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationsPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update the Observations of a specific Study + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse studiesStudyDbIdObservationsPut(String studyDbId, NewObservationsRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationsPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update the Observations of a specific Study + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationsPutWithHttpInfo(String studyDbId, NewObservationsRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update the Observations of a specific Study (asynchronously) + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsPutAsync(String studyDbId, NewObservationsRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsGet + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetCall(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (observationLevel != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationLevel", observationLevel)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetValidateBeforeCall(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetCall(studyDbId, observationLevel, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Units associated with a specific Study + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitsResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse2 studiesStudyDbIdObservationunitsGet(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsGetWithHttpInfo(studyDbId, observationLevel, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Units associated with a specific Study + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitsResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsGetWithHttpInfo(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetValidateBeforeCall(studyDbId, observationLevel, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Units associated with a specific Study (asynchronously) + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetAsync(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetValidateBeforeCall(studyDbId, observationLevel, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsPost + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostValidateBeforeCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException("Missing the required parameter 'format' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsPost(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsPostWithHttpInfo(format, studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsPostWithHttpInfo(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Save Observation Unit Phenotypes (asynchronously) + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostAsync(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsPut + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutCall(String studyDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutValidateBeforeCall(String studyDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update the Observation Units for a specific Study + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsPut(String studyDbId, List body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update the Observation Units for a specific Study + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsPutWithHttpInfo(String studyDbId, List body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update the Observation Units for a specific Study (asynchronously) + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutAsync(String studyDbId, List body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsZipPost + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostCall(String studyDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits/zip" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/zip" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(String studyDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsZipPost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsZipPost(String studyDbId, Object body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsZipPostWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsZipPostWithHttpInfo(String studyDbId, Object body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. (asynchronously) + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostAsync(String studyDbId, Object body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdTableGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTableGetCall(String studyDbId, String format, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/table" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/csv", "application/json", "application/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdTableGetValidateBeforeCall(String studyDbId, String format, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdTableGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetCall(studyDbId, format, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observations for a specific Study in a table format + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public String studiesStudyDbIdTableGet(String studyDbId, String format, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdTableGetWithHttpInfo(studyDbId, format, authorization); + return resp.getData(); + } + + /** + * Get the Observations for a specific Study in a table format + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdTableGetWithHttpInfo(String studyDbId, String format, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetValidateBeforeCall(studyDbId, format, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observations for a specific Study in a table format (asynchronously) + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTableGetAsync(String studyDbId, String format, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetValidateBeforeCall(studyDbId, format, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdTablePost + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTablePostCall(String studyDbId, NewObservationsTableRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/table" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdTablePostValidateBeforeCall(String studyDbId, NewObservationsTableRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdTablePost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit new Observations in a table format for a specific Study + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse studiesStudyDbIdTablePost(String studyDbId, NewObservationsTableRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdTablePostWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Submit new Observations in a table format for a specific Study + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdTablePostWithHttpInfo(String studyDbId, NewObservationsTableRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit new Observations in a table format for a specific Study (asynchronously) + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTablePostAsync(String studyDbId, NewObservationsTableRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/PeopleApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/PeopleApi.java new file mode 100755 index 00000000..e08f3dc7 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/PeopleApi.java @@ -0,0 +1,608 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.NewPersonRequest; +import io.swagger.client.model.PersonResponse; +import io.swagger.client.model.PersonsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PeopleApi { + private ApiClient apiClient; + + public PeopleApi() { + this(Configuration.getDefaultApiClient()); + } + + public PeopleApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for peopleGet + * @param firstName A persons first name (optional) + * @param lastName A persons last name (optional) + * @param personDbId The unique ID of a person (optional) + * @param userID A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call peopleGetCall(String firstName, String lastName, String personDbId, String userID, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/people"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (firstName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("firstName", firstName)); + if (lastName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("lastName", lastName)); + if (personDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("personDbId", personDbId)); + if (userID != null) + localVarQueryParams.addAll(apiClient.parameterToPair("userID", userID)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call peopleGetValidateBeforeCall(String firstName, String lastName, String personDbId, String userID, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = peopleGetCall(firstName, lastName, personDbId, userID, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the People + * Get filtered list of people + * @param firstName A persons first name (optional) + * @param lastName A persons last name (optional) + * @param personDbId The unique ID of a person (optional) + * @param userID A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return PersonsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public PersonsResponse peopleGet(String firstName, String lastName, String personDbId, String userID, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = peopleGetWithHttpInfo(firstName, lastName, personDbId, userID, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the People + * Get filtered list of people + * @param firstName A persons first name (optional) + * @param lastName A persons last name (optional) + * @param personDbId The unique ID of a person (optional) + * @param userID A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<PersonsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse peopleGetWithHttpInfo(String firstName, String lastName, String personDbId, String userID, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = peopleGetValidateBeforeCall(firstName, lastName, personDbId, userID, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the People (asynchronously) + * Get filtered list of people + * @param firstName A persons first name (optional) + * @param lastName A persons last name (optional) + * @param personDbId The unique ID of a person (optional) + * @param userID A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call peopleGetAsync(String firstName, String lastName, String personDbId, String userID, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = peopleGetValidateBeforeCall(firstName, lastName, personDbId, userID, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for peoplePersonDbIdGet + * @param personDbId The unique ID of a person (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call peoplePersonDbIdGetCall(String personDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/people/{personDbId}" + .replaceAll("\\{" + "personDbId" + "\\}", apiClient.escapeString(personDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call peoplePersonDbIdGetValidateBeforeCall(String personDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'personDbId' is set + if (personDbId == null) { + throw new ApiException("Missing the required parameter 'personDbId' when calling peoplePersonDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = peoplePersonDbIdGetCall(personDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Person + * Get a specific person + * @param personDbId The unique ID of a person (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return PersonResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public PersonResponse peoplePersonDbIdGet(String personDbId, String authorization) throws ApiException { + ApiResponse resp = peoplePersonDbIdGetWithHttpInfo(personDbId, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Person + * Get a specific person + * @param personDbId The unique ID of a person (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<PersonResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse peoplePersonDbIdGetWithHttpInfo(String personDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = peoplePersonDbIdGetValidateBeforeCall(personDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Person (asynchronously) + * Get a specific person + * @param personDbId The unique ID of a person (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call peoplePersonDbIdGetAsync(String personDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = peoplePersonDbIdGetValidateBeforeCall(personDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for peoplePersonDbIdPut + * @param personDbId The unique ID of a person (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call peoplePersonDbIdPutCall(String personDbId, NewPersonRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/people/{personDbId}" + .replaceAll("\\{" + "personDbId" + "\\}", apiClient.escapeString(personDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call peoplePersonDbIdPutValidateBeforeCall(String personDbId, NewPersonRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'personDbId' is set + if (personDbId == null) { + throw new ApiException("Missing the required parameter 'personDbId' when calling peoplePersonDbIdPut(Async)"); + } + + com.squareup.okhttp.Call call = peoplePersonDbIdPutCall(personDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update a Person + * Update an existing Person + * @param personDbId The unique ID of a person (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return PersonResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public PersonResponse peoplePersonDbIdPut(String personDbId, NewPersonRequest body, String authorization) throws ApiException { + ApiResponse resp = peoplePersonDbIdPutWithHttpInfo(personDbId, body, authorization); + return resp.getData(); + } + + /** + * Update a Person + * Update an existing Person + * @param personDbId The unique ID of a person (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<PersonResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse peoplePersonDbIdPutWithHttpInfo(String personDbId, NewPersonRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = peoplePersonDbIdPutValidateBeforeCall(personDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update a Person (asynchronously) + * Update an existing Person + * @param personDbId The unique ID of a person (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call peoplePersonDbIdPutAsync(String personDbId, NewPersonRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = peoplePersonDbIdPutValidateBeforeCall(personDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for peoplePost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call peoplePostCall(NewPersonRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/people"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call peoplePostValidateBeforeCall(NewPersonRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = peoplePostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Create a new Person + * Create a new person + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return PersonResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public PersonResponse peoplePost(NewPersonRequest body, String authorization) throws ApiException { + ApiResponse resp = peoplePostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Create a new Person + * Create a new person + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<PersonResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse peoplePostWithHttpInfo(NewPersonRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = peoplePostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create a new Person (asynchronously) + * Create a new person + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call peoplePostAsync(NewPersonRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = peoplePostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/PhenotypesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/PhenotypesApi.java new file mode 100755 index 00000000..384a90bb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/PhenotypesApi.java @@ -0,0 +1,854 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.NewObservationDbIdsResponse; +import io.swagger.client.model.ObservationUnitsResponse1; +import io.swagger.client.model.ObservationUnitsTableResponse1; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.PhenotypesRequest; +import io.swagger.client.model.PhenotypesSearchRequest; +import io.swagger.client.model.WSMIMEDataTypes; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PhenotypesApi { + private ApiClient apiClient; + + public PhenotypesApi() { + this(Configuration.getDefaultApiClient()); + } + + public PhenotypesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for phenotypesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesPostCall(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesPostValidateBeforeCall(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesPostCall(body, authorization, format, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add new Observation Unit Phenotypes + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse phenotypesPost(PhenotypesRequest body, String authorization, WSMIMEDataTypes format) throws ApiException { + ApiResponse resp = phenotypesPostWithHttpInfo(body, authorization, format); + return resp.getData(); + } + + /** + * Add new Observation Unit Phenotypes + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesPostWithHttpInfo(PhenotypesRequest body, String authorization, WSMIMEDataTypes format) throws ApiException { + com.squareup.okhttp.Call call = phenotypesPostValidateBeforeCall(body, authorization, format, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add new Observation Unit Phenotypes (asynchronously) + * Notes: Along with the study specific phenotype saving calls (in the observationUnit and table formats), this call allows phenotypes to be saved and images to optionally be transferred as well. Call to invoke for saving the measurements (observations) collected\\nfrom field for all the observation units. Observation timestamp should be ISO 8601 https://www.w3.org/TR/NOTE-datetime In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. In this case a format parameter should be passed as well. Images can be optionally be uploaded using this call by providing a zipfile of all images in the datafiles, along with the actual zipfile in multi-part form data.\" + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param format In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesPostAsync(PhenotypesRequest body, String authorization, WSMIMEDataTypes format, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesPostValidateBeforeCall(body, authorization, format, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchCsvPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchCsvPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/csv"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchCsvPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchCsvPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search CSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void phenotypesSearchCsvPost(PhenotypesSearchRequest body) throws ApiException { + phenotypesSearchCsvPostWithHttpInfo(body); + } + + /** + * Phenotype Search CSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchCsvPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchCsvPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Phenotype Search CSV (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchCsvPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchCsvPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for phenotypesSearchGet + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchGetCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/phenotypes-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (observationVariableDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationVariableDbId", observationVariableDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (observationLevel != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationLevel", observationLevel)); + if (observationTimeStampRangeStart != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeStart", observationTimeStampRangeStart)); + if (observationTimeStampRangeEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeEnd", observationTimeStampRangeEnd)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchGetValidateBeforeCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchGetCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationUnitsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse1 phenotypesSearchGet(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = phenotypesSearchGetWithHttpInfo(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize); + return resp.getData(); + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationUnitsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchGetWithHttpInfo(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search (asynchronously) + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchGetAsync(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @return ObservationUnitsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse1 phenotypesSearchPost(PhenotypesSearchRequest body) throws ApiException { + ApiResponse resp = phenotypesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @return ApiResponse<ObservationUnitsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search (asynchronously) + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchTablePost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTablePostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/table"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchTablePostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchTablePostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search Table + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ObservationUnitsTableResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsTableResponse1 phenotypesSearchTablePost(PhenotypesSearchRequest body) throws ApiException { + ApiResponse resp = phenotypesSearchTablePostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Phenotype Search Table + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<ObservationUnitsTableResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchTablePostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchTablePostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search Table (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTablePostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchTablePostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchTsvPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTsvPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/tsv"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchTsvPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchTsvPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search TSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void phenotypesSearchTsvPost(PhenotypesSearchRequest body) throws ApiException { + phenotypesSearchTsvPostWithHttpInfo(body); + } + + /** + * Phenotype Search TSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchTsvPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchTsvPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Phenotype Search TSV (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTsvPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchTsvPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/ProgramsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/ProgramsApi.java new file mode 100755 index 00000000..366eb682 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/ProgramsApi.java @@ -0,0 +1,601 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.ProgramsResponse; +import io.swagger.client.model.ProgramsResponse1; +import io.swagger.client.model.ProgramsSearchRequest; +import io.swagger.client.model.ProgramsSearchRequestDeprecated; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProgramsApi { + private ApiClient apiClient; + + public ProgramsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProgramsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for programsGet + * @param commonCropName Filter by the common crop name. Exact match. (optional) + * @param programName Filter by program name. Exact match. (optional) + * @param abbreviation Filter by program abbreviation. Exact match. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call programsGetCall(String commonCropName, String programName, String abbreviation, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/programs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (programName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programName", programName)); + if (abbreviation != null) + localVarQueryParams.addAll(apiClient.parameterToPair("abbreviation", abbreviation)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call programsGetValidateBeforeCall(String commonCropName, String programName, String abbreviation, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = programsGetCall(commonCropName, programName, abbreviation, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the breeding Programs + * Call to retrieve a list of programs. + * @param commonCropName Filter by the common crop name. Exact match. (optional) + * @param programName Filter by program name. Exact match. (optional) + * @param abbreviation Filter by program abbreviation. Exact match. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ProgramsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgramsResponse programsGet(String commonCropName, String programName, String abbreviation, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = programsGetWithHttpInfo(commonCropName, programName, abbreviation, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the breeding Programs + * Call to retrieve a list of programs. + * @param commonCropName Filter by the common crop name. Exact match. (optional) + * @param programName Filter by program name. Exact match. (optional) + * @param abbreviation Filter by program abbreviation. Exact match. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ProgramsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse programsGetWithHttpInfo(String commonCropName, String programName, String abbreviation, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = programsGetValidateBeforeCall(commonCropName, programName, abbreviation, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the breeding Programs (asynchronously) + * Call to retrieve a list of programs. + * @param commonCropName Filter by the common crop name. Exact match. (optional) + * @param programName Filter by program name. Exact match. (optional) + * @param abbreviation Filter by program abbreviation. Exact match. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call programsGetAsync(String commonCropName, String programName, String abbreviation, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = programsGetValidateBeforeCall(commonCropName, programName, abbreviation, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for programsSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call programsSearchPostCall(ProgramsSearchRequestDeprecated body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/programs-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call programsSearchPostValidateBeforeCall(ProgramsSearchRequestDeprecated body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = programsSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Programs + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @return ProgramsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgramsResponse1 programsSearchPost(ProgramsSearchRequestDeprecated body) throws ApiException { + ApiResponse resp = programsSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Search Programs + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @return ApiResponse<ProgramsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse programsSearchPostWithHttpInfo(ProgramsSearchRequestDeprecated body) throws ApiException { + com.squareup.okhttp.Call call = programsSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Programs (asynchronously) + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call programsSearchPostAsync(ProgramsSearchRequestDeprecated body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = programsSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchProgramsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchProgramsPostCall(ProgramsSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/programs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchProgramsPostValidateBeforeCall(ProgramsSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchProgramsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Programs + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchProgramsPost(ProgramsSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchProgramsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Programs + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchProgramsPostWithHttpInfo(ProgramsSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchProgramsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Programs (asynchronously) + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchProgramsPostAsync(ProgramsSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchProgramsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchProgramsSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/programs/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchProgramsSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Programs search request + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ProgramsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgramsResponse searchProgramsSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchProgramsSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Programs search request + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ProgramsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchProgramsSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Programs search request (asynchronously) + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/SamplesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/SamplesApi.java new file mode 100755 index 00000000..7f2d2445 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/SamplesApi.java @@ -0,0 +1,1019 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.NewSampleDbId; +import io.swagger.client.model.Sample; +import io.swagger.client.model.SampleResponse; +import io.swagger.client.model.SampleSearchRequest; +import io.swagger.client.model.SampleSearchRequestDep; +import io.swagger.client.model.SamplesResponse; +import io.swagger.client.model.SamplesResponse1; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SamplesApi { + private ApiClient apiClient; + + public SamplesApi() { + this(Configuration.getDefaultApiClient()); + } + + public SamplesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for samplesGet + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesGetCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/samples"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (sampleDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sampleDbId", sampleDbId)); + if (observationUnitDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationUnitDbId", observationUnitDbId)); + if (plateDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("plateDbId", plateDbId)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesGetValidateBeforeCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesGetCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SamplesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse samplesGet(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = samplesGetWithHttpInfo(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SamplesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesGetWithHttpInfo(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = samplesGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Samples (asynchronously) + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesGetAsync(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesPut + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesPutCall(Sample body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/samples"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesPutValidateBeforeCall(Sample body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesPutCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Add a new Sample + * Call to register the event of a sample being taken. Sample ID is assigned as a result of the operation and returned in response. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewSampleDbId + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewSampleDbId samplesPut(Sample body, String authorization) throws ApiException { + ApiResponse resp = samplesPutWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Add a new Sample + * Call to register the event of a sample being taken. Sample ID is assigned as a result of the operation and returned in response. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewSampleDbId> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesPutWithHttpInfo(Sample body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = samplesPutValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Add a new Sample (asynchronously) + * Call to register the event of a sample being taken. Sample ID is assigned as a result of the operation and returned in response. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesPutAsync(Sample body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesPutValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesSampleDbIdGet + * @param sampleDbId the internal DB id for a sample (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesSampleDbIdGetCall(String sampleDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/samples/{sampleDbId}" + .replaceAll("\\{" + "sampleDbId" + "\\}", apiClient.escapeString(sampleDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesSampleDbIdGetValidateBeforeCall(String sampleDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'sampleDbId' is set + if (sampleDbId == null) { + throw new ApiException("Missing the required parameter 'sampleDbId' when calling samplesSampleDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = samplesSampleDbIdGetCall(sampleDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Sample + * Used to retrieve the details of a single Sample from a Sample Tracking system. + * @param sampleDbId the internal DB id for a sample (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SampleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SampleResponse samplesSampleDbIdGet(String sampleDbId, String authorization) throws ApiException { + ApiResponse resp = samplesSampleDbIdGetWithHttpInfo(sampleDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Sample + * Used to retrieve the details of a single Sample from a Sample Tracking system. + * @param sampleDbId the internal DB id for a sample (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SampleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesSampleDbIdGetWithHttpInfo(String sampleDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = samplesSampleDbIdGetValidateBeforeCall(sampleDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Sample (asynchronously) + * Used to retrieve the details of a single Sample from a Sample Tracking system. + * @param sampleDbId the internal DB id for a sample (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesSampleDbIdGetAsync(String sampleDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesSampleDbIdGetValidateBeforeCall(sampleDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesSearchGet + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesSearchGetCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/samples-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (sampleDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sampleDbId", sampleDbId)); + if (observationUnitDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationUnitDbId", observationUnitDbId)); + if (plateDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("plateDbId", plateDbId)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesSearchGetValidateBeforeCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesSearchGetCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Sample Search + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return SamplesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse1 samplesSearchGet(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = samplesSearchGetWithHttpInfo(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize); + return resp.getData(); + } + + /** + * Get the Sample Search + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<SamplesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesSearchGetWithHttpInfo(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = samplesSearchGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Sample Search (asynchronously) + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesSearchGetAsync(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesSearchGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesSearchPostCall(SampleSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/samples-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesSearchPostValidateBeforeCall(SampleSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Post Sample Search + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @return SamplesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse1 samplesSearchPost(SampleSearchRequestDep body) throws ApiException { + ApiResponse resp = samplesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Post Sample Search + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @return ApiResponse<SamplesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesSearchPostWithHttpInfo(SampleSearchRequestDep body) throws ApiException { + com.squareup.okhttp.Call call = samplesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Post Sample Search (asynchronously) + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesSearchPostAsync(SampleSearchRequestDep body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchSamplesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchSamplesPostCall(SampleSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/samples"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchSamplesPostValidateBeforeCall(SampleSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchSamplesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchSamplesPost(SampleSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchSamplesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchSamplesPostWithHttpInfo(SampleSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchSamplesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Samples (asynchronously) + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchSamplesPostAsync(SampleSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchSamplesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchSamplesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/samples/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchSamplesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Samples search request + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SamplesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse searchSamplesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchSamplesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Samples search request + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SamplesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchSamplesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Samples search request (asynchronously) + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/SearchServicesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/SearchServicesApi.java new file mode 100755 index 00000000..0c428278 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/SearchServicesApi.java @@ -0,0 +1,4153 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.GermplasmResponse; +import io.swagger.client.model.GermplasmResponse1; +import io.swagger.client.model.GermplasmSearchRequest; +import io.swagger.client.model.ImagesResponse; +import io.swagger.client.model.ImagesSearchRequest; +import io.swagger.client.model.MarkersResponse; +import io.swagger.client.model.MarkersSearchRequest; +import io.swagger.client.model.ObservationUnitsResponse1; +import io.swagger.client.model.ObservationUnitsResponse2; +import io.swagger.client.model.ObservationUnitsTableResponse1; +import io.swagger.client.model.ObservationUnitsTableResponse2; +import io.swagger.client.model.ObservationVariableSearchRequest; +import io.swagger.client.model.ObservationVariablesResponse; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.PhenotypesSearchRequest; +import io.swagger.client.model.ProgramsResponse; +import io.swagger.client.model.ProgramsResponse1; +import io.swagger.client.model.ProgramsSearchRequest; +import io.swagger.client.model.ProgramsSearchRequestDeprecated; +import io.swagger.client.model.SampleSearchRequest; +import io.swagger.client.model.SampleSearchRequestDep; +import io.swagger.client.model.SamplesResponse; +import io.swagger.client.model.SamplesResponse1; +import io.swagger.client.model.StudiesResponse; +import io.swagger.client.model.StudiesResponse1; +import io.swagger.client.model.StudySearchRequest; +import io.swagger.client.model.StudySearchRequestDep; +import io.swagger.client.model.SuccessfulSearchResponse; +import io.swagger.client.model.WSMIMEDataTypes; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SearchServicesApi { + private ApiClient apiClient; + + public SearchServicesApi() { + this(Configuration.getDefaultApiClient()); + } + + public SearchServicesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for germplasmSearchGet + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmSearchGetCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/germplasm-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmPUI != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmPUI", germplasmPUI)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (germplasmName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmName", germplasmName)); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmSearchGetValidateBeforeCall(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = germplasmSearchGetCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Germplasm search through GET + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return GermplasmResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse1 germplasmSearchGet(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = germplasmSearchGetWithHttpInfo(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize); + return resp.getData(); + } + + /** + * Germplasm search through GET + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<GermplasmResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmSearchGetWithHttpInfo(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = germplasmSearchGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Germplasm search through GET (asynchronously) + * DEPRECATED in V1.3 - see GET /germplasm + * @param germplasmPUI Permanent unique identifier (DOI, URI, etc.) (optional) + * @param germplasmDbId Internal database identifier (optional) + * @param germplasmName Name of the germplasm (optional) + * @param commonCropName The common crop name related to this germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmSearchGetAsync(String germplasmPUI, String germplasmDbId, String germplasmName, String commonCropName, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmSearchGetValidateBeforeCall(germplasmPUI, germplasmDbId, germplasmName, commonCropName, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for germplasmSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call germplasmSearchPostCall(GermplasmSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/germplasm-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call germplasmSearchPostValidateBeforeCall(GermplasmSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = germplasmSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Germplasm search through POST + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @return GermplasmResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse1 germplasmSearchPost(GermplasmSearchRequest body) throws ApiException { + ApiResponse resp = germplasmSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Germplasm search through POST + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @return ApiResponse<GermplasmResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse germplasmSearchPostWithHttpInfo(GermplasmSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = germplasmSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Germplasm search through POST (asynchronously) + * DEPRECATED in V1.3 - see POST /search/germplasm + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call germplasmSearchPostAsync(GermplasmSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = germplasmSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchCsvPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchCsvPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/csv"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchCsvPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchCsvPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search CSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void phenotypesSearchCsvPost(PhenotypesSearchRequest body) throws ApiException { + phenotypesSearchCsvPostWithHttpInfo(body); + } + + /** + * Phenotype Search CSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchCsvPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchCsvPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Phenotype Search CSV (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchCsvPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchCsvPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for phenotypesSearchGet + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchGetCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/phenotypes-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (observationVariableDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationVariableDbId", observationVariableDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (observationLevel != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationLevel", observationLevel)); + if (observationTimeStampRangeStart != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeStart", observationTimeStampRangeStart)); + if (observationTimeStampRangeEnd != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationTimeStampRangeEnd", observationTimeStampRangeEnd)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchGetValidateBeforeCall(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchGetCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationUnitsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse1 phenotypesSearchGet(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = phenotypesSearchGetWithHttpInfo(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize); + return resp.getData(); + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationUnitsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchGetWithHttpInfo(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search (asynchronously) + * DEPRECATED in v1.3 - See GET /observationunits + * @param germplasmDbId The name or synonym of external genebank accession identifiers (optional) + * @param observationVariableDbId The ID of traits, could be ontology ID, database ID or PUI (optional) + * @param studyDbId The database ID / PK of the studies search parameter (optional) + * @param locationDbId locations these traits were collected (optional) + * @param trialDbId trial to search across (optional) + * @param programDbId program that have phenotyped this trait (optional) + * @param seasonDbId The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) (optional) + * @param observationLevel The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnitStructure. (optional) + * @param observationTimeStampRangeStart Timestamp range start (optional) + * @param observationTimeStampRangeEnd Timestamp range end (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchGetAsync(String germplasmDbId, String observationVariableDbId, String studyDbId, String locationDbId, String trialDbId, String programDbId, String seasonDbId, String observationLevel, OffsetDateTime observationTimeStampRangeStart, OffsetDateTime observationTimeStampRangeEnd, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchGetValidateBeforeCall(germplasmDbId, observationVariableDbId, studyDbId, locationDbId, trialDbId, programDbId, seasonDbId, observationLevel, observationTimeStampRangeStart, observationTimeStampRangeEnd, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @return ObservationUnitsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse1 phenotypesSearchPost(PhenotypesSearchRequest body) throws ApiException { + ApiResponse resp = phenotypesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Phenotype Search + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @return ApiResponse<ObservationUnitsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search (asynchronously) + * DEPRECATED in v1.3 - See /search/observationunits + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchTablePost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTablePostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/table"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchTablePostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchTablePostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search Table + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ObservationUnitsTableResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsTableResponse1 phenotypesSearchTablePost(PhenotypesSearchRequest body) throws ApiException { + ApiResponse resp = phenotypesSearchTablePostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Phenotype Search Table + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<ObservationUnitsTableResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchTablePostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchTablePostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Phenotype Search Table (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTablePostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchTablePostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for phenotypesSearchTsvPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTsvPostCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/phenotypes-search/tsv"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call phenotypesSearchTsvPostValidateBeforeCall(PhenotypesSearchRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = phenotypesSearchTsvPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Phenotype Search TSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void phenotypesSearchTsvPost(PhenotypesSearchRequest body) throws ApiException { + phenotypesSearchTsvPostWithHttpInfo(body); + } + + /** + * Phenotype Search TSV + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse phenotypesSearchTsvPostWithHttpInfo(PhenotypesSearchRequest body) throws ApiException { + com.squareup.okhttp.Call call = phenotypesSearchTsvPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * Phenotype Search TSV (asynchronously) + * DEPRECATED in v1.3 - See /search/observationtables + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call phenotypesSearchTsvPostAsync(PhenotypesSearchRequest body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = phenotypesSearchTsvPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for programsSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call programsSearchPostCall(ProgramsSearchRequestDeprecated body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/programs-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call programsSearchPostValidateBeforeCall(ProgramsSearchRequestDeprecated body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = programsSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Programs + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @return ProgramsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgramsResponse1 programsSearchPost(ProgramsSearchRequestDeprecated body) throws ApiException { + ApiResponse resp = programsSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Search Programs + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @return ApiResponse<ProgramsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse programsSearchPostWithHttpInfo(ProgramsSearchRequestDeprecated body) throws ApiException { + com.squareup.okhttp.Call call = programsSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Programs (asynchronously) + * DEPRECATED in v1.3 - see /search/programs + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call programsSearchPostAsync(ProgramsSearchRequestDeprecated body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = programsSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesSearchGet + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesSearchGetCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/samples-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (sampleDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sampleDbId", sampleDbId)); + if (observationUnitDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationUnitDbId", observationUnitDbId)); + if (plateDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("plateDbId", plateDbId)); + if (germplasmDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("germplasmDbId", germplasmDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesSearchGetValidateBeforeCall(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesSearchGetCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Sample Search + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return SamplesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse1 samplesSearchGet(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = samplesSearchGetWithHttpInfo(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize); + return resp.getData(); + } + + /** + * Get the Sample Search + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<SamplesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesSearchGetWithHttpInfo(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = samplesSearchGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Sample Search (asynchronously) + * DEPRECATED in v1.3 - see GET /samples + * @param sampleDbId the internal DB id for a sample (optional) + * @param observationUnitDbId the internal DB id for an observation unit where a sample was taken from (optional) + * @param plateDbId the internal DB id for a plate of samples (optional) + * @param germplasmDbId the internal DB id for a germplasm (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesSearchGetAsync(String sampleDbId, String observationUnitDbId, String plateDbId, String germplasmDbId, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesSearchGetValidateBeforeCall(sampleDbId, observationUnitDbId, plateDbId, germplasmDbId, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for samplesSearchPost + * @param body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call samplesSearchPostCall(SampleSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/samples-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call samplesSearchPostValidateBeforeCall(SampleSearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = samplesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Post Sample Search + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @return SamplesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse1 samplesSearchPost(SampleSearchRequestDep body) throws ApiException { + ApiResponse resp = samplesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Post Sample Search + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @return ApiResponse<SamplesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse samplesSearchPostWithHttpInfo(SampleSearchRequestDep body) throws ApiException { + com.squareup.okhttp.Call call = samplesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Post Sample Search (asynchronously) + * DEPRECATED in v1.3 - see GET /search/samples + * @param body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call samplesSearchPostAsync(SampleSearchRequestDep body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = samplesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchGermplasmPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchGermplasmPostCall(GermplasmSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/germplasm"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchGermplasmPostValidateBeforeCall(GermplasmSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchGermplasmPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Germplasm + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchGermplasmPost(GermplasmSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchGermplasmPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Germplasm + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchGermplasmPostWithHttpInfo(GermplasmSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchGermplasmPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Germplasm (asynchronously) + * Search for a set of germplasm based on some criteria Addresses these needs - General germplasm search mechanism that accepts POST for complex queries - Possibility to search germplasm by more parameters than those allowed by the existing germplasm search - Possibility to get MCPD details by PUID rather than dbId See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchGermplasmPostAsync(GermplasmSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchGermplasmPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchGermplasmSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/germplasm/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchGermplasmSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Germplasm search request + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmResponse searchGermplasmSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchGermplasmSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Germplasm search request + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchGermplasmSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Germplasm search request (asynchronously) + * See Search Services for additional implementation details. Addresses these needs: 1. General germplasm search mechanism that accepts POST for complex queries 2. possibility to search germplasm by more parameters than those allowed by the existing germplasm search 3. possibility to get MCPD details by PUID rather than dbId + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchGermplasmSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchGermplasmSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchImagesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchImagesPostCall(ImagesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/images"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchImagesPostValidateBeforeCall(ImagesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchImagesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Images + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchImagesPost(ImagesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchImagesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Images + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchImagesPostWithHttpInfo(ImagesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchImagesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Images (asynchronously) + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchImagesPostAsync(ImagesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchImagesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchImagesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/images/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchImagesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of an Images search request + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ImagesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ImagesResponse searchImagesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchImagesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of an Images search request + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ImagesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchImagesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of an Images search request (asynchronously) + * Get filtered set of image meta data Implementation Notes - 'imageURL' should be a complete URL decribing the location of the image. There is no BrAPI call for retireiving the image content, so it could be on a different path, or a different host. - 'descriptiveOntologyTerm' can be thought of as Tags for the image. These could be simple descriptive words, or ontology references, or full ontology URI's. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchImagesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchImagesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchMarkersPost + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchMarkersPostCall(MarkersSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/markers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchMarkersPostValidateBeforeCall(MarkersSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchMarkersPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Markers + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchMarkersPost(MarkersSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchMarkersPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Markers + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchMarkersPostWithHttpInfo(MarkersSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchMarkersPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Markers (asynchronously) + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. If there is none, an empty array is returned. If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param body The database IDs of the markers to search for (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchMarkersPostAsync(MarkersSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchMarkersPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchMarkersSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/markers/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchMarkersSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Markers search request + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return MarkersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public MarkersResponse searchMarkersSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchMarkersSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Markers search request + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<MarkersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchMarkersSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Markers search request (asynchronously) + * See Search Services for additional implementation details. Other service requests use the servers internal `markerDbId`. This service returns marker records that provide the markerDbId. For the requested name or synonym, returns an array (possibly empty) of marker records that match the search criteria. - If there is none, an empty array is returned. - If there is one or more than one match, returns an array of all marker records that match the search criteria. ' + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchMarkersSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchMarkersSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationtablesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesPostCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/observationtables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationtablesPostValidateBeforeCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchObservationtablesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for a table of Observations + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchObservationtablesPost(PhenotypesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchObservationtablesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for a table of Observations + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationtablesPostWithHttpInfo(PhenotypesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationtablesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for a table of Observations (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesPostAsync(PhenotypesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationtablesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationtablesSearchResultsDbIdGet + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetCall(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/observationtables/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (accept != null) + localVarHeaderParams.put("Accept", apiClient.parameterToString(accept)); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", "text/csv", "text/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'accept' is set + if (accept == null) { + throw new ApiException("Missing the required parameter 'accept' when calling searchObservationtablesSearchResultsDbIdGet(Async)"); + } + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchObservationtablesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetCall(accept, searchResultsDbId, authorization, page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Observation table search request + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ObservationUnitsTableResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsTableResponse2 searchObservationtablesSearchResultsDbIdGet(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = searchObservationtablesSearchResultsDbIdGetWithHttpInfo(accept, searchResultsDbId, authorization, page, pageSize); + return resp.getData(); + } + + /** + * Get the results of a Observation table search request + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<ObservationUnitsTableResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationtablesSearchResultsDbIdGetWithHttpInfo(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(accept, searchResultsDbId, authorization, page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Observation table search request (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. observationTimeStamp - Iso Standard 8601. observationValue data type inferred from the ontology + * @param accept The requested content type which should be returned by the server (required) + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationtablesSearchResultsDbIdGetAsync(WSMIMEDataTypes accept, String searchResultsDbId, String authorization, Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationtablesSearchResultsDbIdGetValidateBeforeCall(accept, searchResultsDbId, authorization, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationunitsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsPostCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/observationunits"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationunitsPostValidateBeforeCall(PhenotypesSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchObservationunitsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Observation Units + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchObservationunitsPost(PhenotypesSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchObservationunitsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Observation Units + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationunitsPostWithHttpInfo(PhenotypesSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationunitsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Observation Units (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. Use case - this section allows to get a dataset from multiple studies. It allows to integrate data from several databases. Refactor note - This call allows to get and integrate portions of multiple phenotyping data matrixes. A proposed evolution allowed to get a list of single observations, this functionality is still possible with this call by specifybing the observation variable, see below. Example Use cases - Study a panel of germplasm accross multiple studies '{\"germplasmDbIds\": [\"Syrah\", \"34Mtp362\"]}' - Get all data for a specific study (same as \"/studies/{studyDbId}/observationunits\") '{\"studyDbIds\" : [\"383\"]}' - Get simple atomic phenotyping values '{ \"germplasmDbIds\" : [ \"Syrah\", \"34Mtp362\" ], \"observationVariableDbIds\" : [ \"CO_345:0000043\"] }' - Study Locations for adaptation to climate change '{ \"locationDbIds\" : [\"383838\", \"MONTPELLIER\"], \"germplasmDbIds\" : [ \"14Mtp361\", \"24Mtp362\", \"34Mtp363\", \"44Mtp364\"] }' - Find phenotypes that are from after a certain timestamp '{ \"observationTimeStampRangeStart\" : \"2013-06-14T23:59:59-04:00\", \"observationTimeStampRangeEnd\" : \"2013-06-15T23:59:59-04:00\" }' observationTimeStampRangeStart and observationTimeStampRangeEnd use Iso Standard 8601. observationValue data type inferred from the ontology + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsPostAsync(PhenotypesSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationunitsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchObservationunitsSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/observationunits/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchObservationunitsSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Observation Unit Search + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitsResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse2 searchObservationunitsSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchObservationunitsSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Observation Unit Search + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitsResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchObservationunitsSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Observation Unit Search (asynchronously) + * Returns a list of observationUnit with the observed Phenotypes. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchObservationunitsSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchObservationunitsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchProgramsPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchProgramsPostCall(ProgramsSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/programs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchProgramsPostValidateBeforeCall(ProgramsSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchProgramsPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Programs + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchProgramsPost(ProgramsSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchProgramsPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Programs + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchProgramsPostWithHttpInfo(ProgramsSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchProgramsPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Programs (asynchronously) + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchProgramsPostAsync(ProgramsSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchProgramsPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchProgramsSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/programs/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchProgramsSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Programs search request + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ProgramsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ProgramsResponse searchProgramsSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchProgramsSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Programs search request + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ProgramsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchProgramsSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Programs search request (asynchronously) + * Advanced searching for the programs resource. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchProgramsSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchProgramsSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchSamplesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchSamplesPostCall(SampleSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/samples"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchSamplesPostValidateBeforeCall(SampleSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchSamplesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchSamplesPost(SampleSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchSamplesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Samples + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchSamplesPostWithHttpInfo(SampleSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchSamplesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Samples (asynchronously) + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchSamplesPostAsync(SampleSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchSamplesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchSamplesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/samples/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchSamplesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Samples search request + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SamplesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SamplesResponse searchSamplesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchSamplesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Samples search request + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SamplesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchSamplesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Samples search request (asynchronously) + * Used to retrieve list of Samples from a Sample Tracking system based on some search criteria. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchSamplesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchSamplesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchStudiesPost + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchStudiesPostCall(StudySearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/studies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchStudiesPostValidateBeforeCall(StudySearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchStudiesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Studies + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchStudiesPost(StudySearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchStudiesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Studies + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchStudiesPostWithHttpInfo(StudySearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchStudiesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Studies (asynchronously) + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchStudiesPostAsync(StudySearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchStudiesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchStudiesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/studies/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchStudiesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Studies search request + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse searchStudiesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchStudiesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Studies search request + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchStudiesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Studies search request (asynchronously) + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchVariablesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchVariablesPostCall(ObservationVariableSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/variables"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchVariablesPostValidateBeforeCall(ObservationVariableSearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchVariablesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Observation Variables + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchVariablesPost(ObservationVariableSearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchVariablesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Observation Variables + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchVariablesPostWithHttpInfo(ObservationVariableSearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchVariablesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Observation Variables (asynchronously) + * Search observation variables. See Search Services for additional implementation details. + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchVariablesPostAsync(ObservationVariableSearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchVariablesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchVariablesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/variables/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchVariablesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Observation Variable search request + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationVariablesResponse searchVariablesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchVariablesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Observation Variable search request + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchVariablesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Observation Variable search request (asynchronously) + * Search observation variables. See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchVariablesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchVariablesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesSearchGet + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesSearchGetCall(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (studyType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyType", studyType)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (germplasmDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "germplasmDbIds", germplasmDbIds)); + if (observationVariableDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "observationVariableDbIds", observationVariableDbIds)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + if (active != null) + localVarQueryParams.addAll(apiClient.parameterToPair("active", active)); + if (sortBy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + if (sortOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesSearchGetValidateBeforeCall(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studiesSearchGetCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @return StudiesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse1 studiesSearchGet(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder) throws ApiException { + ApiResponse resp = studiesSearchGetWithHttpInfo(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder); + return resp.getData(); + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @return ApiResponse<StudiesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesSearchGetWithHttpInfo(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder) throws ApiException { + com.squareup.okhttp.Call call = studiesSearchGetValidateBeforeCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Studies (GET) (asynchronously) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesSearchGetAsync(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesSearchGetValidateBeforeCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesSearchPost + * @param body Study Search request (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesSearchPostCall(StudySearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesSearchPostValidateBeforeCall(StudySearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studiesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @return StudiesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse1 studiesSearchPost(StudySearchRequestDep body) throws ApiException { + ApiResponse resp = studiesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @return ApiResponse<StudiesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesSearchPostWithHttpInfo(StudySearchRequestDep body) throws ApiException { + com.squareup.okhttp.Call call = studiesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Studies (GET) (asynchronously) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesSearchPostAsync(StudySearchRequestDep body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/StudiesApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/StudiesApi.java new file mode 100755 index 00000000..9dd1907a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/StudiesApi.java @@ -0,0 +1,3511 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.GermplasmSummaryListResponse; +import io.swagger.client.model.NewObservationDbIdsResponse; +import io.swagger.client.model.NewObservationUnitDbIdsResponse; +import io.swagger.client.model.NewObservationUnitRequest; +import io.swagger.client.model.NewObservationsRequest; +import io.swagger.client.model.NewObservationsRequestWrapperDeprecated; +import io.swagger.client.model.NewObservationsTableRequest; +import io.swagger.client.model.ObservationUnitPositionsResponse; +import io.swagger.client.model.ObservationUnitPositionsResponse1; +import io.swagger.client.model.ObservationUnitsResponse2; +import io.swagger.client.model.ObservationsResponse; +import io.swagger.client.model.SeasonsResponse; +import io.swagger.client.model.StudiesResponse; +import io.swagger.client.model.StudiesResponse1; +import io.swagger.client.model.StudyLayoutRequest; +import io.swagger.client.model.StudyObservationVariablesResponse; +import io.swagger.client.model.StudyObservationVariablesResponse1; +import io.swagger.client.model.StudyResponse; +import io.swagger.client.model.StudySearchRequest; +import io.swagger.client.model.StudySearchRequestDep; +import io.swagger.client.model.StudyTypesResponse; +import io.swagger.client.model.StudyTypesResponse1; +import io.swagger.client.model.SuccessfulSearchResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StudiesApi { + private ApiClient apiClient; + + public StudiesApi() { + this(Configuration.getDefaultApiClient()); + } + + public StudiesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for searchStudiesPost + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchStudiesPostCall(StudySearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/search/studies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchStudiesPostValidateBeforeCall(StudySearchRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = searchStudiesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a search request for Studies + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SuccessfulSearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SuccessfulSearchResponse searchStudiesPost(StudySearchRequest body, String authorization) throws ApiException { + ApiResponse resp = searchStudiesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a search request for Studies + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SuccessfulSearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchStudiesPostWithHttpInfo(StudySearchRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchStudiesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a search request for Studies (asynchronously) + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param body Study Search request (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchStudiesPostAsync(StudySearchRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchStudiesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for searchStudiesSearchResultsDbIdGet + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/search/studies/{searchResultsDbId}" + .replaceAll("\\{" + "searchResultsDbId" + "\\}", apiClient.escapeString(searchResultsDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetValidateBeforeCall(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'searchResultsDbId' is set + if (searchResultsDbId == null) { + throw new ApiException("Missing the required parameter 'searchResultsDbId' when calling searchStudiesSearchResultsDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a Studies search request + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse searchStudiesSearchResultsDbIdGet(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = searchStudiesSearchResultsDbIdGetWithHttpInfo(searchResultsDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the results of a Studies search request + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse searchStudiesSearchResultsDbIdGetWithHttpInfo(String searchResultsDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a Studies search request (asynchronously) + * Get list of studies StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param searchResultsDbId Permanent unique identifier which references the search results (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call searchStudiesSearchResultsDbIdGetAsync(String searchResultsDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = searchStudiesSearchResultsDbIdGetValidateBeforeCall(searchResultsDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for seasonsGet + * @param seasonDbId The unique identifier for a season (optional) + * @param season The term to describe a given season. Example \"Spring\" OR \"May\" OR \"PlantingTime7\" (optional) + * @param year The 4 digit year of a season. Example \"2017\" (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call seasonsGetCall(String seasonDbId, String season, String year, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/seasons"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (season != null) + localVarQueryParams.addAll(apiClient.parameterToPair("season", season)); + if (year != null) + localVarQueryParams.addAll(apiClient.parameterToPair("year", year)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call seasonsGetValidateBeforeCall(String seasonDbId, String season, String year, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = seasonsGetCall(seasonDbId, season, year, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Seasons + * Call to retrive all seasons in the database. A season is made of 2 parts - The primary year - A term which defines a segment of the year. This could be a traditional season, like \"Spring\" or \"Summer\"; this could be a month, like \"May\" or \"June\"; or this could be an arbitrary season name which is meaningful to the breeding program like \"PlantingTime_3\" or \"Season E\" + * @param seasonDbId The unique identifier for a season (optional) + * @param season The term to describe a given season. Example \"Spring\" OR \"May\" OR \"PlantingTime7\" (optional) + * @param year The 4 digit year of a season. Example \"2017\" (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return SeasonsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SeasonsResponse seasonsGet(String seasonDbId, String season, String year, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = seasonsGetWithHttpInfo(seasonDbId, season, year, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Seasons + * Call to retrive all seasons in the database. A season is made of 2 parts - The primary year - A term which defines a segment of the year. This could be a traditional season, like \"Spring\" or \"Summer\"; this could be a month, like \"May\" or \"June\"; or this could be an arbitrary season name which is meaningful to the breeding program like \"PlantingTime_3\" or \"Season E\" + * @param seasonDbId The unique identifier for a season (optional) + * @param season The term to describe a given season. Example \"Spring\" OR \"May\" OR \"PlantingTime7\" (optional) + * @param year The 4 digit year of a season. Example \"2017\" (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<SeasonsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse seasonsGetWithHttpInfo(String seasonDbId, String season, String year, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = seasonsGetValidateBeforeCall(seasonDbId, season, year, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Seasons (asynchronously) + * Call to retrive all seasons in the database. A season is made of 2 parts - The primary year - A term which defines a segment of the year. This could be a traditional season, like \"Spring\" or \"Summer\"; this could be a month, like \"May\" or \"June\"; or this could be an arbitrary season name which is meaningful to the breeding program like \"PlantingTime_3\" or \"Season E\" + * @param seasonDbId The unique identifier for a season (optional) + * @param season The term to describe a given season. Example \"Spring\" OR \"May\" OR \"PlantingTime7\" (optional) + * @param year The 4 digit year of a season. Example \"2017\" (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call seasonsGetAsync(String seasonDbId, String season, String year, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = seasonsGetValidateBeforeCall(seasonDbId, season, year, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesGet + * @param commonCropName Common name for the crop associated with this study (optional) + * @param studyType DEPRECATED in v1.3 - see \"studyTypeDbId\" (optional) + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param observationVariableDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesGetCall(String commonCropName, String studyType, String studyTypeDbId, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (studyType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyType", studyType)); + if (studyTypeDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyTypeDbId", studyTypeDbId)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (germplasmDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "germplasmDbIds", germplasmDbIds)); + if (observationVariableDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "observationVariableDbIds", observationVariableDbIds)); + if (active != null) + localVarQueryParams.addAll(apiClient.parameterToPair("active", active)); + if (sortBy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + if (sortOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesGetValidateBeforeCall(String commonCropName, String studyType, String studyTypeDbId, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studiesGetCall(commonCropName, studyType, studyTypeDbId, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, active, sortBy, sortOrder, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Studies + * Get list of studies Implementation Notes StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param commonCropName Common name for the crop associated with this study (optional) + * @param studyType DEPRECATED in v1.3 - see \"studyTypeDbId\" (optional) + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param observationVariableDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse studiesGet(String commonCropName, String studyType, String studyTypeDbId, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesGetWithHttpInfo(commonCropName, studyType, studyTypeDbId, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, active, sortBy, sortOrder, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Studies + * Get list of studies Implementation Notes StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param commonCropName Common name for the crop associated with this study (optional) + * @param studyType DEPRECATED in v1.3 - see \"studyTypeDbId\" (optional) + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param observationVariableDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesGetWithHttpInfo(String commonCropName, String studyType, String studyTypeDbId, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesGetValidateBeforeCall(commonCropName, studyType, studyTypeDbId, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, active, sortBy, sortOrder, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Studies (asynchronously) + * Get list of studies Implementation Notes StartDate and endDate should be ISO8601 format for dates See Search Services for additional implementation details. + * @param commonCropName Common name for the crop associated with this study (optional) + * @param studyType DEPRECATED in v1.3 - see \"studyTypeDbId\" (optional) + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param observationVariableDbIds DEPRECATED in v1.3 - see /search/studies (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesGetAsync(String commonCropName, String studyType, String studyTypeDbId, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesGetValidateBeforeCall(commonCropName, studyType, studyTypeDbId, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, active, sortBy, sortOrder, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesSearchGet + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesSearchGetCall(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (studyType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyType", studyType)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (seasonDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("seasonDbId", seasonDbId)); + if (trialDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("trialDbId", trialDbId)); + if (studyDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyDbId", studyDbId)); + if (germplasmDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "germplasmDbIds", germplasmDbIds)); + if (observationVariableDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "observationVariableDbIds", observationVariableDbIds)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + if (active != null) + localVarQueryParams.addAll(apiClient.parameterToPair("active", active)); + if (sortBy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + if (sortOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesSearchGetValidateBeforeCall(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studiesSearchGetCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @return StudiesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse1 studiesSearchGet(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder) throws ApiException { + ApiResponse resp = studiesSearchGetWithHttpInfo(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder); + return resp.getData(); + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @return ApiResponse<StudiesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesSearchGetWithHttpInfo(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder) throws ApiException { + com.squareup.okhttp.Call call = studiesSearchGetValidateBeforeCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Studies (GET) (asynchronously) + * DEPRECATED in v1.3 - see GET /studies + * @param studyType Filter based on study type e.g. Nursery, Trial or Genotype. (optional) + * @param programDbId Program filter to only return studies associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param seasonDbId Filter by season or year (optional) + * @param trialDbId Filter by trial (optional) + * @param studyDbId Filter by study DbId (optional) + * @param germplasmDbIds Filter studies where specified germplasm have been used/tested (optional) + * @param observationVariableDbIds Filter studies where specified observation variables have been measured (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sort by. (optional) + * @param sortOrder Sort order direction. Ascending/Descending. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesSearchGetAsync(String studyType, String programDbId, String locationDbId, String seasonDbId, String trialDbId, String studyDbId, List germplasmDbIds, List observationVariableDbIds, Integer page, Integer pageSize, Boolean active, String sortBy, String sortOrder, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesSearchGetValidateBeforeCall(studyType, programDbId, locationDbId, seasonDbId, trialDbId, studyDbId, germplasmDbIds, observationVariableDbIds, page, pageSize, active, sortBy, sortOrder, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesSearchPost + * @param body Study Search request (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesSearchPostCall(StudySearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies-search"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesSearchPostValidateBeforeCall(StudySearchRequestDep body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studiesSearchPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @return StudiesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudiesResponse1 studiesSearchPost(StudySearchRequestDep body) throws ApiException { + ApiResponse resp = studiesSearchPostWithHttpInfo(body); + return resp.getData(); + } + + /** + * Search Studies (GET) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @return ApiResponse<StudiesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesSearchPostWithHttpInfo(StudySearchRequestDep body) throws ApiException { + com.squareup.okhttp.Call call = studiesSearchPostValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Search Studies (GET) (asynchronously) + * DEPRECATED in v1.3 - see /search/studies + * @param body Study Search request (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesSearchPostAsync(StudySearchRequestDep body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesSearchPostValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdGermplasmGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/germplasm" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdGermplasmGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Germplasm associated with a specific Study + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return GermplasmSummaryListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public GermplasmSummaryListResponse studiesStudyDbIdGermplasmGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdGermplasmGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Germplasm associated with a specific Study + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<GermplasmSummaryListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdGermplasmGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Germplasm associated with a specific Study (asynchronously) + * Get the available Germplasm which are associated with this study + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGermplasmGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGermplasmGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGetCall(String studyDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdGetValidateBeforeCall(String studyDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGetCall(studyDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details for a specific Study + * 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. Linked data - Observation Variables: ```/brapi/v1/studies/{studyDbId}/observationvariables``` - Germplasm: ```/brapi/v1/studies/{studyDbId}/germplasm``` - Observation Units: ```/brapi/v1/studies/{studyDbId}/observationunits``` - Layout: ```brapi/v1/studies/{studyDbId}/layout``` + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyResponse studiesStudyDbIdGet(String studyDbId, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdGetWithHttpInfo(studyDbId, authorization); + return resp.getData(); + } + + /** + * Get the details for a specific Study + * 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. Linked data - Observation Variables: ```/brapi/v1/studies/{studyDbId}/observationvariables``` - Germplasm: ```/brapi/v1/studies/{studyDbId}/germplasm``` - Observation Units: ```/brapi/v1/studies/{studyDbId}/observationunits``` - Layout: ```brapi/v1/studies/{studyDbId}/layout``` + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdGetWithHttpInfo(String studyDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdGetValidateBeforeCall(studyDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details for a specific Study (asynchronously) + * 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. Linked data - Observation Variables: ```/brapi/v1/studies/{studyDbId}/observationvariables``` - Germplasm: ```/brapi/v1/studies/{studyDbId}/germplasm``` - Observation Units: ```/brapi/v1/studies/{studyDbId}/observationunits``` - Layout: ```brapi/v1/studies/{studyDbId}/layout``` + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdGetAsync(String studyDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdGetValidateBeforeCall(studyDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdLayoutGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/layout" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdLayoutGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdLayoutGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the plot layout details for a specific Study + * DEPRECATED in v1.3 - see `GET /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitPositionsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitPositionsResponse studiesStudyDbIdLayoutGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdLayoutGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the plot layout details for a specific Study + * DEPRECATED in v1.3 - see `GET /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitPositionsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdLayoutGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the plot layout details for a specific Study (asynchronously) + * DEPRECATED in v1.3 - see `GET /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdLayoutPut + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutPutCall(String studyDbId, StudyLayoutRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/layout" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdLayoutPutValidateBeforeCall(String studyDbId, StudyLayoutRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdLayoutPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an existing Study with new layout details + * DEPRECATED in v1.3 - see `PUT /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitPositionsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitPositionsResponse studiesStudyDbIdLayoutPut(String studyDbId, StudyLayoutRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdLayoutPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an existing Study with new layout details + * DEPRECATED in v1.3 - see `PUT /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitPositionsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdLayoutPutWithHttpInfo(String studyDbId, StudyLayoutRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an existing Study with new layout details (asynchronously) + * DEPRECATED in v1.3 - see `PUT /studies/{studyDbId}/layouts` (pluralized) + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutPutAsync(String studyDbId, StudyLayoutRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdLayoutsGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutsGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/layouts" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdLayoutsGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdLayoutsGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the plot layout details for a specific Study + * Retrive the layout details for a study. Returns an array of observation unit position data which describes where each unit and germplasm is located within the study layout Retrieve the plot layout of the study with id {id}. For each observationUnit within a study, return the `block`, `replicate`, and `entryType` values as well as the `X` and `Y` coordinates. `entryType` can be \"check\", \"test\", or \"filler\". Also return some human readable meta data about the observationUnit and germplasm. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitPositionsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitPositionsResponse1 studiesStudyDbIdLayoutsGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdLayoutsGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the plot layout details for a specific Study + * Retrive the layout details for a study. Returns an array of observation unit position data which describes where each unit and germplasm is located within the study layout Retrieve the plot layout of the study with id {id}. For each observationUnit within a study, return the `block`, `replicate`, and `entryType` values as well as the `X` and `Y` coordinates. `entryType` can be \"check\", \"test\", or \"filler\". Also return some human readable meta data about the observationUnit and germplasm. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitPositionsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdLayoutsGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the plot layout details for a specific Study (asynchronously) + * Retrive the layout details for a study. Returns an array of observation unit position data which describes where each unit and germplasm is located within the study layout Retrieve the plot layout of the study with id {id}. For each observationUnit within a study, return the `block`, `replicate`, and `entryType` values as well as the `X` and `Y` coordinates. `entryType` can be \"check\", \"test\", or \"filler\". Also return some human readable meta data about the observationUnit and germplasm. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutsGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdLayoutsPut + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutsPutCall(String studyDbId, StudyLayoutRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/layouts" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdLayoutsPutValidateBeforeCall(String studyDbId, StudyLayoutRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdLayoutsPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update an existing Study with new layout details + * Modify a study layout Update the layout data for a set of observation units within a study. Each layout object is a subset of fields within an observationUnit, so it doesnt make sense to create a new layout object by itself. Implementation Notes: + If any of the fields in the request object is missing, that piece of data will not be updated. + If an observationUnitDbId can not be found within the given study, an error will be returned. + `entryType` can have the values \"check\", \"test\", or \"filler\". + The response should match the structure of the response from `GET studies/{studyDbId}/layout`, but it should only contain the layout objects which have been updated by the PUT request. Also, pagination is not available in the response. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitPositionsResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitPositionsResponse1 studiesStudyDbIdLayoutsPut(String studyDbId, StudyLayoutRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdLayoutsPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update an existing Study with new layout details + * Modify a study layout Update the layout data for a set of observation units within a study. Each layout object is a subset of fields within an observationUnit, so it doesnt make sense to create a new layout object by itself. Implementation Notes: + If any of the fields in the request object is missing, that piece of data will not be updated. + If an observationUnitDbId can not be found within the given study, an error will be returned. + `entryType` can have the values \"check\", \"test\", or \"filler\". + The response should match the structure of the response from `GET studies/{studyDbId}/layout`, but it should only contain the layout objects which have been updated by the PUT request. Also, pagination is not available in the response. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitPositionsResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdLayoutsPutWithHttpInfo(String studyDbId, StudyLayoutRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an existing Study with new layout details (asynchronously) + * Modify a study layout Update the layout data for a set of observation units within a study. Each layout object is a subset of fields within an observationUnit, so it doesnt make sense to create a new layout object by itself. Implementation Notes: + If any of the fields in the request object is missing, that piece of data will not be updated. + If an observationUnitDbId can not be found within the given study, an error will be returned. + `entryType` can have the values \"check\", \"test\", or \"filler\". + The response should match the structure of the response from `GET studies/{studyDbId}/layout`, but it should only contain the layout objects which have been updated by the PUT request. Also, pagination is not available in the response. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body The request body for updateing a study layout (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdLayoutsPutAsync(String studyDbId, StudyLayoutRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdLayoutsPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationVariablesGet + * @param studyDbId string database unique identifier (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationVariables" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetValidateBeforeCall(String studyDbId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationVariablesGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetCall(studyDbId, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return StudyObservationVariablesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyObservationVariablesResponse studiesStudyDbIdObservationVariablesGet(String studyDbId) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationVariablesGetWithHttpInfo(studyDbId); + return resp.getData(); + } + + /** + * Deprecated Retrieve study observation variables + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @return ApiResponse<StudyObservationVariablesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationVariablesGetWithHttpInfo(String studyDbId) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Retrieve study observation variables (asynchronously) + * test-server.brapi.org/brapi/v1/studies/{studyDbId}/observationVariables + * @param studyDbId string database unique identifier (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationVariablesGetAsync(String studyDbId, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationVariablesGetValidateBeforeCall(studyDbId, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationsGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsGetCall(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observations" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (observationVariableDbIds != null) + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "observationVariableDbIds", observationVariableDbIds)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationsGetValidateBeforeCall(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationsGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observations associated with a specific Study + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationsResponse studiesStudyDbIdObservationsGet(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationsGetWithHttpInfo(studyDbId, observationVariableDbIds, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observations associated with a specific Study + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationsGetWithHttpInfo(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetValidateBeforeCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observations associated with a specific Study (asynchronously) + * Retrieve all observations where there are measurements for the given observation variables. observationTimestamp should be ISO8601 format with timezone -> YYYY-MM-DDThh:mm:ss+hhmm + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param observationVariableDbIds Numeric `id` of that variable (combination of trait, unit and method) (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsGetAsync(String studyDbId, List observationVariableDbIds, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsGetValidateBeforeCall(studyDbId, observationVariableDbIds, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationsPut + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsPutCall(String studyDbId, NewObservationsRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observations" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationsPutValidateBeforeCall(String studyDbId, NewObservationsRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationsPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update the Observations of a specific Study + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse studiesStudyDbIdObservationsPut(String studyDbId, NewObservationsRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationsPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update the Observations of a specific Study + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationsPutWithHttpInfo(String studyDbId, NewObservationsRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update the Observations of a specific Study (asynchronously) + * Implementation Guidelines: + If an `observationDbId` is \"null\" or an empty string in the request, a NEW observation should be created for the given study and observationUnit + If an `observationDbId` is populated but not found in the database, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database, but the existing entry is not associated with the given study or observationUnit, a NEW observation should be created for the given study and observationUnit AND an NEW `observationDbId` should be assigned to it. A warning should be returned to the client. + If an `observationDbId` is populated and found in the database and is associated with the given study and observationUnit, then it should be updated with the new data given. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationsPutAsync(String studyDbId, NewObservationsRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationsPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsGet + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetCall(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (observationLevel != null) + localVarQueryParams.addAll(apiClient.parameterToPair("observationLevel", observationLevel)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetValidateBeforeCall(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetCall(studyDbId, observationLevel, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Units associated with a specific Study + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ObservationUnitsResponse2 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ObservationUnitsResponse2 studiesStudyDbIdObservationunitsGet(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsGetWithHttpInfo(studyDbId, observationLevel, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Units associated with a specific Study + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<ObservationUnitsResponse2> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsGetWithHttpInfo(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetValidateBeforeCall(studyDbId, observationLevel, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Units associated with a specific Study (asynchronously) + * The main API call for field data collection, to retrieve all the observation units within a study. + * @param studyDbId The study these observation units are related to. (required) + * @param observationLevel The granularity level of observation units. Either `plotNumber` or `plantNumber` fields will be relavant depending on whether granularity is plot or plant respectively. (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsGetAsync(String studyDbId, String observationLevel, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsGetValidateBeforeCall(studyDbId, observationLevel, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsPost + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostValidateBeforeCall(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'format' is set + if (format == null) { + throw new ApiException("Missing the required parameter 'format' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsPost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsPost(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsPostWithHttpInfo(format, studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Deprecated Save Observation Unit Phenotypes + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsPostWithHttpInfo(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated Save Observation Unit Phenotypes (asynchronously) + * This call has been deprecated in V1.1. Use instead: \"PUT /studies/{studyDbId}/observationunits\" and \"PUT /studies/{studyDbId}/observationunits/zip\" + * @param format (default is JSON, but can be zip) In case where JSON data is zipped for faster transfer speed (as in the case of the IRRI handheld implementation), the zipped JSON file will be listed in datafiles. The zipped file contains a JSON file with the same structure as the BrAPI call. (required) + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPostAsync(String format, String studyDbId, NewObservationsRequestWrapperDeprecated body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPostValidateBeforeCall(format, studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsPut + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutCall(String studyDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutValidateBeforeCall(String studyDbId, List body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsPut(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Update the Observation Units for a specific Study + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsPut(String studyDbId, List body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsPutWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Update the Observation Units for a specific Study + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsPutWithHttpInfo(String studyDbId, List body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update the Observation Units for a specific Study (asynchronously) + * Use this call for uploading new Observations as JSON to a system. Note: If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsPutAsync(String studyDbId, List body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsPutValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationunitsZipPost + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostCall(String studyDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationunits/zip" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/zip" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(String studyDbId, Object body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationunitsZipPost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationUnitDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationUnitDbIdsResponse studiesStudyDbIdObservationunitsZipPost(String studyDbId, Object body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationunitsZipPostWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationUnitDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationunitsZipPostWithHttpInfo(String studyDbId, Object body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Use this call for uploading new Observations as a Batched Zip File to a system. (asynchronously) + * If ''observationUnitDbId'' or ''observationDbId'' is populated, they should be considered updates to existing records. If an existing record of that DbId is not found, the document should be treated as new records and assigned new DbIds. If ''observationUnitDbId'' or ''observationDbId'' is un-populated (empty string or null) the document should be treated as new records and assigned new DbIds. + * @param studyDbId The study these observation units are related to. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationunitsZipPostAsync(String studyDbId, Object body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationunitsZipPostValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdObservationvariablesGet + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/observationvariables" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetValidateBeforeCall(String studyDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdObservationvariablesGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observation Variables for a specific Study + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudyObservationVariablesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyObservationVariablesResponse1 studiesStudyDbIdObservationvariablesGet(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdObservationvariablesGetWithHttpInfo(studyDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Observation Variables for a specific Study + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudyObservationVariablesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdObservationvariablesGetWithHttpInfo(String studyDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observation Variables for a specific Study (asynchronously) + * List all the observation variables measured in the study. Refer to the data type definition of variables in `/Specification/ObservationVariables/README.md`. + * @param studyDbId string database unique identifier (required) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdObservationvariablesGetAsync(String studyDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdObservationvariablesGetValidateBeforeCall(studyDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdTableGet + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTableGetCall(String studyDbId, String format, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/table" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (format != null) + localVarQueryParams.addAll(apiClient.parameterToPair("format", format)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/csv", "application/json", "application/tsv" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdTableGetValidateBeforeCall(String studyDbId, String format, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdTableGet(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetCall(studyDbId, format, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Observations for a specific Study in a table format + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public String studiesStudyDbIdTableGet(String studyDbId, String format, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdTableGetWithHttpInfo(studyDbId, format, authorization); + return resp.getData(); + } + + /** + * Get the Observations for a specific Study in a table format + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdTableGetWithHttpInfo(String studyDbId, String format, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetValidateBeforeCall(studyDbId, format, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Observations for a specific Study in a table format (asynchronously) + * Retrieve the details of the study required for field data collection. Includes actual trait data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param format The format parameter will cause the data to be dumped to a file in the specified format. Currently, tsv and csv are supported. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTableGetAsync(String studyDbId, String format, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTableGetValidateBeforeCall(studyDbId, format, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studiesStudyDbIdTablePost + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTablePostCall(String studyDbId, NewObservationsTableRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/studies/{studyDbId}/table" + .replaceAll("\\{" + "studyDbId" + "\\}", apiClient.escapeString(studyDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studiesStudyDbIdTablePostValidateBeforeCall(String studyDbId, NewObservationsTableRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'studyDbId' is set + if (studyDbId == null) { + throw new ApiException("Missing the required parameter 'studyDbId' when calling studiesStudyDbIdTablePost(Async)"); + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostCall(studyDbId, body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit new Observations in a table format for a specific Study + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return NewObservationDbIdsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public NewObservationDbIdsResponse studiesStudyDbIdTablePost(String studyDbId, NewObservationsTableRequest body, String authorization) throws ApiException { + ApiResponse resp = studiesStudyDbIdTablePostWithHttpInfo(studyDbId, body, authorization); + return resp.getData(); + } + + /** + * Submit new Observations in a table format for a specific Study + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<NewObservationDbIdsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studiesStudyDbIdTablePostWithHttpInfo(String studyDbId, NewObservationsTableRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostValidateBeforeCall(studyDbId, body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit new Observations in a table format for a specific Study (asynchronously) + * This call can be used to create new observations in bulk. Note: If you need to update any existing observation, please use `PUT /studies/{studyDbId}/observations`. This call should only be used to create NEW observations. Implementation Guidelines: + All observations submitted through this call should create NEW observation records in the database under the given observation unit. + Each \"observationUnitDbId\" listed should already exist in the database. If the server can not find a given \"observationUnitDbId\", it should report an error. (see Error Handling) + The response of this call should be the set of \"observationDbIds\" created from this call, along with the associated \"observationUnitDbId\" and \"observationVariableDbId\" that each observation is associated with. + Images can optionally be saved using this call by providing a zipped file of all images in the datafiles. The physical zipped file should be transferred as well in the mulit-part form data. + * @param studyDbId Identifier of the study. Usually a number, could be alphanumeric. (required) + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studiesStudyDbIdTablePostAsync(String studyDbId, NewObservationsTableRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studiesStudyDbIdTablePostValidateBeforeCall(studyDbId, body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studyTypesGet + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studyTypesGetCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studyTypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studyTypesGetValidateBeforeCall(Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studyTypesGetCall(page, pageSize, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Deprecated List study types + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return StudyTypesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyTypesResponse studyTypesGet(Integer page, Integer pageSize) throws ApiException { + ApiResponse resp = studyTypesGetWithHttpInfo(page, pageSize); + return resp.getData(); + } + + /** + * Deprecated List study types + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @return ApiResponse<StudyTypesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studyTypesGetWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + com.squareup.okhttp.Call call = studyTypesGetValidateBeforeCall(page, pageSize, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Deprecated List study types (asynchronously) + * ** DEPRECTED ** Use /studytypes Call to retrieve the list of study types. Scope: PHENOTYPING. Implementation target date: PAG2016 + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studyTypesGetAsync(Integer page, Integer pageSize, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studyTypesGetValidateBeforeCall(page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for studytypesGet + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call studytypesGetCall(String studyTypeDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/studytypes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (studyTypeDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("studyTypeDbId", studyTypeDbId)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call studytypesGetValidateBeforeCall(String studyTypeDbId, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = studytypesGetCall(studyTypeDbId, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Study Types + * Call to retrieve the list of study types. + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return StudyTypesResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public StudyTypesResponse1 studytypesGet(String studyTypeDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = studytypesGetWithHttpInfo(studyTypeDbId, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the Study Types + * Call to retrieve the list of study types. + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<StudyTypesResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse studytypesGetWithHttpInfo(String studyTypeDbId, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = studytypesGetValidateBeforeCall(studyTypeDbId, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Study Types (asynchronously) + * Call to retrieve the list of study types. + * @param studyTypeDbId Filter based on study type unique identifier (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call studytypesGetAsync(String studyTypeDbId, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = studytypesGetValidateBeforeCall(studyTypeDbId, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/TrialsApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/TrialsApi.java new file mode 100755 index 00000000..763d47fb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/TrialsApi.java @@ -0,0 +1,358 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.TrialResponse; +import io.swagger.client.model.TrialsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TrialsApi { + private ApiClient apiClient; + + public TrialsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TrialsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for trialsGet + * @param commonCropName Common name for the crop associated with this trial (optional) + * @param programDbId Program filter to only return trials associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sorty by. (optional) + * @param sortOrder Sort order direction: asc/desc (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call trialsGetCall(String commonCropName, String programDbId, String locationDbId, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trials"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (commonCropName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("commonCropName", commonCropName)); + if (programDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("programDbId", programDbId)); + if (locationDbId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("locationDbId", locationDbId)); + if (active != null) + localVarQueryParams.addAll(apiClient.parameterToPair("active", active)); + if (sortBy != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortBy", sortBy)); + if (sortOrder != null) + localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder)); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call trialsGetValidateBeforeCall(String commonCropName, String programDbId, String locationDbId, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = trialsGetCall(commonCropName, programDbId, locationDbId, active, sortBy, sortOrder, page, pageSize, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the breeding Trials + * Retrieve a filtered list of Trials. A Trial is a collection of studies + * @param commonCropName Common name for the crop associated with this trial (optional) + * @param programDbId Program filter to only return trials associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sorty by. (optional) + * @param sortOrder Sort order direction: asc/desc (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TrialsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TrialsResponse trialsGet(String commonCropName, String programDbId, String locationDbId, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization) throws ApiException { + ApiResponse resp = trialsGetWithHttpInfo(commonCropName, programDbId, locationDbId, active, sortBy, sortOrder, page, pageSize, authorization); + return resp.getData(); + } + + /** + * Get the breeding Trials + * Retrieve a filtered list of Trials. A Trial is a collection of studies + * @param commonCropName Common name for the crop associated with this trial (optional) + * @param programDbId Program filter to only return trials associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sorty by. (optional) + * @param sortOrder Sort order direction: asc/desc (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TrialsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse trialsGetWithHttpInfo(String commonCropName, String programDbId, String locationDbId, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization) throws ApiException { + com.squareup.okhttp.Call call = trialsGetValidateBeforeCall(commonCropName, programDbId, locationDbId, active, sortBy, sortOrder, page, pageSize, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the breeding Trials (asynchronously) + * Retrieve a filtered list of Trials. A Trial is a collection of studies + * @param commonCropName Common name for the crop associated with this trial (optional) + * @param programDbId Program filter to only return trials associated with given program id. (optional) + * @param locationDbId Filter by location (optional) + * @param active Filter active status true/false. (optional) + * @param sortBy Sort order. Name of the field to sorty by. (optional) + * @param sortOrder Sort order direction: asc/desc (optional) + * @param page Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is `0`. (optional) + * @param pageSize The size of the pages to be returned. Default is `1000`. (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call trialsGetAsync(String commonCropName, String programDbId, String locationDbId, Boolean active, String sortBy, String sortOrder, Integer page, Integer pageSize, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = trialsGetValidateBeforeCall(commonCropName, programDbId, locationDbId, active, sortBy, sortOrder, page, pageSize, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for trialsTrialDbIdGet + * @param trialDbId The internal trialDbId (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call trialsTrialDbIdGetCall(String trialDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trials/{trialDbId}" + .replaceAll("\\{" + "trialDbId" + "\\}", apiClient.escapeString(trialDbId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call trialsTrialDbIdGetValidateBeforeCall(String trialDbId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'trialDbId' is set + if (trialDbId == null) { + throw new ApiException("Missing the required parameter 'trialDbId' when calling trialsTrialDbIdGet(Async)"); + } + + com.squareup.okhttp.Call call = trialsTrialDbIdGetCall(trialDbId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the details of a specific Trial + * Get trial by id. + * @param trialDbId The internal trialDbId (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return TrialResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public TrialResponse trialsTrialDbIdGet(String trialDbId, String authorization) throws ApiException { + ApiResponse resp = trialsTrialDbIdGetWithHttpInfo(trialDbId, authorization); + return resp.getData(); + } + + /** + * Get the details of a specific Trial + * Get trial by id. + * @param trialDbId The internal trialDbId (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<TrialResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse trialsTrialDbIdGetWithHttpInfo(String trialDbId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = trialsTrialDbIdGetValidateBeforeCall(trialDbId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the details of a specific Trial (asynchronously) + * Get trial by id. + * @param trialDbId The internal trialDbId (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call trialsTrialDbIdGetAsync(String trialDbId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = trialsTrialDbIdGetValidateBeforeCall(trialDbId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/api/VendorApi.java b/brapi-client/src/main/resources/swagger-generated-client/api/VendorApi.java new file mode 100755 index 00000000..bcc4d59f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/api/VendorApi.java @@ -0,0 +1,1091 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.VendorOrderRequest; +import io.swagger.client.model.VendorOrderResponse; +import io.swagger.client.model.VendorOrderResultsResponse; +import io.swagger.client.model.VendorOrderStatusResponse; +import io.swagger.client.model.VendorOrdersResponse; +import io.swagger.client.model.VendorPlateGetResponse1; +import io.swagger.client.model.VendorPlateResponse; +import io.swagger.client.model.VendorPlatesResponse; +import io.swagger.client.model.VendorPlatesSubmissionRequest; +import io.swagger.client.model.VendorSpecificationResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class VendorApi { + private ApiClient apiClient; + + public VendorApi() { + this(Configuration.getDefaultApiClient()); + } + + public VendorApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for vendorOrdersGet + * @param orderId The order id returned by the vendor when the order was successfully submitted. From response of \"POST /vendor/orders\" (optional) + * @param submissionId The submission id returned by the vendor when a set of plates was successfully submitted. From response of \"POST /vendor/plates\" (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorOrdersGetCall(String orderId, String submissionId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (orderId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("orderId", orderId)); + if (submissionId != null) + localVarQueryParams.addAll(apiClient.parameterToPair("submissionId", submissionId)); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorOrdersGetValidateBeforeCall(String orderId, String submissionId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = vendorOrdersGetCall(orderId, submissionId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * List current available orders + * List current available orders + * @param orderId The order id returned by the vendor when the order was successfully submitted. From response of \"POST /vendor/orders\" (optional) + * @param submissionId The submission id returned by the vendor when a set of plates was successfully submitted. From response of \"POST /vendor/plates\" (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorOrdersResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorOrdersResponse vendorOrdersGet(String orderId, String submissionId, String authorization) throws ApiException { + ApiResponse resp = vendorOrdersGetWithHttpInfo(orderId, submissionId, authorization); + return resp.getData(); + } + + /** + * List current available orders + * List current available orders + * @param orderId The order id returned by the vendor when the order was successfully submitted. From response of \"POST /vendor/orders\" (optional) + * @param submissionId The submission id returned by the vendor when a set of plates was successfully submitted. From response of \"POST /vendor/plates\" (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorOrdersGetWithHttpInfo(String orderId, String submissionId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorOrdersGetValidateBeforeCall(orderId, submissionId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * List current available orders (asynchronously) + * List current available orders + * @param orderId The order id returned by the vendor when the order was successfully submitted. From response of \"POST /vendor/orders\" (optional) + * @param submissionId The submission id returned by the vendor when a set of plates was successfully submitted. From response of \"POST /vendor/plates\" (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorOrdersGetAsync(String orderId, String submissionId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorOrdersGetValidateBeforeCall(orderId, submissionId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorOrdersOrderIdPlatesGet + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdPlatesGetCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/orders/{orderId}/plates" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorOrdersOrderIdPlatesGetValidateBeforeCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling vendorOrdersOrderIdPlatesGet(Async)"); + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdPlatesGetCall(orderId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Plates for a specific Order + * Retrieve the plate and sample details of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorPlatesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorPlatesResponse vendorOrdersOrderIdPlatesGet(String orderId, String authorization) throws ApiException { + ApiResponse resp = vendorOrdersOrderIdPlatesGetWithHttpInfo(orderId, authorization); + return resp.getData(); + } + + /** + * Get the Plates for a specific Order + * Retrieve the plate and sample details of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorPlatesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorOrdersOrderIdPlatesGetWithHttpInfo(String orderId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorOrdersOrderIdPlatesGetValidateBeforeCall(orderId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Plates for a specific Order (asynchronously) + * Retrieve the plate and sample details of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdPlatesGetAsync(String orderId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdPlatesGetValidateBeforeCall(orderId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorOrdersOrderIdResultsGet + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdResultsGetCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/orders/{orderId}/results" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorOrdersOrderIdResultsGetValidateBeforeCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling vendorOrdersOrderIdResultsGet(Async)"); + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdResultsGetCall(orderId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the results of a specific Order + * Retrieve the data files generated by the vendors analysis + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorOrderResultsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorOrderResultsResponse vendorOrdersOrderIdResultsGet(String orderId, String authorization) throws ApiException { + ApiResponse resp = vendorOrdersOrderIdResultsGetWithHttpInfo(orderId, authorization); + return resp.getData(); + } + + /** + * Get the results of a specific Order + * Retrieve the data files generated by the vendors analysis + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorOrderResultsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorOrdersOrderIdResultsGetWithHttpInfo(String orderId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorOrdersOrderIdResultsGetValidateBeforeCall(orderId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the results of a specific Order (asynchronously) + * Retrieve the data files generated by the vendors analysis + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdResultsGetAsync(String orderId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdResultsGetValidateBeforeCall(orderId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorOrdersOrderIdStatusGet + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdStatusGetCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/orders/{orderId}/status" + .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorOrdersOrderIdStatusGetValidateBeforeCall(String orderId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling vendorOrdersOrderIdStatusGet(Async)"); + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdStatusGetCall(orderId, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the status of a specific Order + * Retrieve the current status of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorOrderStatusResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorOrderStatusResponse vendorOrdersOrderIdStatusGet(String orderId, String authorization) throws ApiException { + ApiResponse resp = vendorOrdersOrderIdStatusGetWithHttpInfo(orderId, authorization); + return resp.getData(); + } + + /** + * Get the status of a specific Order + * Retrieve the current status of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorOrderStatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorOrdersOrderIdStatusGetWithHttpInfo(String orderId, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorOrdersOrderIdStatusGetValidateBeforeCall(orderId, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the status of a specific Order (asynchronously) + * Retrieve the current status of an order being processed + * @param orderId The order id returned by the vendor when the order was successfully submitted. (required) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorOrdersOrderIdStatusGetAsync(String orderId, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorOrdersOrderIdStatusGetValidateBeforeCall(orderId, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorOrdersPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorOrdersPostCall(VendorOrderRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/vendor/orders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorOrdersPostValidateBeforeCall(VendorOrderRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = vendorOrdersPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit New Order + * Submit a new order to a vendor + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorOrderResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorOrderResponse vendorOrdersPost(VendorOrderRequest body, String authorization) throws ApiException { + ApiResponse resp = vendorOrdersPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit New Order + * Submit a new order to a vendor + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorOrdersPostWithHttpInfo(VendorOrderRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorOrdersPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit New Order (asynchronously) + * Submit a new order to a vendor + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorOrdersPostAsync(VendorOrderRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorOrdersPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorPlatesPost + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorPlatesPostCall(VendorPlatesSubmissionRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/vendor/plates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorPlatesPostValidateBeforeCall(VendorPlatesSubmissionRequest body, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = vendorPlatesPostCall(body, authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Submit a new set of Sample data + * Submit a new set of Sample data + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorPlateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorPlateResponse vendorPlatesPost(VendorPlatesSubmissionRequest body, String authorization) throws ApiException { + ApiResponse resp = vendorPlatesPostWithHttpInfo(body, authorization); + return resp.getData(); + } + + /** + * Submit a new set of Sample data + * Submit a new set of Sample data + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorPlateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorPlatesPostWithHttpInfo(VendorPlatesSubmissionRequest body, String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorPlatesPostValidateBeforeCall(body, authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Submit a new set of Sample data (asynchronously) + * Submit a new set of Sample data + * @param body (optional) + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorPlatesPostAsync(VendorPlatesSubmissionRequest body, String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorPlatesPostValidateBeforeCall(body, authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorPlatesSubmissionIdGet + * @param submissionId (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorPlatesSubmissionIdGetCall(String submissionId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/plates/{submissionId}" + .replaceAll("\\{" + "submissionId" + "\\}", apiClient.escapeString(submissionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorPlatesSubmissionIdGetValidateBeforeCall(String submissionId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'submissionId' is set + if (submissionId == null) { + throw new ApiException("Missing the required parameter 'submissionId' when calling vendorPlatesSubmissionIdGet(Async)"); + } + + com.squareup.okhttp.Call call = vendorPlatesSubmissionIdGetCall(submissionId, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the data for a submitted set of plates + * Get data for a submitted set of plates + * @param submissionId (required) + * @return VendorPlateGetResponse1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorPlateGetResponse1 vendorPlatesSubmissionIdGet(String submissionId) throws ApiException { + ApiResponse resp = vendorPlatesSubmissionIdGetWithHttpInfo(submissionId); + return resp.getData(); + } + + /** + * Get the data for a submitted set of plates + * Get data for a submitted set of plates + * @param submissionId (required) + * @return ApiResponse<VendorPlateGetResponse1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorPlatesSubmissionIdGetWithHttpInfo(String submissionId) throws ApiException { + com.squareup.okhttp.Call call = vendorPlatesSubmissionIdGetValidateBeforeCall(submissionId, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the data for a submitted set of plates (asynchronously) + * Get data for a submitted set of plates + * @param submissionId (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorPlatesSubmissionIdGetAsync(String submissionId, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorPlatesSubmissionIdGetValidateBeforeCall(submissionId, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for vendorSpecificationsGet + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call vendorSpecificationsGetCall(String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/vendor/specifications"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + if (authorization != null) + localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "AuthorizationToken" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call vendorSpecificationsGetValidateBeforeCall(String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = vendorSpecificationsGetCall(authorization, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Get the Vendor Specifications + * Defines the plate format specification for the vendor. + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return VendorSpecificationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public VendorSpecificationResponse vendorSpecificationsGet(String authorization) throws ApiException { + ApiResponse resp = vendorSpecificationsGetWithHttpInfo(authorization); + return resp.getData(); + } + + /** + * Get the Vendor Specifications + * Defines the plate format specification for the vendor. + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @return ApiResponse<VendorSpecificationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse vendorSpecificationsGetWithHttpInfo(String authorization) throws ApiException { + com.squareup.okhttp.Call call = vendorSpecificationsGetValidateBeforeCall(authorization, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get the Vendor Specifications (asynchronously) + * Defines the plate format specification for the vendor. + * @param authorization HTTP HEADER - Token used for Authorization <strong>Bearer {token_string} </strong> (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call vendorSpecificationsGetAsync(String authorization, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = vendorSpecificationsGetValidateBeforeCall(authorization, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/auth/ApiKeyAuth.java b/brapi-client/src/main/resources/swagger-generated-client/auth/ApiKeyAuth.java new file mode 100755 index 00000000..a5d76934 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/auth/ApiKeyAuth.java @@ -0,0 +1,73 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/auth/Authentication.java b/brapi-client/src/main/resources/swagger-generated-client/auth/Authentication.java new file mode 100755 index 00000000..bbec4ddd --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/auth/Authentication.java @@ -0,0 +1,28 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + void applyToParams(List queryParams, Map headerParams); +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/auth/HttpBasicAuth.java b/brapi-client/src/main/resources/swagger-generated-client/auth/HttpBasicAuth.java new file mode 100755 index 00000000..9a278ffc --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/auth/HttpBasicAuth.java @@ -0,0 +1,51 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import com.squareup.okhttp.Credentials; + +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/auth/OAuth.java b/brapi-client/src/main/resources/swagger-generated-client/auth/OAuth.java new file mode 100755 index 00000000..1c45afdf --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/auth/OAuth.java @@ -0,0 +1,37 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]")public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/auth/OAuthFlow.java b/brapi-client/src/main/resources/swagger-generated-client/auth/OAuthFlow.java new file mode 100755 index 00000000..c25cd83b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/auth/OAuthFlow.java @@ -0,0 +1,17 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetails.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetails.java new file mode 100755 index 00000000..e2074e3d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetails.java @@ -0,0 +1,202 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * AlleleMatrixDetails + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixDetails { + @SerializedName("description") + private String description = null; + + @SerializedName("lastUpdated") + private OffsetDateTime lastUpdated = null; + + @SerializedName("matrixDbId") + private String matrixDbId = null; + + @SerializedName("matrixName") + private String matrixName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + public AlleleMatrixDetails description(String description) { + this.description = description; + return this; + } + + /** + * How the matrix was generated + * @return description + **/ + @Schema(description = "How the matrix was generated") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AlleleMatrixDetails lastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * A date format + * @return lastUpdated + **/ + @Schema(description = "A date format") + public OffsetDateTime getLastUpdated() { + return lastUpdated; + } + + public void setLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + } + + public AlleleMatrixDetails matrixDbId(String matrixDbId) { + this.matrixDbId = matrixDbId; + return this; + } + + /** + * ID of the matrix + * @return matrixDbId + **/ + @Schema(description = "ID of the matrix") + public String getMatrixDbId() { + return matrixDbId; + } + + public void setMatrixDbId(String matrixDbId) { + this.matrixDbId = matrixDbId; + } + + public AlleleMatrixDetails matrixName(String matrixName) { + this.matrixName = matrixName; + return this; + } + + /** + * Name of the matrix + * @return matrixName + **/ + @Schema(description = "Name of the matrix") + public String getMatrixName() { + return matrixName; + } + + public void setMatrixName(String matrixName) { + this.matrixName = matrixName; + } + + public AlleleMatrixDetails name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"matrixName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"matrixName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AlleleMatrixDetails studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Link to the study where the matrix was produced + * @return studyDbId + **/ + @Schema(description = "Link to the study where the matrix was produced") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixDetails alleleMatrixDetails = (AlleleMatrixDetails) o; + return Objects.equals(this.description, alleleMatrixDetails.description) && + Objects.equals(this.lastUpdated, alleleMatrixDetails.lastUpdated) && + Objects.equals(this.matrixDbId, alleleMatrixDetails.matrixDbId) && + Objects.equals(this.matrixName, alleleMatrixDetails.matrixName) && + Objects.equals(this.name, alleleMatrixDetails.name) && + Objects.equals(this.studyDbId, alleleMatrixDetails.studyDbId); + } + + @Override + public int hashCode() { + return Objects.hash(description, lastUpdated, matrixDbId, matrixName, name, studyDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixDetails {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n"); + sb.append(" matrixDbId: ").append(toIndentedString(matrixDbId)).append("\n"); + sb.append(" matrixName: ").append(toIndentedString(matrixName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponse.java new file mode 100755 index 00000000..08f15b02 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.AlleleMatrixDetailsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * AlleleMatrixDetailsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixDetailsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private AlleleMatrixDetailsResponseResult result = null; + + public AlleleMatrixDetailsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public AlleleMatrixDetailsResponse result(AlleleMatrixDetailsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public AlleleMatrixDetailsResponseResult getResult() { + return result; + } + + public void setResult(AlleleMatrixDetailsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixDetailsResponse alleleMatrixDetailsResponse = (AlleleMatrixDetailsResponse) o; + return Objects.equals(this.metadata, alleleMatrixDetailsResponse.metadata) && + Objects.equals(this.result, alleleMatrixDetailsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixDetailsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponseResult.java new file mode 100755 index 00000000..ed45c749 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixDetailsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.AlleleMatrixDetails; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * AlleleMatrixDetailsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixDetailsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public AlleleMatrixDetailsResponseResult data(List data) { + this.data = data; + return this; + } + + public AlleleMatrixDetailsResponseResult addDataItem(AlleleMatrixDetails dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixDetailsResponseResult alleleMatrixDetailsResponseResult = (AlleleMatrixDetailsResponseResult) o; + return Objects.equals(this.data, alleleMatrixDetailsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixDetailsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixSearchRequest.java new file mode 100755 index 00000000..a2c68b52 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixSearchRequest.java @@ -0,0 +1,351 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * AlleleMatrixSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixSearchRequest { + @SerializedName("expandHomozygotes") + private Boolean expandHomozygotes = null; + + @SerializedName("format") + private String format = null; + + @SerializedName("markerDbId") + private List markerDbId = null; + + @SerializedName("markerProfileDbId") + private List markerProfileDbId = null; + + @SerializedName("markerprofileDbId") + private List markerprofileDbId = null; + + @SerializedName("matrixDbId") + private List matrixDbId = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("sepPhased") + private String sepPhased = null; + + @SerializedName("sepUnphased") + private String sepUnphased = null; + + @SerializedName("unknownString") + private String unknownString = null; + + public AlleleMatrixSearchRequest expandHomozygotes(Boolean expandHomozygotes) { + this.expandHomozygotes = expandHomozygotes; + return this; + } + + /** + * Should homozygotes be expanded (true) or collapsed into a single occurence (false) + * @return expandHomozygotes + **/ + @Schema(description = "Should homozygotes be expanded (true) or collapsed into a single occurence (false)") + public Boolean isExpandHomozygotes() { + return expandHomozygotes; + } + + public void setExpandHomozygotes(Boolean expandHomozygotes) { + this.expandHomozygotes = expandHomozygotes; + } + + public AlleleMatrixSearchRequest format(String format) { + this.format = format; + return this; + } + + /** + * The data format of the response data. ie \"json\", \"tsv\", etc + * @return format + **/ + @Schema(description = "The data format of the response data. ie \"json\", \"tsv\", etc") + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + public AlleleMatrixSearchRequest markerDbId(List markerDbId) { + this.markerDbId = markerDbId; + return this; + } + + public AlleleMatrixSearchRequest addMarkerDbIdItem(String markerDbIdItem) { + if (this.markerDbId == null) { + this.markerDbId = new ArrayList(); + } + this.markerDbId.add(markerDbIdItem); + return this; + } + + /** + * An ID which uniquely identifies a Marker + * @return markerDbId + **/ + @Schema(description = "An ID which uniquely identifies a Marker") + public List getMarkerDbId() { + return markerDbId; + } + + public void setMarkerDbId(List markerDbId) { + this.markerDbId = markerDbId; + } + + public AlleleMatrixSearchRequest markerProfileDbId(List markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + return this; + } + + public AlleleMatrixSearchRequest addMarkerProfileDbIdItem(String markerProfileDbIdItem) { + if (this.markerProfileDbId == null) { + this.markerProfileDbId = new ArrayList(); + } + this.markerProfileDbId.add(markerProfileDbIdItem); + return this; + } + + /** + * An ID which uniquely identifies a Marker Profile + * @return markerProfileDbId + **/ + @Schema(description = "An ID which uniquely identifies a Marker Profile") + public List getMarkerProfileDbId() { + return markerProfileDbId; + } + + public void setMarkerProfileDbId(List markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + } + + public AlleleMatrixSearchRequest markerprofileDbId(List markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + return this; + } + + public AlleleMatrixSearchRequest addMarkerprofileDbIdItem(String markerprofileDbIdItem) { + if (this.markerprofileDbId == null) { + this.markerprofileDbId = new ArrayList(); + } + this.markerprofileDbId.add(markerprofileDbIdItem); + return this; + } + + /** + * DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) + * @return markerprofileDbId + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case)") + public List getMarkerprofileDbId() { + return markerprofileDbId; + } + + public void setMarkerprofileDbId(List markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + } + + public AlleleMatrixSearchRequest matrixDbId(List matrixDbId) { + this.matrixDbId = matrixDbId; + return this; + } + + public AlleleMatrixSearchRequest addMatrixDbIdItem(String matrixDbIdItem) { + if (this.matrixDbId == null) { + this.matrixDbId = new ArrayList(); + } + this.matrixDbId.add(matrixDbIdItem); + return this; + } + + /** + * An ID which uniquely identifies an Allele Matrix + * @return matrixDbId + **/ + @Schema(description = "An ID which uniquely identifies an Allele Matrix") + public List getMatrixDbId() { + return matrixDbId; + } + + public void setMatrixDbId(List matrixDbId) { + this.matrixDbId = matrixDbId; + } + + public AlleleMatrixSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public AlleleMatrixSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public AlleleMatrixSearchRequest sepPhased(String sepPhased) { + this.sepPhased = sepPhased; + return this; + } + + /** + * The string to use as a separator for phased allele calls. + * @return sepPhased + **/ + @Schema(description = "The string to use as a separator for phased allele calls.") + public String getSepPhased() { + return sepPhased; + } + + public void setSepPhased(String sepPhased) { + this.sepPhased = sepPhased; + } + + public AlleleMatrixSearchRequest sepUnphased(String sepUnphased) { + this.sepUnphased = sepUnphased; + return this; + } + + /** + * The string to use as a separator for unphased allele calls. + * @return sepUnphased + **/ + @Schema(description = "The string to use as a separator for unphased allele calls.") + public String getSepUnphased() { + return sepUnphased; + } + + public void setSepUnphased(String sepUnphased) { + this.sepUnphased = sepUnphased; + } + + public AlleleMatrixSearchRequest unknownString(String unknownString) { + this.unknownString = unknownString; + return this; + } + + /** + * The string to use as a representation for missing data. + * @return unknownString + **/ + @Schema(description = "The string to use as a representation for missing data.") + public String getUnknownString() { + return unknownString; + } + + public void setUnknownString(String unknownString) { + this.unknownString = unknownString; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixSearchRequest alleleMatrixSearchRequest = (AlleleMatrixSearchRequest) o; + return Objects.equals(this.expandHomozygotes, alleleMatrixSearchRequest.expandHomozygotes) && + Objects.equals(this.format, alleleMatrixSearchRequest.format) && + Objects.equals(this.markerDbId, alleleMatrixSearchRequest.markerDbId) && + Objects.equals(this.markerProfileDbId, alleleMatrixSearchRequest.markerProfileDbId) && + Objects.equals(this.markerprofileDbId, alleleMatrixSearchRequest.markerprofileDbId) && + Objects.equals(this.matrixDbId, alleleMatrixSearchRequest.matrixDbId) && + Objects.equals(this.page, alleleMatrixSearchRequest.page) && + Objects.equals(this.pageSize, alleleMatrixSearchRequest.pageSize) && + Objects.equals(this.sepPhased, alleleMatrixSearchRequest.sepPhased) && + Objects.equals(this.sepUnphased, alleleMatrixSearchRequest.sepUnphased) && + Objects.equals(this.unknownString, alleleMatrixSearchRequest.unknownString); + } + + @Override + public int hashCode() { + return Objects.hash(expandHomozygotes, format, markerDbId, markerProfileDbId, markerprofileDbId, matrixDbId, page, pageSize, sepPhased, sepUnphased, unknownString); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixSearchRequest {\n"); + + sb.append(" expandHomozygotes: ").append(toIndentedString(expandHomozygotes)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" markerDbId: ").append(toIndentedString(markerDbId)).append("\n"); + sb.append(" markerProfileDbId: ").append(toIndentedString(markerProfileDbId)).append("\n"); + sb.append(" markerprofileDbId: ").append(toIndentedString(markerprofileDbId)).append("\n"); + sb.append(" matrixDbId: ").append(toIndentedString(matrixDbId)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" sepPhased: ").append(toIndentedString(sepPhased)).append("\n"); + sb.append(" sepUnphased: ").append(toIndentedString(sepUnphased)).append("\n"); + sb.append(" unknownString: ").append(toIndentedString(unknownString)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValues.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValues.java new file mode 100755 index 00000000..f9ed0ef2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValues.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * AlleleMatrixValues + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixValues { + @SerializedName("data") + private List> data = null; + + public AlleleMatrixValues data(List> data) { + this.data = data; + return this; + } + + public AlleleMatrixValues addDataItem(List dataItem) { + if (this.data == null) { + this.data = new ArrayList>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Is an array of arrays; each inner array has three entries: ```markerDbId```, ```markerProfileDbId```, ```alleleCall```. Scores have to be represented as described further up. e.g. unknown data as \"N\", etc. Missing data can be skipped. + * @return data + **/ + @Schema(description = "Is an array of arrays; each inner array has three entries: ```markerDbId```, ```markerProfileDbId```, ```alleleCall```. Scores have to be represented as described further up. e.g. unknown data as \"N\", etc. Missing data can be skipped.") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixValues alleleMatrixValues = (AlleleMatrixValues) o; + return Objects.equals(this.data, alleleMatrixValues.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixValues {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse.java new file mode 100755 index 00000000..525ad8e0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse.java @@ -0,0 +1,111 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.AlleleMatrixValues; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * AlleleMatrixValuesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixValuesResponse { + @SerializedName("metadata") + private Object metadata = null; + + @SerializedName("result") + private AlleleMatrixValues result = null; + + public AlleleMatrixValuesResponse metadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Object getMetadata() { + return metadata; + } + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + public AlleleMatrixValuesResponse result(AlleleMatrixValues result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public AlleleMatrixValues getResult() { + return result; + } + + public void setResult(AlleleMatrixValues result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixValuesResponse alleleMatrixValuesResponse = (AlleleMatrixValuesResponse) o; + return Objects.equals(this.metadata, alleleMatrixValuesResponse.metadata) && + Objects.equals(this.result, alleleMatrixValuesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixValuesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse1.java new file mode 100755 index 00000000..cade256a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AlleleMatrixValuesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.AlleleMatrixValues; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * AlleleMatrixValuesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AlleleMatrixValuesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private AlleleMatrixValues result = null; + + public AlleleMatrixValuesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public AlleleMatrixValuesResponse1 result(AlleleMatrixValues result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public AlleleMatrixValues getResult() { + return result; + } + + public void setResult(AlleleMatrixValues result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlleleMatrixValuesResponse1 alleleMatrixValuesResponse1 = (AlleleMatrixValuesResponse1) o; + return Objects.equals(this.metadata, alleleMatrixValuesResponse1.metadata) && + Objects.equals(this.result, alleleMatrixValuesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlleleMatrixValuesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/AsynchStatusMetadata.java b/brapi-client/src/main/resources/swagger-generated-client/model/AsynchStatusMetadata.java new file mode 100755 index 00000000..a7b430e4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/AsynchStatusMetadata.java @@ -0,0 +1,87 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * AsynchStatusMetadata + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class AsynchStatusMetadata { + @SerializedName("asynchStatus") + private Object asynchStatus = null; + + public AsynchStatusMetadata asynchStatus(Object asynchStatus) { + this.asynchStatus = asynchStatus; + return this; + } + + /** + * Get asynchStatus + * @return asynchStatus + **/ + @Schema(description = "") + public Object getAsynchStatus() { + return asynchStatus; + } + + public void setAsynchStatus(Object asynchStatus) { + this.asynchStatus = asynchStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AsynchStatusMetadata asynchStatusMetadata = (AsynchStatusMetadata) o; + return Objects.equals(this.asynchStatus, asynchStatusMetadata.asynchStatus); + } + + @Override + public int hashCode() { + return Objects.hash(asynchStatus); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AsynchStatusMetadata {\n"); + + sb.append(" asynchStatus: ").append(toIndentedString(asynchStatus)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Body.java b/brapi-client/src/main/resources/swagger-generated-client/model/Body.java new file mode 100755 index 00000000..c79246c5 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Body.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Body + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Body { + @SerializedName("client_id") + private String clientId = null; + + @SerializedName("grant_type") + private String grantType = null; + + @SerializedName("password") + private String password = null; + + @SerializedName("username") + private String username = null; + + public Body clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + **/ + @Schema(description = "") + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public Body grantType(String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + **/ + @Schema(description = "") + public String getGrantType() { + return grantType; + } + + public void setGrantType(String grantType) { + this.grantType = grantType; + } + + public Body password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @Schema(description = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Body username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @Schema(description = "") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Body body = (Body) o; + return Objects.equals(this.clientId, body.clientId) && + Objects.equals(this.grantType, body.grantType) && + Objects.equals(this.password, body.password) && + Objects.equals(this.username, body.username); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, grantType, password, username); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Body {\n"); + + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethod.java b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethod.java new file mode 100755 index 00000000..749f4760 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethod.java @@ -0,0 +1,179 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * BreedingMethod + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class BreedingMethod { + @SerializedName("abbreviation") + private String abbreviation = null; + + @SerializedName("breedingMethodDbId") + private String breedingMethodDbId = null; + + @SerializedName("breedingMethodName") + private String breedingMethodName = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("name") + private String name = null; + + public BreedingMethod abbreviation(String abbreviation) { + this.abbreviation = abbreviation; + return this; + } + + /** + * an abbreviation for the name of this breeding method + * @return abbreviation + **/ + @Schema(description = "an abbreviation for the name of this breeding method") + public String getAbbreviation() { + return abbreviation; + } + + public void setAbbreviation(String abbreviation) { + this.abbreviation = abbreviation; + } + + public BreedingMethod breedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + return this; + } + + /** + * the unique identifier for this breeding method + * @return breedingMethodDbId + **/ + @Schema(required = true, description = "the unique identifier for this breeding method") + public String getBreedingMethodDbId() { + return breedingMethodDbId; + } + + public void setBreedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + } + + public BreedingMethod breedingMethodName(String breedingMethodName) { + this.breedingMethodName = breedingMethodName; + return this; + } + + /** + * human readable name of the breeding method + * @return breedingMethodName + **/ + @Schema(description = "human readable name of the breeding method") + public String getBreedingMethodName() { + return breedingMethodName; + } + + public void setBreedingMethodName(String breedingMethodName) { + this.breedingMethodName = breedingMethodName; + } + + public BreedingMethod description(String description) { + this.description = description; + return this; + } + + /** + * human readable description of the breeding method + * @return description + **/ + @Schema(description = "human readable description of the breeding method") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public BreedingMethod name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"breedingMethodName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"breedingMethodName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BreedingMethod breedingMethod = (BreedingMethod) o; + return Objects.equals(this.abbreviation, breedingMethod.abbreviation) && + Objects.equals(this.breedingMethodDbId, breedingMethod.breedingMethodDbId) && + Objects.equals(this.breedingMethodName, breedingMethod.breedingMethodName) && + Objects.equals(this.description, breedingMethod.description) && + Objects.equals(this.name, breedingMethod.name); + } + + @Override + public int hashCode() { + return Objects.hash(abbreviation, breedingMethodDbId, breedingMethodName, description, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BreedingMethod {\n"); + + sb.append(" abbreviation: ").append(toIndentedString(abbreviation)).append("\n"); + sb.append(" breedingMethodDbId: ").append(toIndentedString(breedingMethodDbId)).append("\n"); + sb.append(" breedingMethodName: ").append(toIndentedString(breedingMethodName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodResponse.java new file mode 100755 index 00000000..b56b34bc --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.BreedingMethod; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * BreedingMethodResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class BreedingMethodResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private BreedingMethod result = null; + + public BreedingMethodResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public BreedingMethodResponse result(BreedingMethod result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public BreedingMethod getResult() { + return result; + } + + public void setResult(BreedingMethod result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BreedingMethodResponse breedingMethodResponse = (BreedingMethodResponse) o; + return Objects.equals(this.metadata, breedingMethodResponse.metadata) && + Objects.equals(this.result, breedingMethodResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BreedingMethodResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponse.java new file mode 100755 index 00000000..12161361 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.BreedingMethodsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * BreedingMethodsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class BreedingMethodsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private BreedingMethodsResponseResult result = null; + + public BreedingMethodsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public BreedingMethodsResponse result(BreedingMethodsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public BreedingMethodsResponseResult getResult() { + return result; + } + + public void setResult(BreedingMethodsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BreedingMethodsResponse breedingMethodsResponse = (BreedingMethodsResponse) o; + return Objects.equals(this.metadata, breedingMethodsResponse.metadata) && + Objects.equals(this.result, breedingMethodsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BreedingMethodsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponseResult.java new file mode 100755 index 00000000..893abe05 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/BreedingMethodsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.BreedingMethod; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * BreedingMethodsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class BreedingMethodsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public BreedingMethodsResponseResult data(List data) { + this.data = data; + return this; + } + + public BreedingMethodsResponseResult addDataItem(BreedingMethod dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BreedingMethodsResponseResult breedingMethodsResponseResult = (BreedingMethodsResponseResult) o; + return Objects.equals(this.data, breedingMethodsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BreedingMethodsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Call.java b/brapi-client/src/main/resources/swagger-generated-client/model/Call.java new file mode 100755 index 00000000..83ed9d45 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Call.java @@ -0,0 +1,298 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.WSMIMEDataTypes; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * Call + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Call { + @SerializedName("call") + private String call = null; + + @SerializedName("dataTypes") + private List dataTypes = new ArrayList(); + + @SerializedName("datatypes") + private List datatypes = null; + + /** + * Gets or Sets methods + */ + @JsonAdapter(MethodsEnum.Adapter.class) + public enum MethodsEnum { + GET("GET"), + POST("POST"), + PUT("PUT"), + DELETE("DELETE"); + + private String value; + + MethodsEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static MethodsEnum fromValue(String text) { + for (MethodsEnum b : MethodsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MethodsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MethodsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MethodsEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("methods") + private List methods = new ArrayList(); + + /** + * Gets or Sets versions + */ + @JsonAdapter(VersionsEnum.Adapter.class) + public enum VersionsEnum { + _0("1.0"), + _1("1.1"), + _2("1.2"), + _3("1.3"); + + private String value; + + VersionsEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static VersionsEnum fromValue(String text) { + for (VersionsEnum b : VersionsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VersionsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VersionsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VersionsEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("versions") + private List versions = null; + + public Call call(String call) { + this.call = call; + return this; + } + + /** + * The name of the available call as recorded in the documentation + * @return call + **/ + @Schema(required = true, description = "The name of the available call as recorded in the documentation") + public String getCall() { + return call; + } + + public void setCall(String call) { + this.call = call; + } + + public Call dataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + public Call addDataTypesItem(WSMIMEDataTypes dataTypesItem) { + this.dataTypes.add(dataTypesItem); + return this; + } + + /** + * The possible data formats returned by the available call + * @return dataTypes + **/ + @Schema(required = true, description = "The possible data formats returned by the available call") + public List getDataTypes() { + return dataTypes; + } + + public void setDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + } + + public Call datatypes(List datatypes) { + this.datatypes = datatypes; + return this; + } + + public Call addDatatypesItem(WSMIMEDataTypes datatypesItem) { + if (this.datatypes == null) { + this.datatypes = new ArrayList(); + } + this.datatypes.add(datatypesItem); + return this; + } + + /** + * DEPRECATED in v1.3 - see \"dataTypes\" (camel case) + * @return datatypes + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"dataTypes\" (camel case)") + public List getDatatypes() { + return datatypes; + } + + public void setDatatypes(List datatypes) { + this.datatypes = datatypes; + } + + public Call methods(List methods) { + this.methods = methods; + return this; + } + + public Call addMethodsItem(MethodsEnum methodsItem) { + this.methods.add(methodsItem); + return this; + } + + /** + * The possible HTTP Methods to be used with the available call + * @return methods + **/ + @Schema(required = true, description = "The possible HTTP Methods to be used with the available call") + public List getMethods() { + return methods; + } + + public void setMethods(List methods) { + this.methods = methods; + } + + public Call versions(List versions) { + this.versions = versions; + return this; + } + + public Call addVersionsItem(VersionsEnum versionsItem) { + if (this.versions == null) { + this.versions = new ArrayList(); + } + this.versions.add(versionsItem); + return this; + } + + /** + * The supported versions of a particular call + * @return versions + **/ + @Schema(description = "The supported versions of a particular call") + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Call call = (Call) o; + return Objects.equals(this.call, call.call) && + Objects.equals(this.dataTypes, call.dataTypes) && + Objects.equals(this.datatypes, call.datatypes) && + Objects.equals(this.methods, call.methods) && + Objects.equals(this.versions, call.versions); + } + + @Override + public int hashCode() { + return Objects.hash(call, dataTypes, datatypes, methods, versions); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Call {\n"); + + sb.append(" call: ").append(toIndentedString(call)).append("\n"); + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" datatypes: ").append(toIndentedString(datatypes)).append("\n"); + sb.append(" methods: ").append(toIndentedString(methods)).append("\n"); + sb.append(" versions: ").append(toIndentedString(versions)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponse.java new file mode 100755 index 00000000..dfcd9124 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.CallsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * CallsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CallsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private CallsResponseResult result = null; + + public CallsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public CallsResponse result(CallsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public CallsResponseResult getResult() { + return result; + } + + public void setResult(CallsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallsResponse callsResponse = (CallsResponse) o; + return Objects.equals(this.metadata, callsResponse.metadata) && + Objects.equals(this.result, callsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponseResult.java new file mode 100755 index 00000000..744494c1 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CallsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Call; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * CallsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CallsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public CallsResponseResult data(List data) { + this.data = data; + return this; + } + + public CallsResponseResult addDataItem(Call dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Array of availible calls on this server + * @return data + **/ + @Schema(required = true, description = "Array of availible calls on this server") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallsResponseResult callsResponseResult = (CallsResponseResult) o; + return Objects.equals(this.data, callsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponse.java new file mode 100755 index 00000000..dad159bd --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.CommonCropNamesResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * CommonCropNamesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CommonCropNamesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private CommonCropNamesResponseResult result = null; + + public CommonCropNamesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public CommonCropNamesResponse result(CommonCropNamesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public CommonCropNamesResponseResult getResult() { + return result; + } + + public void setResult(CommonCropNamesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommonCropNamesResponse commonCropNamesResponse = (CommonCropNamesResponse) o; + return Objects.equals(this.metadata, commonCropNamesResponse.metadata) && + Objects.equals(this.result, commonCropNamesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommonCropNamesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponseResult.java new file mode 100755 index 00000000..f4e7721f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CommonCropNamesResponseResult.java @@ -0,0 +1,94 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * CommonCropNamesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CommonCropNamesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public CommonCropNamesResponseResult data(List data) { + this.data = data; + return this; + } + + public CommonCropNamesResponseResult addDataItem(String dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * array of crop names availible on the server + * @return data + **/ + @Schema(required = true, description = "array of crop names availible on the server") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommonCropNamesResponseResult commonCropNamesResponseResult = (CommonCropNamesResponseResult) o; + return Objects.equals(this.data, commonCropNamesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommonCropNamesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Contact.java b/brapi-client/src/main/resources/swagger-generated-client/model/Contact.java new file mode 100755 index 00000000..6bd9c4a0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Contact.java @@ -0,0 +1,202 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Contact + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Contact { + @SerializedName("contactDbId") + private String contactDbId = null; + + @SerializedName("email") + private String email = null; + + @SerializedName("instituteName") + private String instituteName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("orcid") + private String orcid = null; + + @SerializedName("type") + private String type = null; + + public Contact contactDbId(String contactDbId) { + this.contactDbId = contactDbId; + return this; + } + + /** + * The ID which uniquely identifies this contact + * @return contactDbId + **/ + @Schema(required = true, description = "The ID which uniquely identifies this contact") + public String getContactDbId() { + return contactDbId; + } + + public void setContactDbId(String contactDbId) { + this.contactDbId = contactDbId; + } + + public Contact email(String email) { + this.email = email; + return this; + } + + /** + * The contacts email address + * @return email + **/ + @Schema(description = "The contacts email address ") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Contact instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * The name of the institution which this contact is part of + * @return instituteName + **/ + @Schema(description = "The name of the institution which this contact is part of") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + public Contact name(String name) { + this.name = name; + return this; + } + + /** + * The full name of this contact person + * @return name + **/ + @Schema(description = "The full name of this contact person") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Contact orcid(String orcid) { + this.orcid = orcid; + return this; + } + + /** + * The Open Researcher and Contributor ID for this contact person (orcid.org) + * @return orcid + **/ + @Schema(description = "The Open Researcher and Contributor ID for this contact person (orcid.org)") + public String getOrcid() { + return orcid; + } + + public void setOrcid(String orcid) { + this.orcid = orcid; + } + + public Contact type(String type) { + this.type = type; + return this; + } + + /** + * The type of person this contact represents (ex: Coordinator, Scientist, PI, etc.) + * @return type + **/ + @Schema(description = "The type of person this contact represents (ex: Coordinator, Scientist, PI, etc.)") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Contact contact = (Contact) o; + return Objects.equals(this.contactDbId, contact.contactDbId) && + Objects.equals(this.email, contact.email) && + Objects.equals(this.instituteName, contact.instituteName) && + Objects.equals(this.name, contact.name) && + Objects.equals(this.orcid, contact.orcid) && + Objects.equals(this.type, contact.type); + } + + @Override + public int hashCode() { + return Objects.hash(contactDbId, email, instituteName, name, orcid, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Contact {\n"); + + sb.append(" contactDbId: ").append(toIndentedString(contactDbId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orcid: ").append(toIndentedString(orcid)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponse.java new file mode 100755 index 00000000..80979ade --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.CropsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * CropsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CropsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private CropsResponseResult result = null; + + public CropsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public CropsResponse result(CropsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public CropsResponseResult getResult() { + return result; + } + + public void setResult(CropsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CropsResponse cropsResponse = (CropsResponse) o; + return Objects.equals(this.metadata, cropsResponse.metadata) && + Objects.equals(this.result, cropsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CropsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponseResult.java new file mode 100755 index 00000000..e11690a8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/CropsResponseResult.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * CropsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class CropsResponseResult { + @SerializedName("data") + private List data = null; + + public CropsResponseResult data(List data) { + this.data = data; + return this; + } + + public CropsResponseResult addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * array of crop names availible on the server + * @return data + **/ + @Schema(description = "array of crop names availible on the server") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CropsResponseResult cropsResponseResult = (CropsResponseResult) o; + return Objects.equals(this.data, cropsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CropsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/DataLink.java b/brapi-client/src/main/resources/swagger-generated-client/model/DataLink.java new file mode 100755 index 00000000..13a0b413 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/DataLink.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * DataLink + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class DataLink { + @SerializedName("dataLinkName") + private String dataLinkName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("url") + private String url = null; + + public DataLink dataLinkName(String dataLinkName) { + this.dataLinkName = dataLinkName; + return this; + } + + /** + * The name of the external data link + * @return dataLinkName + **/ + @Schema(description = "The name of the external data link") + public String getDataLinkName() { + return dataLinkName; + } + + public void setDataLinkName(String dataLinkName) { + this.dataLinkName = dataLinkName; + } + + public DataLink name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"dataLinkName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"dataLinkName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DataLink type(String type) { + this.type = type; + return this; + } + + /** + * The type of external data link + * @return type + **/ + @Schema(description = "The type of external data link") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public DataLink url(String url) { + this.url = url; + return this; + } + + /** + * The URL which links to external data + * @return url + **/ + @Schema(description = "The URL which links to external data") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataLink dataLink = (DataLink) o; + return Objects.equals(this.dataLinkName, dataLink.dataLinkName) && + Objects.equals(this.name, dataLink.name) && + Objects.equals(this.type, dataLink.type) && + Objects.equals(this.url, dataLink.url); + } + + @Override + public int hashCode() { + return Objects.hash(dataLinkName, name, type, url); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataLink {\n"); + + sb.append(" dataLinkName: ").append(toIndentedString(dataLinkName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponse.java new file mode 100755 index 00000000..eba1d672 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.DataTypesResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * DataTypesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class DataTypesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private DataTypesResponseResult result = null; + + public DataTypesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public DataTypesResponse result(DataTypesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public DataTypesResponseResult getResult() { + return result; + } + + public void setResult(DataTypesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataTypesResponse dataTypesResponse = (DataTypesResponse) o; + return Objects.equals(this.metadata, dataTypesResponse.metadata) && + Objects.equals(this.result, dataTypesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataTypesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponseResult.java new file mode 100755 index 00000000..d2cca07d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/DataTypesResponseResult.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * DataTypesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class DataTypesResponseResult { + @SerializedName("data") + private List data = null; + + public DataTypesResponseResult data(List data) { + this.data = data; + return this; + } + + public DataTypesResponseResult addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataTypesResponseResult dataTypesResponseResult = (DataTypesResponseResult) o; + return Objects.equals(this.data, dataTypesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataTypesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMap.java b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMap.java new file mode 100755 index 00000000..53e9bfe2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMap.java @@ -0,0 +1,363 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.LocalDate; +/** + * GenomeMap + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GenomeMap { + @SerializedName("comments") + private String comments = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("linkageGroupCount") + private Integer linkageGroupCount = null; + + @SerializedName("mapDbId") + private String mapDbId = null; + + @SerializedName("mapName") + private String mapName = null; + + @SerializedName("markerCount") + private Integer markerCount = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("publishedDate") + private LocalDate publishedDate = null; + + @SerializedName("scientificName") + private String scientificName = null; + + @SerializedName("species") + private String species = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("unit") + private String unit = null; + + public GenomeMap comments(String comments) { + this.comments = comments; + return this; + } + + /** + * Additional comments + * @return comments + **/ + @Schema(description = "Additional comments") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public GenomeMap commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * The common name of the crop, found from \"GET /commoncropnames\" + * @return commonCropName + **/ + @Schema(required = true, description = "The common name of the crop, found from \"GET /commoncropnames\"") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public GenomeMap documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public GenomeMap linkageGroupCount(Integer linkageGroupCount) { + this.linkageGroupCount = linkageGroupCount; + return this; + } + + /** + * The number of linkage groups present in this genome map + * @return linkageGroupCount + **/ + @Schema(description = "The number of linkage groups present in this genome map") + public Integer getLinkageGroupCount() { + return linkageGroupCount; + } + + public void setLinkageGroupCount(Integer linkageGroupCount) { + this.linkageGroupCount = linkageGroupCount; + } + + public GenomeMap mapDbId(String mapDbId) { + this.mapDbId = mapDbId; + return this; + } + + /** + * The ID which uniquely identifies this genome map + * @return mapDbId + **/ + @Schema(required = true, description = "The ID which uniquely identifies this genome map") + public String getMapDbId() { + return mapDbId; + } + + public void setMapDbId(String mapDbId) { + this.mapDbId = mapDbId; + } + + public GenomeMap mapName(String mapName) { + this.mapName = mapName; + return this; + } + + /** + * A human readable name for this genome map + * @return mapName + **/ + @Schema(description = "A human readable name for this genome map") + public String getMapName() { + return mapName; + } + + public void setMapName(String mapName) { + this.mapName = mapName; + } + + public GenomeMap markerCount(Integer markerCount) { + this.markerCount = markerCount; + return this; + } + + /** + * The number of markers present in this genome map + * @return markerCount + **/ + @Schema(description = "The number of markers present in this genome map") + public Integer getMarkerCount() { + return markerCount; + } + + public void setMarkerCount(Integer markerCount) { + this.markerCount = markerCount; + } + + public GenomeMap name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"mapName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"mapName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GenomeMap publishedDate(LocalDate publishedDate) { + this.publishedDate = publishedDate; + return this; + } + + /** + * The date this genome was published + * @return publishedDate + **/ + @Schema(description = "The date this genome was published") + public LocalDate getPublishedDate() { + return publishedDate; + } + + public void setPublishedDate(LocalDate publishedDate) { + this.publishedDate = publishedDate; + } + + public GenomeMap scientificName(String scientificName) { + this.scientificName = scientificName; + return this; + } + + /** + * Full scientific binomial format name. This includes Genus, Species, and Sub-species + * @return scientificName + **/ + @Schema(description = "Full scientific binomial format name. This includes Genus, Species, and Sub-species") + public String getScientificName() { + return scientificName; + } + + public void setScientificName(String scientificName) { + this.scientificName = scientificName; + } + + public GenomeMap species(String species) { + this.species = species; + return this; + } + + /** + * DEPRECATED in v1.3 - See \"scientificName\" + * @return species + **/ + @Schema(description = "DEPRECATED in v1.3 - See \"scientificName\"") + public String getSpecies() { + return species; + } + + public void setSpecies(String species) { + this.species = species; + } + + public GenomeMap type(String type) { + this.type = type; + return this; + } + + /** + * The type of map this represents, ussually \"Genetic\" + * @return type + **/ + @Schema(required = true, description = "The type of map this represents, ussually \"Genetic\"") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public GenomeMap unit(String unit) { + this.unit = unit; + return this; + } + + /** + * The units used to describe the data in this map + * @return unit + **/ + @Schema(description = "The units used to describe the data in this map") + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenomeMap genomeMap = (GenomeMap) o; + return Objects.equals(this.comments, genomeMap.comments) && + Objects.equals(this.commonCropName, genomeMap.commonCropName) && + Objects.equals(this.documentationURL, genomeMap.documentationURL) && + Objects.equals(this.linkageGroupCount, genomeMap.linkageGroupCount) && + Objects.equals(this.mapDbId, genomeMap.mapDbId) && + Objects.equals(this.mapName, genomeMap.mapName) && + Objects.equals(this.markerCount, genomeMap.markerCount) && + Objects.equals(this.name, genomeMap.name) && + Objects.equals(this.publishedDate, genomeMap.publishedDate) && + Objects.equals(this.scientificName, genomeMap.scientificName) && + Objects.equals(this.species, genomeMap.species) && + Objects.equals(this.type, genomeMap.type) && + Objects.equals(this.unit, genomeMap.unit); + } + + @Override + public int hashCode() { + return Objects.hash(comments, commonCropName, documentationURL, linkageGroupCount, mapDbId, mapName, markerCount, name, publishedDate, scientificName, species, type, unit); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenomeMap {\n"); + + sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" linkageGroupCount: ").append(toIndentedString(linkageGroupCount)).append("\n"); + sb.append(" mapDbId: ").append(toIndentedString(mapDbId)).append("\n"); + sb.append(" mapName: ").append(toIndentedString(mapName)).append("\n"); + sb.append(" markerCount: ").append(toIndentedString(markerCount)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publishedDate: ").append(toIndentedString(publishedDate)).append("\n"); + sb.append(" scientificName: ").append(toIndentedString(scientificName)).append("\n"); + sb.append(" species: ").append(toIndentedString(species)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapDetails.java b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapDetails.java new file mode 100755 index 00000000..07122271 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapDetails.java @@ -0,0 +1,267 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.LinkageGroup; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GenomeMapDetails + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GenomeMapDetails { + @SerializedName("data") + private List data = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("linkageGroups") + private List linkageGroups = null; + + @SerializedName("mapDbId") + private String mapDbId = null; + + @SerializedName("mapName") + private String mapName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("unit") + private String unit = null; + + public GenomeMapDetails data(List data) { + this.data = data; + return this; + } + + public GenomeMapDetails addDataItem(LinkageGroup dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of linkage group details associated with a given map + * @return data + **/ + @Schema(description = "List of linkage group details associated with a given map") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public GenomeMapDetails documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public GenomeMapDetails linkageGroups(List linkageGroups) { + this.linkageGroups = linkageGroups; + return this; + } + + public GenomeMapDetails addLinkageGroupsItem(LinkageGroup linkageGroupsItem) { + if (this.linkageGroups == null) { + this.linkageGroups = new ArrayList(); + } + this.linkageGroups.add(linkageGroupsItem); + return this; + } + + /** + * **Deprecated** Use \"data\" + * @return linkageGroups + **/ + @Schema(description = "**Deprecated** Use \"data\"") + public List getLinkageGroups() { + return linkageGroups; + } + + public void setLinkageGroups(List linkageGroups) { + this.linkageGroups = linkageGroups; + } + + public GenomeMapDetails mapDbId(String mapDbId) { + this.mapDbId = mapDbId; + return this; + } + + /** + * The ID which uniquely identifies this genome map + * @return mapDbId + **/ + @Schema(description = "The ID which uniquely identifies this genome map") + public String getMapDbId() { + return mapDbId; + } + + public void setMapDbId(String mapDbId) { + this.mapDbId = mapDbId; + } + + public GenomeMapDetails mapName(String mapName) { + this.mapName = mapName; + return this; + } + + /** + * A human readable name for this map + * @return mapName + **/ + @Schema(description = "A human readable name for this map") + public String getMapName() { + return mapName; + } + + public void setMapName(String mapName) { + this.mapName = mapName; + } + + public GenomeMapDetails name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"mapName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"mapName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GenomeMapDetails type(String type) { + this.type = type; + return this; + } + + /** + * The type of map this represents, ussually \"Genetic\" or \"Physical\" + * @return type + **/ + @Schema(description = "The type of map this represents, ussually \"Genetic\" or \"Physical\"") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public GenomeMapDetails unit(String unit) { + this.unit = unit; + return this; + } + + /** + * The units used to describe the data in this map + * @return unit + **/ + @Schema(description = "The units used to describe the data in this map") + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenomeMapDetails genomeMapDetails = (GenomeMapDetails) o; + return Objects.equals(this.data, genomeMapDetails.data) && + Objects.equals(this.documentationURL, genomeMapDetails.documentationURL) && + Objects.equals(this.linkageGroups, genomeMapDetails.linkageGroups) && + Objects.equals(this.mapDbId, genomeMapDetails.mapDbId) && + Objects.equals(this.mapName, genomeMapDetails.mapName) && + Objects.equals(this.name, genomeMapDetails.name) && + Objects.equals(this.type, genomeMapDetails.type) && + Objects.equals(this.unit, genomeMapDetails.unit); + } + + @Override + public int hashCode() { + return Objects.hash(data, documentationURL, linkageGroups, mapDbId, mapName, name, type, unit); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenomeMapDetails {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" linkageGroups: ").append(toIndentedString(linkageGroups)).append("\n"); + sb.append(" mapDbId: ").append(toIndentedString(mapDbId)).append("\n"); + sb.append(" mapName: ").append(toIndentedString(mapName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponse.java new file mode 100755 index 00000000..790de255 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GenomeMapsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GenomeMapsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GenomeMapsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GenomeMapsResponseResult result = null; + + public GenomeMapsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GenomeMapsResponse result(GenomeMapsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GenomeMapsResponseResult getResult() { + return result; + } + + public void setResult(GenomeMapsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenomeMapsResponse genomeMapsResponse = (GenomeMapsResponse) o; + return Objects.equals(this.metadata, genomeMapsResponse.metadata) && + Objects.equals(this.result, genomeMapsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenomeMapsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponseResult.java new file mode 100755 index 00000000..2ae6ae81 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GenomeMapsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GenomeMap; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GenomeMapsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GenomeMapsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public GenomeMapsResponseResult data(List data) { + this.data = data; + return this; + } + + public GenomeMapsResponseResult addDataItem(GenomeMap dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenomeMapsResponseResult genomeMapsResponseResult = (GenomeMapsResponseResult) o; + return Objects.equals(this.data, genomeMapsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenomeMapsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GeoJSON.java b/brapi-client/src/main/resources/swagger-generated-client/model/GeoJSON.java new file mode 100755 index 00000000..d6fbffa5 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GeoJSON.java @@ -0,0 +1,155 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.OneOfGeoJSONGeometry; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * One geometry as defined by GeoJSON (RFC 7946). All coordinates are decimal values on the WGS84 geographic coordinate reference system. + */ +@Schema(description = "One geometry as defined by GeoJSON (RFC 7946). All coordinates are decimal values on the WGS84 geographic coordinate reference system.") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GeoJSON { + @SerializedName("geometry") + private OneOfGeoJSONGeometry geometry = null; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + FEATURE("Feature"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("type") + private TypeEnum type = null; + + public GeoJSON geometry(OneOfGeoJSONGeometry geometry) { + this.geometry = geometry; + return this; + } + + /** + * Get geometry + * @return geometry + **/ + @Schema(description = "") + public OneOfGeoJSONGeometry getGeometry() { + return geometry; + } + + public void setGeometry(OneOfGeoJSONGeometry geometry) { + this.geometry = geometry; + } + + public GeoJSON type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeoJSON geoJSON = (GeoJSON) o; + return Objects.equals(this.geometry, geoJSON.geometry) && + Objects.equals(this.type, geoJSON.type); + } + + @Override + public int hashCode() { + return Objects.hash(geometry, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeoJSON {\n"); + + sb.append(" geometry: ").append(toIndentedString(geometry)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Germplasm.java b/brapi-client/src/main/resources/swagger-generated-client/model/Germplasm.java new file mode 100755 index 00000000..464b1f1a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Germplasm.java @@ -0,0 +1,699 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmDonors; +import io.swagger.client.model.TaxonID; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.LocalDate; +/** + * Germplasm + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Germplasm { + @SerializedName("accessionNumber") + private String accessionNumber = null; + + @SerializedName("acquisitionDate") + private LocalDate acquisitionDate = null; + + @SerializedName("biologicalStatusOfAccessionCode") + private Integer biologicalStatusOfAccessionCode = null; + + @SerializedName("breedingMethodDbId") + private String breedingMethodDbId = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("countryOfOriginCode") + private String countryOfOriginCode = null; + + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("donors") + private List donors = null; + + @SerializedName("genus") + private String genus = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmGenus") + private String germplasmGenus = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("germplasmPUI") + private String germplasmPUI = null; + + @SerializedName("germplasmSpecies") + private String germplasmSpecies = null; + + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + @SerializedName("pedigree") + private String pedigree = null; + + @SerializedName("seedSource") + private String seedSource = null; + + @SerializedName("species") + private String species = null; + + @SerializedName("speciesAuthority") + private String speciesAuthority = null; + + @SerializedName("subtaxa") + private String subtaxa = null; + + @SerializedName("subtaxaAuthority") + private String subtaxaAuthority = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("taxonIds") + private List taxonIds = null; + + @SerializedName("typeOfGermplasmStorageCode") + private List typeOfGermplasmStorageCode = null; + + public Germplasm accessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + return this; + } + + /** + * This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection + * @return accessionNumber + **/ + @Schema(description = "This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection") + public String getAccessionNumber() { + return accessionNumber; + } + + public void setAccessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + } + + public Germplasm acquisitionDate(LocalDate acquisitionDate) { + this.acquisitionDate = acquisitionDate; + return this; + } + + /** + * The date this germplasm was aquired by the genebank (MCPD) + * @return acquisitionDate + **/ + @Schema(description = "The date this germplasm was aquired by the genebank (MCPD)") + public LocalDate getAcquisitionDate() { + return acquisitionDate; + } + + public void setAcquisitionDate(LocalDate acquisitionDate) { + this.acquisitionDate = acquisitionDate; + } + + public Germplasm biologicalStatusOfAccessionCode(Integer biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + return this; + } + + /** + * The 3 digit code representing the biological status of the accession (MCPD) + * @return biologicalStatusOfAccessionCode + **/ + @Schema(description = "The 3 digit code representing the biological status of the accession (MCPD)") + public Integer getBiologicalStatusOfAccessionCode() { + return biologicalStatusOfAccessionCode; + } + + public void setBiologicalStatusOfAccessionCode(Integer biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + } + + public Germplasm breedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + return this; + } + + /** + * The unique identifier for the breeding method used to create this germplasm + * @return breedingMethodDbId + **/ + @Schema(description = "The unique identifier for the breeding method used to create this germplasm") + public String getBreedingMethodDbId() { + return breedingMethodDbId; + } + + public void setBreedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + } + + public Germplasm commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop (MCPD) + * @return commonCropName + **/ + @Schema(description = "Common name for the crop (MCPD)") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public Germplasm countryOfOriginCode(String countryOfOriginCode) { + this.countryOfOriginCode = countryOfOriginCode; + return this; + } + + /** + * 3-letter ISO 3166-1 code of the country in which the sample was originally collected (MCPD) + * @return countryOfOriginCode + **/ + @Schema(description = "3-letter ISO 3166-1 code of the country in which the sample was originally collected (MCPD)") + public String getCountryOfOriginCode() { + return countryOfOriginCode; + } + + public void setCountryOfOriginCode(String countryOfOriginCode) { + this.countryOfOriginCode = countryOfOriginCode; + } + + public Germplasm defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * Human readable name used for display purposes + * @return defaultDisplayName + **/ + @Schema(description = "Human readable name used for display purposes") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public Germplasm documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Germplasm donors(List donors) { + this.donors = donors; + return this; + } + + public Germplasm addDonorsItem(GermplasmDonors donorsItem) { + if (this.donors == null) { + this.donors = new ArrayList(); + } + this.donors.add(donorsItem); + return this; + } + + /** + * List of donor institutes (MCPD) + * @return donors + **/ + @Schema(description = "List of donor institutes (MCPD)") + public List getDonors() { + return donors; + } + + public void setDonors(List donors) { + this.donors = donors; + } + + public Germplasm genus(String genus) { + this.genus = genus; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"germplasmGenus\" + * @return genus + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"germplasmGenus\"") + public String getGenus() { + return genus; + } + + public void setGenus(String genus) { + this.genus = genus; + } + + public Germplasm germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm within the given database server + * @return germplasmDbId + **/ + @Schema(description = "The ID which uniquely identifies a germplasm within the given database server") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public Germplasm germplasmGenus(String germplasmGenus) { + this.germplasmGenus = germplasmGenus; + return this; + } + + /** + * Genus name for taxon. Initial uppercase letter required. (MCPD) + * @return germplasmGenus + **/ + @Schema(description = "Genus name for taxon. Initial uppercase letter required. (MCPD)") + public String getGermplasmGenus() { + return germplasmGenus; + } + + public void setGermplasmGenus(String germplasmGenus) { + this.germplasmGenus = germplasmGenus; + } + + public Germplasm germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public Germplasm germplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + return this; + } + + /** + * The Permanent Unique Identifier which represents a germplasm + * @return germplasmPUI + **/ + @Schema(description = "The Permanent Unique Identifier which represents a germplasm") + public String getGermplasmPUI() { + return germplasmPUI; + } + + public void setGermplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + } + + public Germplasm germplasmSpecies(String germplasmSpecies) { + this.germplasmSpecies = germplasmSpecies; + return this; + } + + /** + * Specific epithet portion of the scientific name in lowercase letters. (MCPD) + * @return germplasmSpecies + **/ + @Schema(description = "Specific epithet portion of the scientific name in lowercase letters. (MCPD)") + public String getGermplasmSpecies() { + return germplasmSpecies; + } + + public void setGermplasmSpecies(String germplasmSpecies) { + this.germplasmSpecies = germplasmSpecies; + } + + public Germplasm instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * The code for the Institute that has bred the material. (MCPD) + * @return instituteCode + **/ + @Schema(description = "The code for the Institute that has bred the material. (MCPD)") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public Germplasm instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * The name of the institution which bred the material (MCPD) + * @return instituteName + **/ + @Schema(description = "The name of the institution which bred the material (MCPD)") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + public Germplasm pedigree(String pedigree) { + this.pedigree = pedigree; + return this; + } + + /** + * The cross name and optional selection history. + * @return pedigree + **/ + @Schema(description = "The cross name and optional selection history.") + public String getPedigree() { + return pedigree; + } + + public void setPedigree(String pedigree) { + this.pedigree = pedigree; + } + + public Germplasm seedSource(String seedSource) { + this.seedSource = seedSource; + return this; + } + + /** + * The source of the seed + * @return seedSource + **/ + @Schema(description = "The source of the seed ") + public String getSeedSource() { + return seedSource; + } + + public void setSeedSource(String seedSource) { + this.seedSource = seedSource; + } + + public Germplasm species(String species) { + this.species = species; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"germplasmSpecies\" + * @return species + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"germplasmSpecies\"") + public String getSpecies() { + return species; + } + + public void setSpecies(String species) { + this.species = species; + } + + public Germplasm speciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + return this; + } + + /** + * The authority organization responsible for tracking and maintaining the species name (MCPD) + * @return speciesAuthority + **/ + @Schema(description = "The authority organization responsible for tracking and maintaining the species name (MCPD)") + public String getSpeciesAuthority() { + return speciesAuthority; + } + + public void setSpeciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + } + + public Germplasm subtaxa(String subtaxa) { + this.subtaxa = subtaxa; + return this; + } + + /** + * Subtaxon can be used to store any additional taxonomic identifier. (MCPD) + * @return subtaxa + **/ + @Schema(description = "Subtaxon can be used to store any additional taxonomic identifier. (MCPD)") + public String getSubtaxa() { + return subtaxa; + } + + public void setSubtaxa(String subtaxa) { + this.subtaxa = subtaxa; + } + + public Germplasm subtaxaAuthority(String subtaxaAuthority) { + this.subtaxaAuthority = subtaxaAuthority; + return this; + } + + /** + * The authority organization responsible for tracking and maintaining the subtaxon information (MCPD) + * @return subtaxaAuthority + **/ + @Schema(description = " The authority organization responsible for tracking and maintaining the subtaxon information (MCPD)") + public String getSubtaxaAuthority() { + return subtaxaAuthority; + } + + public void setSubtaxaAuthority(String subtaxaAuthority) { + this.subtaxaAuthority = subtaxaAuthority; + } + + public Germplasm synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public Germplasm addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * List of alternative names or IDs used to reference this germplasm + * @return synonyms + **/ + @Schema(description = "List of alternative names or IDs used to reference this germplasm") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public Germplasm taxonIds(List taxonIds) { + this.taxonIds = taxonIds; + return this; + } + + public Germplasm addTaxonIdsItem(TaxonID taxonIdsItem) { + if (this.taxonIds == null) { + this.taxonIds = new ArrayList(); + } + this.taxonIds.add(taxonIdsItem); + return this; + } + + /** + * The list of IDs for this SPECIES from different sources. If present, NCBI Taxon should be always listed as \"ncbiTaxon\" preferably with a purl. The rank of this ID should be species. + * @return taxonIds + **/ + @Schema(description = "The list of IDs for this SPECIES from different sources. If present, NCBI Taxon should be always listed as \"ncbiTaxon\" preferably with a purl. The rank of this ID should be species.") + public List getTaxonIds() { + return taxonIds; + } + + public void setTaxonIds(List taxonIds) { + this.taxonIds = taxonIds; + } + + public Germplasm typeOfGermplasmStorageCode(List typeOfGermplasmStorageCode) { + this.typeOfGermplasmStorageCode = typeOfGermplasmStorageCode; + return this; + } + + public Germplasm addTypeOfGermplasmStorageCodeItem(String typeOfGermplasmStorageCodeItem) { + if (this.typeOfGermplasmStorageCode == null) { + this.typeOfGermplasmStorageCode = new ArrayList(); + } + this.typeOfGermplasmStorageCode.add(typeOfGermplasmStorageCodeItem); + return this; + } + + /** + * The 2 digit code representing the type of storage this germplasm is kept in at a genebank. (MCPD) + * @return typeOfGermplasmStorageCode + **/ + @Schema(description = "The 2 digit code representing the type of storage this germplasm is kept in at a genebank. (MCPD)") + public List getTypeOfGermplasmStorageCode() { + return typeOfGermplasmStorageCode; + } + + public void setTypeOfGermplasmStorageCode(List typeOfGermplasmStorageCode) { + this.typeOfGermplasmStorageCode = typeOfGermplasmStorageCode; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Germplasm germplasm = (Germplasm) o; + return Objects.equals(this.accessionNumber, germplasm.accessionNumber) && + Objects.equals(this.acquisitionDate, germplasm.acquisitionDate) && + Objects.equals(this.biologicalStatusOfAccessionCode, germplasm.biologicalStatusOfAccessionCode) && + Objects.equals(this.breedingMethodDbId, germplasm.breedingMethodDbId) && + Objects.equals(this.commonCropName, germplasm.commonCropName) && + Objects.equals(this.countryOfOriginCode, germplasm.countryOfOriginCode) && + Objects.equals(this.defaultDisplayName, germplasm.defaultDisplayName) && + Objects.equals(this.documentationURL, germplasm.documentationURL) && + Objects.equals(this.donors, germplasm.donors) && + Objects.equals(this.genus, germplasm.genus) && + Objects.equals(this.germplasmDbId, germplasm.germplasmDbId) && + Objects.equals(this.germplasmGenus, germplasm.germplasmGenus) && + Objects.equals(this.germplasmName, germplasm.germplasmName) && + Objects.equals(this.germplasmPUI, germplasm.germplasmPUI) && + Objects.equals(this.germplasmSpecies, germplasm.germplasmSpecies) && + Objects.equals(this.instituteCode, germplasm.instituteCode) && + Objects.equals(this.instituteName, germplasm.instituteName) && + Objects.equals(this.pedigree, germplasm.pedigree) && + Objects.equals(this.seedSource, germplasm.seedSource) && + Objects.equals(this.species, germplasm.species) && + Objects.equals(this.speciesAuthority, germplasm.speciesAuthority) && + Objects.equals(this.subtaxa, germplasm.subtaxa) && + Objects.equals(this.subtaxaAuthority, germplasm.subtaxaAuthority) && + Objects.equals(this.synonyms, germplasm.synonyms) && + Objects.equals(this.taxonIds, germplasm.taxonIds) && + Objects.equals(this.typeOfGermplasmStorageCode, germplasm.typeOfGermplasmStorageCode); + } + + @Override + public int hashCode() { + return Objects.hash(accessionNumber, acquisitionDate, biologicalStatusOfAccessionCode, breedingMethodDbId, commonCropName, countryOfOriginCode, defaultDisplayName, documentationURL, donors, genus, germplasmDbId, germplasmGenus, germplasmName, germplasmPUI, germplasmSpecies, instituteCode, instituteName, pedigree, seedSource, species, speciesAuthority, subtaxa, subtaxaAuthority, synonyms, taxonIds, typeOfGermplasmStorageCode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Germplasm {\n"); + + sb.append(" accessionNumber: ").append(toIndentedString(accessionNumber)).append("\n"); + sb.append(" acquisitionDate: ").append(toIndentedString(acquisitionDate)).append("\n"); + sb.append(" biologicalStatusOfAccessionCode: ").append(toIndentedString(biologicalStatusOfAccessionCode)).append("\n"); + sb.append(" breedingMethodDbId: ").append(toIndentedString(breedingMethodDbId)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" countryOfOriginCode: ").append(toIndentedString(countryOfOriginCode)).append("\n"); + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" donors: ").append(toIndentedString(donors)).append("\n"); + sb.append(" genus: ").append(toIndentedString(genus)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmGenus: ").append(toIndentedString(germplasmGenus)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" germplasmPUI: ").append(toIndentedString(germplasmPUI)).append("\n"); + sb.append(" germplasmSpecies: ").append(toIndentedString(germplasmSpecies)).append("\n"); + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).append("\n"); + sb.append(" pedigree: ").append(toIndentedString(pedigree)).append("\n"); + sb.append(" seedSource: ").append(toIndentedString(seedSource)).append("\n"); + sb.append(" species: ").append(toIndentedString(species)).append("\n"); + sb.append(" speciesAuthority: ").append(toIndentedString(speciesAuthority)).append("\n"); + sb.append(" subtaxa: ").append(toIndentedString(subtaxa)).append("\n"); + sb.append(" subtaxaAuthority: ").append(toIndentedString(subtaxaAuthority)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" taxonIds: ").append(toIndentedString(taxonIds)).append("\n"); + sb.append(" typeOfGermplasmStorageCode: ").append(toIndentedString(typeOfGermplasmStorageCode)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttribute.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttribute.java new file mode 100755 index 00000000..b18854a3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttribute.java @@ -0,0 +1,179 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.LocalDate; +/** + * GermplasmAttribute + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttribute { + @SerializedName("attributeCode") + private String attributeCode = null; + + @SerializedName("attributeDbId") + private String attributeDbId = null; + + @SerializedName("attributeName") + private String attributeName = null; + + @SerializedName("determinedDate") + private LocalDate determinedDate = null; + + @SerializedName("value") + private String value = null; + + public GermplasmAttribute attributeCode(String attributeCode) { + this.attributeCode = attributeCode; + return this; + } + + /** + * Short abbreviation which represents this attribute + * @return attributeCode + **/ + @Schema(description = "Short abbreviation which represents this attribute") + public String getAttributeCode() { + return attributeCode; + } + + public void setAttributeCode(String attributeCode) { + this.attributeCode = attributeCode; + } + + public GermplasmAttribute attributeDbId(String attributeDbId) { + this.attributeDbId = attributeDbId; + return this; + } + + /** + * The ID which uniquely identifies this attribute within the given database server + * @return attributeDbId + **/ + @Schema(description = "The ID which uniquely identifies this attribute within the given database server") + public String getAttributeDbId() { + return attributeDbId; + } + + public void setAttributeDbId(String attributeDbId) { + this.attributeDbId = attributeDbId; + } + + public GermplasmAttribute attributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * The human readable name of this attribute + * @return attributeName + **/ + @Schema(description = "The human readable name of this attribute") + public String getAttributeName() { + return attributeName; + } + + public void setAttributeName(String attributeName) { + this.attributeName = attributeName; + } + + public GermplasmAttribute determinedDate(LocalDate determinedDate) { + this.determinedDate = determinedDate; + return this; + } + + /** + * The date the value of this attribute was determined for a given germplasm + * @return determinedDate + **/ + @Schema(description = "The date the value of this attribute was determined for a given germplasm") + public LocalDate getDeterminedDate() { + return determinedDate; + } + + public void setDeterminedDate(LocalDate determinedDate) { + this.determinedDate = determinedDate; + } + + public GermplasmAttribute value(String value) { + this.value = value; + return this; + } + + /** + * The value of this attribute for a given germplasm + * @return value + **/ + @Schema(description = "The value of this attribute for a given germplasm") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttribute germplasmAttribute = (GermplasmAttribute) o; + return Objects.equals(this.attributeCode, germplasmAttribute.attributeCode) && + Objects.equals(this.attributeDbId, germplasmAttribute.attributeDbId) && + Objects.equals(this.attributeName, germplasmAttribute.attributeName) && + Objects.equals(this.determinedDate, germplasmAttribute.determinedDate) && + Objects.equals(this.value, germplasmAttribute.value); + } + + @Override + public int hashCode() { + return Objects.hash(attributeCode, attributeDbId, attributeName, determinedDate, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttribute {\n"); + + sb.append(" attributeCode: ").append(toIndentedString(attributeCode)).append("\n"); + sb.append(" attributeDbId: ").append(toIndentedString(attributeDbId)).append("\n"); + sb.append(" attributeName: ").append(toIndentedString(attributeName)).append("\n"); + sb.append(" determinedDate: ").append(toIndentedString(determinedDate)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponse.java new file mode 100755 index 00000000..60756f56 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttributeCategoriesResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmAttributeCategoriesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeCategoriesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmAttributeCategoriesResponseResult result = null; + + public GermplasmAttributeCategoriesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmAttributeCategoriesResponse result(GermplasmAttributeCategoriesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmAttributeCategoriesResponseResult getResult() { + return result; + } + + public void setResult(GermplasmAttributeCategoriesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeCategoriesResponse germplasmAttributeCategoriesResponse = (GermplasmAttributeCategoriesResponse) o; + return Objects.equals(this.metadata, germplasmAttributeCategoriesResponse.metadata) && + Objects.equals(this.result, germplasmAttributeCategoriesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeCategoriesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponseResult.java new file mode 100755 index 00000000..59d7e8bd --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategoriesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttributeCategory; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmAttributeCategoriesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeCategoriesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public GermplasmAttributeCategoriesResponseResult data(List data) { + this.data = data; + return this; + } + + public GermplasmAttributeCategoriesResponseResult addDataItem(GermplasmAttributeCategory dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeCategoriesResponseResult germplasmAttributeCategoriesResponseResult = (GermplasmAttributeCategoriesResponseResult) o; + return Objects.equals(this.data, germplasmAttributeCategoriesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeCategoriesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategory.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategory.java new file mode 100755 index 00000000..7ee028c8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeCategory.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmAttributeCategory + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeCategory { + @SerializedName("attributeCategoryDbId") + private String attributeCategoryDbId = null; + + @SerializedName("attributeCategoryName") + private String attributeCategoryName = null; + + @SerializedName("name") + private String name = null; + + public GermplasmAttributeCategory attributeCategoryDbId(String attributeCategoryDbId) { + this.attributeCategoryDbId = attributeCategoryDbId; + return this; + } + + /** + * The ID which uniquely identifies this attribute category within the given database server + * @return attributeCategoryDbId + **/ + @Schema(description = "The ID which uniquely identifies this attribute category within the given database server") + public String getAttributeCategoryDbId() { + return attributeCategoryDbId; + } + + public void setAttributeCategoryDbId(String attributeCategoryDbId) { + this.attributeCategoryDbId = attributeCategoryDbId; + } + + public GermplasmAttributeCategory attributeCategoryName(String attributeCategoryName) { + this.attributeCategoryName = attributeCategoryName; + return this; + } + + /** + * A human readable name for this attribute category. Very similar to Trait class. (examples: \"morphologic\", \"phenologic\", \"agronomic\", \"physiologic\", \"abiotic stress\", \"biotic stress\", \"biochemic\", \"quality traits\", \"fertility\", etc.) + * @return attributeCategoryName + **/ + @Schema(description = "A human readable name for this attribute category. Very similar to Trait class. (examples: \"morphologic\", \"phenologic\", \"agronomic\", \"physiologic\", \"abiotic stress\", \"biotic stress\", \"biochemic\", \"quality traits\", \"fertility\", etc.)") + public String getAttributeCategoryName() { + return attributeCategoryName; + } + + public void setAttributeCategoryName(String attributeCategoryName) { + this.attributeCategoryName = attributeCategoryName; + } + + public GermplasmAttributeCategory name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"attributeCategoryName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"attributeCategoryName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeCategory germplasmAttributeCategory = (GermplasmAttributeCategory) o; + return Objects.equals(this.attributeCategoryDbId, germplasmAttributeCategory.attributeCategoryDbId) && + Objects.equals(this.attributeCategoryName, germplasmAttributeCategory.attributeCategoryName) && + Objects.equals(this.name, germplasmAttributeCategory.name); + } + + @Override + public int hashCode() { + return Objects.hash(attributeCategoryDbId, attributeCategoryName, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeCategory {\n"); + + sb.append(" attributeCategoryDbId: ").append(toIndentedString(attributeCategoryDbId)).append("\n"); + sb.append(" attributeCategoryName: ").append(toIndentedString(attributeCategoryName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDef.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDef.java new file mode 100755 index 00000000..9dcdb344 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDef.java @@ -0,0 +1,277 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Method; +import io.swagger.client.model.OntologyReference; +import io.swagger.client.model.Scale; +import io.swagger.client.model.Trait; +import io.swagger.client.model.VariableBaseClass; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * GermplasmAttributeDef + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeDef extends VariableBaseClass { + @SerializedName("attributeCategoryDbId") + private String attributeCategoryDbId = null; + + @SerializedName("attributeDbId") + private String attributeDbId = null; + + @SerializedName("attributeName") + private String attributeName = null; + + @SerializedName("code") + private String code = null; + + @SerializedName("datatype") + private String datatype = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("uri") + private String uri = null; + + @SerializedName("values") + private String values = null; + + public GermplasmAttributeDef attributeCategoryDbId(String attributeCategoryDbId) { + this.attributeCategoryDbId = attributeCategoryDbId; + return this; + } + + /** + * General category for the attribute. very similar to Trait class. + * @return attributeCategoryDbId + **/ + @Schema(description = "General category for the attribute. very similar to Trait class.") + public String getAttributeCategoryDbId() { + return attributeCategoryDbId; + } + + public void setAttributeCategoryDbId(String attributeCategoryDbId) { + this.attributeCategoryDbId = attributeCategoryDbId; + } + + public GermplasmAttributeDef attributeDbId(String attributeDbId) { + this.attributeDbId = attributeDbId; + return this; + } + + /** + * The ID which uniquely identifies this attribute within the given database server + * @return attributeDbId + **/ + @Schema(required = true, description = "The ID which uniquely identifies this attribute within the given database server") + public String getAttributeDbId() { + return attributeDbId; + } + + public void setAttributeDbId(String attributeDbId) { + this.attributeDbId = attributeDbId; + } + + public GermplasmAttributeDef attributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * A human readable name for this attribute + * @return attributeName + **/ + @Schema(required = true, description = "A human readable name for this attribute") + public String getAttributeName() { + return attributeName; + } + + public void setAttributeName(String attributeName) { + this.attributeName = attributeName; + } + + public GermplasmAttributeDef code(String code) { + this.code = code; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.trait.alternativeAbbreviations\" + * @return code + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.trait.alternativeAbbreviations\"") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public GermplasmAttributeDef datatype(String datatype) { + this.datatype = datatype; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.scale.dataType\" + * @return datatype + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.scale.dataType\"") + public String getDatatype() { + return datatype; + } + + public void setDatatype(String datatype) { + this.datatype = datatype; + } + + public GermplasmAttributeDef description(String description) { + this.description = description; + return this; + } + + /** + * A human readable description of this attribute + * @return description + **/ + @Schema(description = "A human readable description of this attribute") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public GermplasmAttributeDef name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"this.attributeName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"this.attributeName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GermplasmAttributeDef uri(String uri) { + this.uri = uri; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.xref\" + * @return uri + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.xref\"") + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public GermplasmAttributeDef values(String values) { + this.values = values; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.scale.validValues\" + * @return values + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.scale.validValues\"") + public String getValues() { + return values; + } + + public void setValues(String values) { + this.values = values; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeDef germplasmAttributeDef = (GermplasmAttributeDef) o; + return Objects.equals(this.attributeCategoryDbId, germplasmAttributeDef.attributeCategoryDbId) && + Objects.equals(this.attributeDbId, germplasmAttributeDef.attributeDbId) && + Objects.equals(this.attributeName, germplasmAttributeDef.attributeName) && + Objects.equals(this.code, germplasmAttributeDef.code) && + Objects.equals(this.datatype, germplasmAttributeDef.datatype) && + Objects.equals(this.description, germplasmAttributeDef.description) && + Objects.equals(this.name, germplasmAttributeDef.name) && + Objects.equals(this.uri, germplasmAttributeDef.uri) && + Objects.equals(this.values, germplasmAttributeDef.values) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(attributeCategoryDbId, attributeDbId, attributeName, code, datatype, description, name, uri, values, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeDef {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" attributeCategoryDbId: ").append(toIndentedString(attributeCategoryDbId)).append("\n"); + sb.append(" attributeDbId: ").append(toIndentedString(attributeDbId)).append("\n"); + sb.append(" attributeName: ").append(toIndentedString(attributeName)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" datatype: ").append(toIndentedString(datatype)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponse.java new file mode 100755 index 00000000..a69b7632 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttributeDefsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmAttributeDefsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeDefsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmAttributeDefsResponseResult result = null; + + public GermplasmAttributeDefsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmAttributeDefsResponse result(GermplasmAttributeDefsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmAttributeDefsResponseResult getResult() { + return result; + } + + public void setResult(GermplasmAttributeDefsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeDefsResponse germplasmAttributeDefsResponse = (GermplasmAttributeDefsResponse) o; + return Objects.equals(this.metadata, germplasmAttributeDefsResponse.metadata) && + Objects.equals(this.result, germplasmAttributeDefsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeDefsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponseResult.java new file mode 100755 index 00000000..89be62c8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeDefsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttributeDef; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmAttributeDefsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeDefsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public GermplasmAttributeDefsResponseResult data(List data) { + this.data = data; + return this; + } + + public GermplasmAttributeDefsResponseResult addDataItem(GermplasmAttributeDef dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeDefsResponseResult germplasmAttributeDefsResponseResult = (GermplasmAttributeDefsResponseResult) o; + return Objects.equals(this.data, germplasmAttributeDefsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeDefsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeList.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeList.java new file mode 100755 index 00000000..8aa03e26 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeList.java @@ -0,0 +1,121 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttribute; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmAttributeList + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeList { + @SerializedName("data") + private List data = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + public GermplasmAttributeList data(List data) { + this.data = data; + return this; + } + + public GermplasmAttributeList addDataItem(GermplasmAttribute dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of attributes associated with the given germplasm + * @return data + **/ + @Schema(description = "List of attributes associated with the given germplasm") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public GermplasmAttributeList germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm within the given database server + * @return germplasmDbId + **/ + @Schema(description = "The ID which uniquely identifies a germplasm within the given database server") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeList germplasmAttributeList = (GermplasmAttributeList) o; + return Objects.equals(this.data, germplasmAttributeList.data) && + Objects.equals(this.germplasmDbId, germplasmAttributeList.germplasmDbId); + } + + @Override + public int hashCode() { + return Objects.hash(data, germplasmDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeList {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeListResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeListResponse.java new file mode 100755 index 00000000..bb32d74e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmAttributeListResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmAttributeList; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmAttributeListResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmAttributeListResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmAttributeList result = null; + + public GermplasmAttributeListResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmAttributeListResponse result(GermplasmAttributeList result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmAttributeList getResult() { + return result; + } + + public void setResult(GermplasmAttributeList result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmAttributeListResponse germplasmAttributeListResponse = (GermplasmAttributeListResponse) o; + return Objects.equals(this.metadata, germplasmAttributeListResponse.metadata) && + Objects.equals(this.result, germplasmAttributeListResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmAttributeListResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmDonors.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmDonors.java new file mode 100755 index 00000000..fa3c9b66 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmDonors.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmDonors + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmDonors { + @SerializedName("donorAccessionNumber") + private String donorAccessionNumber = null; + + @SerializedName("donorInstituteCode") + private String donorInstituteCode = null; + + @SerializedName("germplasmPUI") + private String germplasmPUI = null; + + public GermplasmDonors donorAccessionNumber(String donorAccessionNumber) { + this.donorAccessionNumber = donorAccessionNumber; + return this; + } + + /** + * Get donorAccessionNumber + * @return donorAccessionNumber + **/ + @Schema(description = "") + public String getDonorAccessionNumber() { + return donorAccessionNumber; + } + + public void setDonorAccessionNumber(String donorAccessionNumber) { + this.donorAccessionNumber = donorAccessionNumber; + } + + public GermplasmDonors donorInstituteCode(String donorInstituteCode) { + this.donorInstituteCode = donorInstituteCode; + return this; + } + + /** + * Get donorInstituteCode + * @return donorInstituteCode + **/ + @Schema(description = "") + public String getDonorInstituteCode() { + return donorInstituteCode; + } + + public void setDonorInstituteCode(String donorInstituteCode) { + this.donorInstituteCode = donorInstituteCode; + } + + public GermplasmDonors germplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + return this; + } + + /** + * Get germplasmPUI + * @return germplasmPUI + **/ + @Schema(description = "") + public String getGermplasmPUI() { + return germplasmPUI; + } + + public void setGermplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmDonors germplasmDonors = (GermplasmDonors) o; + return Objects.equals(this.donorAccessionNumber, germplasmDonors.donorAccessionNumber) && + Objects.equals(this.donorInstituteCode, germplasmDonors.donorInstituteCode) && + Objects.equals(this.germplasmPUI, germplasmDonors.germplasmPUI); + } + + @Override + public int hashCode() { + return Objects.hash(donorAccessionNumber, donorInstituteCode, germplasmPUI); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmDonors {\n"); + + sb.append(" donorAccessionNumber: ").append(toIndentedString(donorAccessionNumber)).append("\n"); + sb.append(" donorInstituteCode: ").append(toIndentedString(donorInstituteCode)).append("\n"); + sb.append(" germplasmPUI: ").append(toIndentedString(germplasmPUI)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPD.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPD.java new file mode 100755 index 00000000..dc2e90b3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPD.java @@ -0,0 +1,878 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.GermplasmMCPDBreedingInstitutes; +import io.swagger.client.model.GermplasmMCPDCollectingInfo; +import io.swagger.client.model.GermplasmMCPDDonorInfo; +import io.swagger.client.model.GermplasmMCPDSafetyDuplicateInstitues; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmMCPD + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPD { + @SerializedName("accessionNames") + private List accessionNames = null; + + @SerializedName("accessionNumber") + private String accessionNumber = null; + + @SerializedName("acquisitionDate") + private String acquisitionDate = null; + + /** + * MCPD (v2.1) (COLLSRC) 21. The coding scheme proposed can be used at 2 different levels of detail: either by using the general codes (in boldface) such as 10, 20, 30, 40, etc., or by using the more specific codes, such as 11, 12, etc. 10) Wild habitat 11) Forest or woodland 12) Shrubland 13) Grassland 14) Desert or tundra 15) Aquatic habitat 20) Farm or cultivated habitat 21) Field 22) Orchard 23) Backyard, kitchen or home garden (urban, peri-urban or rural) 24) Fallow land 25) Pasture 26) Farm store 27) Threshing floor 28) Park 30) Market or shop 40) Institute, Experimental station, Research organization, Genebank 50) Seed company 60) Weedy, disturbed or ruderal habitat 61) Roadside 62) Field margin 99) Other (Elaborate in REMARKS field) + */ + @JsonAdapter(AcquisitionSourceCodeEnum.Adapter.class) + public enum AcquisitionSourceCodeEnum { + _10("10"), + _11("11"), + _12("12"), + _13("13"), + _14("14"), + _15("15"), + _20("20"), + _21("21"), + _22("22"), + _23("23"), + _24("24"), + _25("25"), + _26("26"), + _27("27"), + _28("28"), + _30("30"), + _40("40"), + _50("50"), + _60("60"), + _61("61"), + _62("62"), + _99("99"); + + private String value; + + AcquisitionSourceCodeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static AcquisitionSourceCodeEnum fromValue(String text) { + for (AcquisitionSourceCodeEnum b : AcquisitionSourceCodeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AcquisitionSourceCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AcquisitionSourceCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AcquisitionSourceCodeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("acquisitionSourceCode") + private AcquisitionSourceCodeEnum acquisitionSourceCode = null; + + @SerializedName("alternateIDs") + private List alternateIDs = null; + + @SerializedName("ancestralData") + private String ancestralData = null; + + /** + * MCPD (v2.1) (SAMPSTAT) 19. The coding scheme proposed can be used at 3 different levels of detail: either by using the general codes (in boldface) such as 100, 200, 300, 400, or by using the more specific codes such as 110, 120, etc. 100) Wild 110) Natural 120) Semi-natural/wild 130) Semi-natural/sown 200) Weedy 300) Traditional cultivar/landrace 400) Breeding/research material 410) Breeders line 411) Synthetic population 412) Hybrid 413) Founder stock/base population 414) Inbred line (parent of hybrid cultivar) 415) Segregating population 416) Clonal selection 420) Genetic stock 421) Mutant (e.g. induced/insertion mutants, tilling populations) 422) Cytogenetic stocks (e.g. chromosome addition/substitution, aneuploids, amphiploids) 423) Other genetic stocks (e.g. mapping populations) 500) Advanced or improved cultivar (conventional breeding methods) 600) GMO (by genetic engineering) 999) Other (Elaborate in REMARKS field) + */ + @JsonAdapter(BiologicalStatusOfAccessionCodeEnum.Adapter.class) + public enum BiologicalStatusOfAccessionCodeEnum { + _100("100"), + _110("110"), + _120("120"), + _130("130"), + _200("200"), + _300("300"), + _400("400"), + _410("410"), + _411("411"), + _412("412"), + _413("413"), + _414("414"), + _415("415"), + _416("416"), + _420("420"), + _421("421"), + _422("422"), + _423("423"), + _500("500"), + _600("600"), + _999("999"); + + private String value; + + BiologicalStatusOfAccessionCodeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static BiologicalStatusOfAccessionCodeEnum fromValue(String text) { + for (BiologicalStatusOfAccessionCodeEnum b : BiologicalStatusOfAccessionCodeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BiologicalStatusOfAccessionCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BiologicalStatusOfAccessionCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BiologicalStatusOfAccessionCodeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("biologicalStatusOfAccessionCode") + private BiologicalStatusOfAccessionCodeEnum biologicalStatusOfAccessionCode = null; + + @SerializedName("breedingInstitutes") + private List breedingInstitutes = null; + + @SerializedName("collectingInfo") + private GermplasmMCPDCollectingInfo collectingInfo = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("countryOfOrigin") + private String countryOfOrigin = null; + + @SerializedName("donorInfo") + private GermplasmMCPDDonorInfo donorInfo = null; + + @SerializedName("genus") + private String genus = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmPUI") + private String germplasmPUI = null; + + @SerializedName("instituteCode") + private String instituteCode = null; + + /** + * MCPD (v2.1) (MLSSTAT) 27. The status of an accession with regards to the Multilateral System (MLS) of the International Treaty on Plant Genetic Resources for Food and Agriculture. Leave the value empty if the status is not known 0 No (not included) 1 Yes (included) 99 Other (elaborate in REMARKS field, e.g. \"under development\") + */ + @JsonAdapter(MlsStatusEnum.Adapter.class) + public enum MlsStatusEnum { + EMPTY(""), + _0("0"), + _1("1"), + _99("99"); + + private String value; + + MlsStatusEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static MlsStatusEnum fromValue(String text) { + for (MlsStatusEnum b : MlsStatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MlsStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MlsStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MlsStatusEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("mlsStatus") + private MlsStatusEnum mlsStatus = null; + + @SerializedName("remarks") + private String remarks = null; + + @SerializedName("safetyDuplicateInstitues") + private List safetyDuplicateInstitues = null; + + @SerializedName("species") + private String species = null; + + @SerializedName("speciesAuthority") + private String speciesAuthority = null; + + /** + * Gets or Sets storageTypeCodes + */ + @JsonAdapter(StorageTypeCodesEnum.Adapter.class) + public enum StorageTypeCodesEnum { + _10("10"), + _11("11"), + _12("12"), + _13("13"), + _20("20"), + _30("30"), + _40("40"), + _50("50"), + _99("99"); + + private String value; + + StorageTypeCodesEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static StorageTypeCodesEnum fromValue(String text) { + for (StorageTypeCodesEnum b : StorageTypeCodesEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StorageTypeCodesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StorageTypeCodesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StorageTypeCodesEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("storageTypeCodes") + private List storageTypeCodes = null; + + @SerializedName("subtaxon") + private String subtaxon = null; + + @SerializedName("subtaxonAuthority") + private String subtaxonAuthority = null; + + public GermplasmMCPD accessionNames(List accessionNames) { + this.accessionNames = accessionNames; + return this; + } + + public GermplasmMCPD addAccessionNamesItem(String accessionNamesItem) { + if (this.accessionNames == null) { + this.accessionNames = new ArrayList(); + } + this.accessionNames.add(accessionNamesItem); + return this; + } + + /** + * MCPD (v2.1) (ACCENAME) 11. Either a registered or other designation given to the material received, other than the donors accession number (23) or collecting number (3). First letter uppercase. Multiple names are separated by a semicolon without space. Example: Accession name: Bogatyr;Symphony;Emma. + * @return accessionNames + **/ + @Schema(description = "MCPD (v2.1) (ACCENAME) 11. Either a registered or other designation given to the material received, other than the donors accession number (23) or collecting number (3). First letter uppercase. Multiple names are separated by a semicolon without space. Example: Accession name: Bogatyr;Symphony;Emma.") + public List getAccessionNames() { + return accessionNames; + } + + public void setAccessionNames(List accessionNames) { + this.accessionNames = accessionNames; + } + + public GermplasmMCPD accessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + return this; + } + + /** + * MCPD (v2.1) (ACCENUMB) 2. This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection (e.g. \"PI 113869\"). + * @return accessionNumber + **/ + @Schema(description = "MCPD (v2.1) (ACCENUMB) 2. This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection (e.g. \"PI 113869\").") + public String getAccessionNumber() { + return accessionNumber; + } + + public void setAccessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + } + + public GermplasmMCPD acquisitionDate(String acquisitionDate) { + this.acquisitionDate = acquisitionDate; + return this; + } + + /** + * MCPD (v2.1) (ACQDATE) 12. Date on which the accession entered the collection [YYYYMMDD] where YYYY is the year, MM is the month and DD is the day. Missing data (MM or DD) should be indicated with hyphens or \"00\" [double zero]. + * @return acquisitionDate + **/ + @Schema(description = "MCPD (v2.1) (ACQDATE) 12. Date on which the accession entered the collection [YYYYMMDD] where YYYY is the year, MM is the month and DD is the day. Missing data (MM or DD) should be indicated with hyphens or \"00\" [double zero].") + public String getAcquisitionDate() { + return acquisitionDate; + } + + public void setAcquisitionDate(String acquisitionDate) { + this.acquisitionDate = acquisitionDate; + } + + public GermplasmMCPD acquisitionSourceCode(AcquisitionSourceCodeEnum acquisitionSourceCode) { + this.acquisitionSourceCode = acquisitionSourceCode; + return this; + } + + /** + * MCPD (v2.1) (COLLSRC) 21. The coding scheme proposed can be used at 2 different levels of detail: either by using the general codes (in boldface) such as 10, 20, 30, 40, etc., or by using the more specific codes, such as 11, 12, etc. 10) Wild habitat 11) Forest or woodland 12) Shrubland 13) Grassland 14) Desert or tundra 15) Aquatic habitat 20) Farm or cultivated habitat 21) Field 22) Orchard 23) Backyard, kitchen or home garden (urban, peri-urban or rural) 24) Fallow land 25) Pasture 26) Farm store 27) Threshing floor 28) Park 30) Market or shop 40) Institute, Experimental station, Research organization, Genebank 50) Seed company 60) Weedy, disturbed or ruderal habitat 61) Roadside 62) Field margin 99) Other (Elaborate in REMARKS field) + * @return acquisitionSourceCode + **/ + @Schema(description = "MCPD (v2.1) (COLLSRC) 21. The coding scheme proposed can be used at 2 different levels of detail: either by using the general codes (in boldface) such as 10, 20, 30, 40, etc., or by using the more specific codes, such as 11, 12, etc. 10) Wild habitat 11) Forest or woodland 12) Shrubland 13) Grassland 14) Desert or tundra 15) Aquatic habitat 20) Farm or cultivated habitat 21) Field 22) Orchard 23) Backyard, kitchen or home garden (urban, peri-urban or rural) 24) Fallow land 25) Pasture 26) Farm store 27) Threshing floor 28) Park 30) Market or shop 40) Institute, Experimental station, Research organization, Genebank 50) Seed company 60) Weedy, disturbed or ruderal habitat 61) Roadside 62) Field margin 99) Other (Elaborate in REMARKS field) ") + public AcquisitionSourceCodeEnum getAcquisitionSourceCode() { + return acquisitionSourceCode; + } + + public void setAcquisitionSourceCode(AcquisitionSourceCodeEnum acquisitionSourceCode) { + this.acquisitionSourceCode = acquisitionSourceCode; + } + + public GermplasmMCPD alternateIDs(List alternateIDs) { + this.alternateIDs = alternateIDs; + return this; + } + + public GermplasmMCPD addAlternateIDsItem(String alternateIDsItem) { + if (this.alternateIDs == null) { + this.alternateIDs = new ArrayList(); + } + this.alternateIDs.add(alternateIDsItem); + return this; + } + + /** + * MCPD (v2.1) (OTHERNUMB) 24. Any other identifiers known to exist in other collections for this accession. Use the following format: INSTCODE:ACCENUMB;INSTCODE:identifier;INSTCODE and identifier are separated by a colon without space. Pairs of INSTCODE and identifier are separated by a semicolon without space. When the institute is not known, the identifier should be preceded by a colon. + * @return alternateIDs + **/ + @Schema(description = "MCPD (v2.1) (OTHERNUMB) 24. Any other identifiers known to exist in other collections for this accession. Use the following format: INSTCODE:ACCENUMB;INSTCODE:identifier;INSTCODE and identifier are separated by a colon without space. Pairs of INSTCODE and identifier are separated by a semicolon without space. When the institute is not known, the identifier should be preceded by a colon. ") + public List getAlternateIDs() { + return alternateIDs; + } + + public void setAlternateIDs(List alternateIDs) { + this.alternateIDs = alternateIDs; + } + + public GermplasmMCPD ancestralData(String ancestralData) { + this.ancestralData = ancestralData; + return this; + } + + /** + * MCPD (v2.1) (ANCEST) 20. Information about either pedigree or other description of ancestral information (e.g. parent variety in case of mutant or selection). For example a pedigree 'Hanna/7*Atlas//Turk/8*Atlas' or a description 'mutation found in Hanna', 'selection from Irene' or 'cross involving amongst others Hanna and Irene'. + * @return ancestralData + **/ + @Schema(description = "MCPD (v2.1) (ANCEST) 20. Information about either pedigree or other description of ancestral information (e.g. parent variety in case of mutant or selection). For example a pedigree 'Hanna/7*Atlas//Turk/8*Atlas' or a description 'mutation found in Hanna', 'selection from Irene' or 'cross involving amongst others Hanna and Irene'.") + public String getAncestralData() { + return ancestralData; + } + + public void setAncestralData(String ancestralData) { + this.ancestralData = ancestralData; + } + + public GermplasmMCPD biologicalStatusOfAccessionCode(BiologicalStatusOfAccessionCodeEnum biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + return this; + } + + /** + * MCPD (v2.1) (SAMPSTAT) 19. The coding scheme proposed can be used at 3 different levels of detail: either by using the general codes (in boldface) such as 100, 200, 300, 400, or by using the more specific codes such as 110, 120, etc. 100) Wild 110) Natural 120) Semi-natural/wild 130) Semi-natural/sown 200) Weedy 300) Traditional cultivar/landrace 400) Breeding/research material 410) Breeders line 411) Synthetic population 412) Hybrid 413) Founder stock/base population 414) Inbred line (parent of hybrid cultivar) 415) Segregating population 416) Clonal selection 420) Genetic stock 421) Mutant (e.g. induced/insertion mutants, tilling populations) 422) Cytogenetic stocks (e.g. chromosome addition/substitution, aneuploids, amphiploids) 423) Other genetic stocks (e.g. mapping populations) 500) Advanced or improved cultivar (conventional breeding methods) 600) GMO (by genetic engineering) 999) Other (Elaborate in REMARKS field) + * @return biologicalStatusOfAccessionCode + **/ + @Schema(description = "MCPD (v2.1) (SAMPSTAT) 19. The coding scheme proposed can be used at 3 different levels of detail: either by using the general codes (in boldface) such as 100, 200, 300, 400, or by using the more specific codes such as 110, 120, etc. 100) Wild 110) Natural 120) Semi-natural/wild 130) Semi-natural/sown 200) Weedy 300) Traditional cultivar/landrace 400) Breeding/research material 410) Breeders line 411) Synthetic population 412) Hybrid 413) Founder stock/base population 414) Inbred line (parent of hybrid cultivar) 415) Segregating population 416) Clonal selection 420) Genetic stock 421) Mutant (e.g. induced/insertion mutants, tilling populations) 422) Cytogenetic stocks (e.g. chromosome addition/substitution, aneuploids, amphiploids) 423) Other genetic stocks (e.g. mapping populations) 500) Advanced or improved cultivar (conventional breeding methods) 600) GMO (by genetic engineering) 999) Other (Elaborate in REMARKS field)") + public BiologicalStatusOfAccessionCodeEnum getBiologicalStatusOfAccessionCode() { + return biologicalStatusOfAccessionCode; + } + + public void setBiologicalStatusOfAccessionCode(BiologicalStatusOfAccessionCodeEnum biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + } + + public GermplasmMCPD breedingInstitutes(List breedingInstitutes) { + this.breedingInstitutes = breedingInstitutes; + return this; + } + + public GermplasmMCPD addBreedingInstitutesItem(GermplasmMCPDBreedingInstitutes breedingInstitutesItem) { + if (this.breedingInstitutes == null) { + this.breedingInstitutes = new ArrayList(); + } + this.breedingInstitutes.add(breedingInstitutesItem); + return this; + } + + /** + * Get breedingInstitutes + * @return breedingInstitutes + **/ + @Schema(description = "") + public List getBreedingInstitutes() { + return breedingInstitutes; + } + + public void setBreedingInstitutes(List breedingInstitutes) { + this.breedingInstitutes = breedingInstitutes; + } + + public GermplasmMCPD collectingInfo(GermplasmMCPDCollectingInfo collectingInfo) { + this.collectingInfo = collectingInfo; + return this; + } + + /** + * Get collectingInfo + * @return collectingInfo + **/ + @Schema(description = "") + public GermplasmMCPDCollectingInfo getCollectingInfo() { + return collectingInfo; + } + + public void setCollectingInfo(GermplasmMCPDCollectingInfo collectingInfo) { + this.collectingInfo = collectingInfo; + } + + public GermplasmMCPD commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * MCPD (v2.1) (CROPNAME) 10. Common name of the crop. Example: \"malting barley\", \"macadamia\", \"mas\". + * @return commonCropName + **/ + @Schema(description = "MCPD (v2.1) (CROPNAME) 10. Common name of the crop. Example: \"malting barley\", \"macadamia\", \"mas\". ") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public GermplasmMCPD countryOfOrigin(String countryOfOrigin) { + this.countryOfOrigin = countryOfOrigin; + return this; + } + + /** + * MCPD (v2.1) (ORIGCTY) 13. 3-letter ISO 3166-1 code of the country in which the sample was originally collected (e.g. landrace, crop wild relative, farmers\" variety), bred or selected (breeding lines, GMOs, segregating populations, hybrids, modern cultivars, etc.). Note: Descriptors 14 to 16 below should be completed accordingly only if it was \"collected\". + * @return countryOfOrigin + **/ + @Schema(description = "MCPD (v2.1) (ORIGCTY) 13. 3-letter ISO 3166-1 code of the country in which the sample was originally collected (e.g. landrace, crop wild relative, farmers\" variety), bred or selected (breeding lines, GMOs, segregating populations, hybrids, modern cultivars, etc.). Note: Descriptors 14 to 16 below should be completed accordingly only if it was \"collected\".") + public String getCountryOfOrigin() { + return countryOfOrigin; + } + + public void setCountryOfOrigin(String countryOfOrigin) { + this.countryOfOrigin = countryOfOrigin; + } + + public GermplasmMCPD donorInfo(GermplasmMCPDDonorInfo donorInfo) { + this.donorInfo = donorInfo; + return this; + } + + /** + * Get donorInfo + * @return donorInfo + **/ + @Schema(description = "") + public GermplasmMCPDDonorInfo getDonorInfo() { + return donorInfo; + } + + public void setDonorInfo(GermplasmMCPDDonorInfo donorInfo) { + this.donorInfo = donorInfo; + } + + public GermplasmMCPD genus(String genus) { + this.genus = genus; + return this; + } + + /** + * MCPD (v2.1) (GENUS) 5. Genus name for taxon. Initial uppercase letter required. + * @return genus + **/ + @Schema(description = "MCPD (v2.1) (GENUS) 5. Genus name for taxon. Initial uppercase letter required.") + public String getGenus() { + return genus; + } + + public void setGenus(String genus) { + this.genus = genus; + } + + public GermplasmMCPD germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * A unique identifier which identifies a germplasm in this database + * @return germplasmDbId + **/ + @Schema(description = "A unique identifier which identifies a germplasm in this database") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public GermplasmMCPD germplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + return this; + } + + /** + * MCPD (v2.1) (PUID) 0. Any persistent, unique identifier assigned to the accession so it can be unambiguously referenced at the global level and the information associated with it harvested through automated means. Report one PUID for each accession. The Secretariat of the International Treaty on Plant Genetic Resources for Food and Agriculture (PGRFA) is facilitating the assignment of a persistent unique identifier (PUID), in the form of a DOI, to PGRFA at the accession level (http://www.planttreaty.org/doi). Genebanks not applying a true PUID to their accessions should use, and request recipients to use, the concatenation of INSTCODE, ACCENUMB, and GENUS as a globally unique identifier similar in most respects to the PUID whenever they exchange information on accessions with third parties (e.g. NOR017:NGB17773:ALLIUM). + * @return germplasmPUI + **/ + @Schema(description = "MCPD (v2.1) (PUID) 0. Any persistent, unique identifier assigned to the accession so it can be unambiguously referenced at the global level and the information associated with it harvested through automated means. Report one PUID for each accession. The Secretariat of the International Treaty on Plant Genetic Resources for Food and Agriculture (PGRFA) is facilitating the assignment of a persistent unique identifier (PUID), in the form of a DOI, to PGRFA at the accession level (http://www.planttreaty.org/doi). Genebanks not applying a true PUID to their accessions should use, and request recipients to use, the concatenation of INSTCODE, ACCENUMB, and GENUS as a globally unique identifier similar in most respects to the PUID whenever they exchange information on accessions with third parties (e.g. NOR017:NGB17773:ALLIUM).") + public String getGermplasmPUI() { + return germplasmPUI; + } + + public void setGermplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + } + + public GermplasmMCPD instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * MCPD (v2.1) (INSTCODE) 1. FAO WIEWS code of the institute where the accession is maintained. The codes consist of the 3-letter ISO 3166 country code of the country where the institute is located plus a number (e.g. COL001). The current set of institute codes is available from http://www.fao.org/wiews. For those institutes not yet having an FAO Code, or for those with \"obsolete\" codes, see \"Common formatting rules (v)\". + * @return instituteCode + **/ + @Schema(description = "MCPD (v2.1) (INSTCODE) 1. FAO WIEWS code of the institute where the accession is maintained. The codes consist of the 3-letter ISO 3166 country code of the country where the institute is located plus a number (e.g. COL001). The current set of institute codes is available from http://www.fao.org/wiews. For those institutes not yet having an FAO Code, or for those with \"obsolete\" codes, see \"Common formatting rules (v)\".") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmMCPD mlsStatus(MlsStatusEnum mlsStatus) { + this.mlsStatus = mlsStatus; + return this; + } + + /** + * MCPD (v2.1) (MLSSTAT) 27. The status of an accession with regards to the Multilateral System (MLS) of the International Treaty on Plant Genetic Resources for Food and Agriculture. Leave the value empty if the status is not known 0 No (not included) 1 Yes (included) 99 Other (elaborate in REMARKS field, e.g. \"under development\") + * @return mlsStatus + **/ + @Schema(description = "MCPD (v2.1) (MLSSTAT) 27. The status of an accession with regards to the Multilateral System (MLS) of the International Treaty on Plant Genetic Resources for Food and Agriculture. Leave the value empty if the status is not known 0 No (not included) 1 Yes (included) 99 Other (elaborate in REMARKS field, e.g. \"under development\")") + public MlsStatusEnum getMlsStatus() { + return mlsStatus; + } + + public void setMlsStatus(MlsStatusEnum mlsStatus) { + this.mlsStatus = mlsStatus; + } + + public GermplasmMCPD remarks(String remarks) { + this.remarks = remarks; + return this; + } + + /** + * MCPD (v2.1) (REMARKS) 28. The remarks field is used to add notes or to elaborate on descriptors with value 99 or 999 (= Other). Prefix remarks with the field name they refer to and a colon (:) without space (e.g. COLLSRC:riverside). Distinct remarks referring to different fields are separated by semicolons without space. + * @return remarks + **/ + @Schema(description = "MCPD (v2.1) (REMARKS) 28. The remarks field is used to add notes or to elaborate on descriptors with value 99 or 999 (= Other). Prefix remarks with the field name they refer to and a colon (:) without space (e.g. COLLSRC:riverside). Distinct remarks referring to different fields are separated by semicolons without space.") + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public GermplasmMCPD safetyDuplicateInstitues(List safetyDuplicateInstitues) { + this.safetyDuplicateInstitues = safetyDuplicateInstitues; + return this; + } + + public GermplasmMCPD addSafetyDuplicateInstituesItem(GermplasmMCPDSafetyDuplicateInstitues safetyDuplicateInstituesItem) { + if (this.safetyDuplicateInstitues == null) { + this.safetyDuplicateInstitues = new ArrayList(); + } + this.safetyDuplicateInstitues.add(safetyDuplicateInstituesItem); + return this; + } + + /** + * Get safetyDuplicateInstitues + * @return safetyDuplicateInstitues + **/ + @Schema(description = "") + public List getSafetyDuplicateInstitues() { + return safetyDuplicateInstitues; + } + + public void setSafetyDuplicateInstitues(List safetyDuplicateInstitues) { + this.safetyDuplicateInstitues = safetyDuplicateInstitues; + } + + public GermplasmMCPD species(String species) { + this.species = species; + return this; + } + + /** + * MCPD (v2.1) (SPECIES) 6. Specific epithet portion of the scientific name in lowercase letters. Only the following abbreviation is allowed: \"sp.\" + * @return species + **/ + @Schema(description = "MCPD (v2.1) (SPECIES) 6. Specific epithet portion of the scientific name in lowercase letters. Only the following abbreviation is allowed: \"sp.\" ") + public String getSpecies() { + return species; + } + + public void setSpecies(String species) { + this.species = species; + } + + public GermplasmMCPD speciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + return this; + } + + /** + * MCPD (v2.1) (SPAUTHOR) 7. Provide the authority for the species name. + * @return speciesAuthority + **/ + @Schema(description = "MCPD (v2.1) (SPAUTHOR) 7. Provide the authority for the species name.") + public String getSpeciesAuthority() { + return speciesAuthority; + } + + public void setSpeciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + } + + public GermplasmMCPD storageTypeCodes(List storageTypeCodes) { + this.storageTypeCodes = storageTypeCodes; + return this; + } + + public GermplasmMCPD addStorageTypeCodesItem(StorageTypeCodesEnum storageTypeCodesItem) { + if (this.storageTypeCodes == null) { + this.storageTypeCodes = new ArrayList(); + } + this.storageTypeCodes.add(storageTypeCodesItem); + return this; + } + + /** + * MCPD (v2.1) (STORAGE) 26. If germplasm is maintained under different types of storage, multiple choices are allowed, separated by a semicolon (e.g. 20;30). (Refer to FAO/IPGRI Genebank Standards 1994 for details on storage type.) 10) Seed collection 11) Short term 12) Medium term 13) Long term 20) Field collection 30) In vitro collection 40) Cryopreserved collection 50) DNA collection 99) Other (elaborate in REMARKS field) + * @return storageTypeCodes + **/ + @Schema(description = "MCPD (v2.1) (STORAGE) 26. If germplasm is maintained under different types of storage, multiple choices are allowed, separated by a semicolon (e.g. 20;30). (Refer to FAO/IPGRI Genebank Standards 1994 for details on storage type.) 10) Seed collection 11) Short term 12) Medium term 13) Long term 20) Field collection 30) In vitro collection 40) Cryopreserved collection 50) DNA collection 99) Other (elaborate in REMARKS field)") + public List getStorageTypeCodes() { + return storageTypeCodes; + } + + public void setStorageTypeCodes(List storageTypeCodes) { + this.storageTypeCodes = storageTypeCodes; + } + + public GermplasmMCPD subtaxon(String subtaxon) { + this.subtaxon = subtaxon; + return this; + } + + /** + * MCPD (v2.1) (SUBTAXA) 8. Subtaxon can be used to store any additional taxonomic identifier. The following abbreviations are allowed: \"subsp.\" (for subspecies); \"convar.\" (for convariety); \"var.\" (for variety); \"f.\" (for form); \"Group\" (for \"cultivar group\"). + * @return subtaxon + **/ + @Schema(description = "MCPD (v2.1) (SUBTAXA) 8. Subtaxon can be used to store any additional taxonomic identifier. The following abbreviations are allowed: \"subsp.\" (for subspecies); \"convar.\" (for convariety); \"var.\" (for variety); \"f.\" (for form); \"Group\" (for \"cultivar group\").") + public String getSubtaxon() { + return subtaxon; + } + + public void setSubtaxon(String subtaxon) { + this.subtaxon = subtaxon; + } + + public GermplasmMCPD subtaxonAuthority(String subtaxonAuthority) { + this.subtaxonAuthority = subtaxonAuthority; + return this; + } + + /** + * MCPD (v2.1) (SUBTAUTHOR) 9. Provide the subtaxon authority at the most detailed taxonomic level. + * @return subtaxonAuthority + **/ + @Schema(description = "MCPD (v2.1) (SUBTAUTHOR) 9. Provide the subtaxon authority at the most detailed taxonomic level.") + public String getSubtaxonAuthority() { + return subtaxonAuthority; + } + + public void setSubtaxonAuthority(String subtaxonAuthority) { + this.subtaxonAuthority = subtaxonAuthority; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPD germplasmMCPD = (GermplasmMCPD) o; + return Objects.equals(this.accessionNames, germplasmMCPD.accessionNames) && + Objects.equals(this.accessionNumber, germplasmMCPD.accessionNumber) && + Objects.equals(this.acquisitionDate, germplasmMCPD.acquisitionDate) && + Objects.equals(this.acquisitionSourceCode, germplasmMCPD.acquisitionSourceCode) && + Objects.equals(this.alternateIDs, germplasmMCPD.alternateIDs) && + Objects.equals(this.ancestralData, germplasmMCPD.ancestralData) && + Objects.equals(this.biologicalStatusOfAccessionCode, germplasmMCPD.biologicalStatusOfAccessionCode) && + Objects.equals(this.breedingInstitutes, germplasmMCPD.breedingInstitutes) && + Objects.equals(this.collectingInfo, germplasmMCPD.collectingInfo) && + Objects.equals(this.commonCropName, germplasmMCPD.commonCropName) && + Objects.equals(this.countryOfOrigin, germplasmMCPD.countryOfOrigin) && + Objects.equals(this.donorInfo, germplasmMCPD.donorInfo) && + Objects.equals(this.genus, germplasmMCPD.genus) && + Objects.equals(this.germplasmDbId, germplasmMCPD.germplasmDbId) && + Objects.equals(this.germplasmPUI, germplasmMCPD.germplasmPUI) && + Objects.equals(this.instituteCode, germplasmMCPD.instituteCode) && + Objects.equals(this.mlsStatus, germplasmMCPD.mlsStatus) && + Objects.equals(this.remarks, germplasmMCPD.remarks) && + Objects.equals(this.safetyDuplicateInstitues, germplasmMCPD.safetyDuplicateInstitues) && + Objects.equals(this.species, germplasmMCPD.species) && + Objects.equals(this.speciesAuthority, germplasmMCPD.speciesAuthority) && + Objects.equals(this.storageTypeCodes, germplasmMCPD.storageTypeCodes) && + Objects.equals(this.subtaxon, germplasmMCPD.subtaxon) && + Objects.equals(this.subtaxonAuthority, germplasmMCPD.subtaxonAuthority); + } + + @Override + public int hashCode() { + return Objects.hash(accessionNames, accessionNumber, acquisitionDate, acquisitionSourceCode, alternateIDs, ancestralData, biologicalStatusOfAccessionCode, breedingInstitutes, collectingInfo, commonCropName, countryOfOrigin, donorInfo, genus, germplasmDbId, germplasmPUI, instituteCode, mlsStatus, remarks, safetyDuplicateInstitues, species, speciesAuthority, storageTypeCodes, subtaxon, subtaxonAuthority); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPD {\n"); + + sb.append(" accessionNames: ").append(toIndentedString(accessionNames)).append("\n"); + sb.append(" accessionNumber: ").append(toIndentedString(accessionNumber)).append("\n"); + sb.append(" acquisitionDate: ").append(toIndentedString(acquisitionDate)).append("\n"); + sb.append(" acquisitionSourceCode: ").append(toIndentedString(acquisitionSourceCode)).append("\n"); + sb.append(" alternateIDs: ").append(toIndentedString(alternateIDs)).append("\n"); + sb.append(" ancestralData: ").append(toIndentedString(ancestralData)).append("\n"); + sb.append(" biologicalStatusOfAccessionCode: ").append(toIndentedString(biologicalStatusOfAccessionCode)).append("\n"); + sb.append(" breedingInstitutes: ").append(toIndentedString(breedingInstitutes)).append("\n"); + sb.append(" collectingInfo: ").append(toIndentedString(collectingInfo)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" countryOfOrigin: ").append(toIndentedString(countryOfOrigin)).append("\n"); + sb.append(" donorInfo: ").append(toIndentedString(donorInfo)).append("\n"); + sb.append(" genus: ").append(toIndentedString(genus)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmPUI: ").append(toIndentedString(germplasmPUI)).append("\n"); + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" mlsStatus: ").append(toIndentedString(mlsStatus)).append("\n"); + sb.append(" remarks: ").append(toIndentedString(remarks)).append("\n"); + sb.append(" safetyDuplicateInstitues: ").append(toIndentedString(safetyDuplicateInstitues)).append("\n"); + sb.append(" species: ").append(toIndentedString(species)).append("\n"); + sb.append(" speciesAuthority: ").append(toIndentedString(speciesAuthority)).append("\n"); + sb.append(" storageTypeCodes: ").append(toIndentedString(storageTypeCodes)).append("\n"); + sb.append(" subtaxon: ").append(toIndentedString(subtaxon)).append("\n"); + sb.append(" subtaxonAuthority: ").append(toIndentedString(subtaxonAuthority)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDBreedingInstitutes.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDBreedingInstitutes.java new file mode 100755 index 00000000..b1e62332 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDBreedingInstitutes.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMCPDBreedingInstitutes + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDBreedingInstitutes { + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + public GermplasmMCPDBreedingInstitutes instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * MCPD (v2.1) (BREDCODE) 18. FAO WIEWS code of the institute that has bred the material. If the holding institute has bred the material, the breeding institute code (BREDCODE) should be the same as the holding institute code (INSTCODE). Follows INSTCODE standard. Multiple values are separated by a semicolon without space. + * @return instituteCode + **/ + @Schema(description = "MCPD (v2.1) (BREDCODE) 18. FAO WIEWS code of the institute that has bred the material. If the holding institute has bred the material, the breeding institute code (BREDCODE) should be the same as the holding institute code (INSTCODE). Follows INSTCODE standard. Multiple values are separated by a semicolon without space.") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmMCPDBreedingInstitutes instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * MCPD (v2.1) (BREDNAME) 18.1 Name of the institute (or person) that bred the material. This descriptor should be used only if BREDCODE cannot be filled because the FAO WIEWS code for this institute is not available. Multiple names are separated by a semicolon without space. + * @return instituteName + **/ + @Schema(description = "MCPD (v2.1) (BREDNAME) 18.1 Name of the institute (or person) that bred the material. This descriptor should be used only if BREDCODE cannot be filled because the FAO WIEWS code for this institute is not available. Multiple names are separated by a semicolon without space.") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDBreedingInstitutes germplasmMCPDBreedingInstitutes = (GermplasmMCPDBreedingInstitutes) o; + return Objects.equals(this.instituteCode, germplasmMCPDBreedingInstitutes.instituteCode) && + Objects.equals(this.instituteName, germplasmMCPDBreedingInstitutes.instituteName); + } + + @Override + public int hashCode() { + return Objects.hash(instituteCode, instituteName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDBreedingInstitutes {\n"); + + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfo.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfo.java new file mode 100755 index 00000000..0edb562b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfo.java @@ -0,0 +1,191 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmMCPDCollectingInfoCollectingInstitutes; +import io.swagger.client.model.GermplasmMCPDCollectingInfoCollectingSite; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Information about the collection of this germplasm + */ +@Schema(description = "Information about the collection of this germplasm") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDCollectingInfo { + @SerializedName("collectingDate") + private String collectingDate = null; + + @SerializedName("collectingInstitutes") + private List collectingInstitutes = null; + + @SerializedName("collectingMissionIdentifier") + private String collectingMissionIdentifier = null; + + @SerializedName("collectingNumber") + private String collectingNumber = null; + + @SerializedName("collectingSite") + private GermplasmMCPDCollectingInfoCollectingSite collectingSite = null; + + public GermplasmMCPDCollectingInfo collectingDate(String collectingDate) { + this.collectingDate = collectingDate; + return this; + } + + /** + * MCPD (v2.1) (COLLDATE) 17. Collecting date of the sample [YYYYMMDD] where YYYY is the year, MM is the month and DD is the day. Missing data (MM or DD) should be indicated with hyphens or \"00\" [double zero]. + * @return collectingDate + **/ + @Schema(description = "MCPD (v2.1) (COLLDATE) 17. Collecting date of the sample [YYYYMMDD] where YYYY is the year, MM is the month and DD is the day. Missing data (MM or DD) should be indicated with hyphens or \"00\" [double zero].") + public String getCollectingDate() { + return collectingDate; + } + + public void setCollectingDate(String collectingDate) { + this.collectingDate = collectingDate; + } + + public GermplasmMCPDCollectingInfo collectingInstitutes(List collectingInstitutes) { + this.collectingInstitutes = collectingInstitutes; + return this; + } + + public GermplasmMCPDCollectingInfo addCollectingInstitutesItem(GermplasmMCPDCollectingInfoCollectingInstitutes collectingInstitutesItem) { + if (this.collectingInstitutes == null) { + this.collectingInstitutes = new ArrayList(); + } + this.collectingInstitutes.add(collectingInstitutesItem); + return this; + } + + /** + * Institutes which collected the sample + * @return collectingInstitutes + **/ + @Schema(description = "Institutes which collected the sample") + public List getCollectingInstitutes() { + return collectingInstitutes; + } + + public void setCollectingInstitutes(List collectingInstitutes) { + this.collectingInstitutes = collectingInstitutes; + } + + public GermplasmMCPDCollectingInfo collectingMissionIdentifier(String collectingMissionIdentifier) { + this.collectingMissionIdentifier = collectingMissionIdentifier; + return this; + } + + /** + * MCPD (v2.1) (COLLMISSID) 4.2 Identifier of the collecting mission used by the Collecting Institute (4 or 4.1) (e.g. \"CIATFOR052\", \"CN426\"). + * @return collectingMissionIdentifier + **/ + @Schema(description = "MCPD (v2.1) (COLLMISSID) 4.2 Identifier of the collecting mission used by the Collecting Institute (4 or 4.1) (e.g. \"CIATFOR052\", \"CN426\").") + public String getCollectingMissionIdentifier() { + return collectingMissionIdentifier; + } + + public void setCollectingMissionIdentifier(String collectingMissionIdentifier) { + this.collectingMissionIdentifier = collectingMissionIdentifier; + } + + public GermplasmMCPDCollectingInfo collectingNumber(String collectingNumber) { + this.collectingNumber = collectingNumber; + return this; + } + + /** + * MCPD (v2.1) (COLLNUMB) 3. Original identifier assigned by the collector(s) of the sample, normally composed of the name or initials of the collector(s) followed by a number (e.g. \"FM9909\"). This identifier is essential for identifying duplicates held in different collections. + * @return collectingNumber + **/ + @Schema(description = "MCPD (v2.1) (COLLNUMB) 3. Original identifier assigned by the collector(s) of the sample, normally composed of the name or initials of the collector(s) followed by a number (e.g. \"FM9909\"). This identifier is essential for identifying duplicates held in different collections.") + public String getCollectingNumber() { + return collectingNumber; + } + + public void setCollectingNumber(String collectingNumber) { + this.collectingNumber = collectingNumber; + } + + public GermplasmMCPDCollectingInfo collectingSite(GermplasmMCPDCollectingInfoCollectingSite collectingSite) { + this.collectingSite = collectingSite; + return this; + } + + /** + * Get collectingSite + * @return collectingSite + **/ + @Schema(description = "") + public GermplasmMCPDCollectingInfoCollectingSite getCollectingSite() { + return collectingSite; + } + + public void setCollectingSite(GermplasmMCPDCollectingInfoCollectingSite collectingSite) { + this.collectingSite = collectingSite; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDCollectingInfo germplasmMCPDCollectingInfo = (GermplasmMCPDCollectingInfo) o; + return Objects.equals(this.collectingDate, germplasmMCPDCollectingInfo.collectingDate) && + Objects.equals(this.collectingInstitutes, germplasmMCPDCollectingInfo.collectingInstitutes) && + Objects.equals(this.collectingMissionIdentifier, germplasmMCPDCollectingInfo.collectingMissionIdentifier) && + Objects.equals(this.collectingNumber, germplasmMCPDCollectingInfo.collectingNumber) && + Objects.equals(this.collectingSite, germplasmMCPDCollectingInfo.collectingSite); + } + + @Override + public int hashCode() { + return Objects.hash(collectingDate, collectingInstitutes, collectingMissionIdentifier, collectingNumber, collectingSite); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDCollectingInfo {\n"); + + sb.append(" collectingDate: ").append(toIndentedString(collectingDate)).append("\n"); + sb.append(" collectingInstitutes: ").append(toIndentedString(collectingInstitutes)).append("\n"); + sb.append(" collectingMissionIdentifier: ").append(toIndentedString(collectingMissionIdentifier)).append("\n"); + sb.append(" collectingNumber: ").append(toIndentedString(collectingNumber)).append("\n"); + sb.append(" collectingSite: ").append(toIndentedString(collectingSite)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingInstitutes.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingInstitutes.java new file mode 100755 index 00000000..4da9466c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingInstitutes.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMCPDCollectingInfoCollectingInstitutes + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDCollectingInfoCollectingInstitutes { + @SerializedName("instituteAddress") + private String instituteAddress = null; + + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + public GermplasmMCPDCollectingInfoCollectingInstitutes instituteAddress(String instituteAddress) { + this.instituteAddress = instituteAddress; + return this; + } + + /** + * MCPD (v2.1) (COLLINSTADDRESS) 4.1.1 Address of the institute collecting the sample. This descriptor should be used only if COLLCODE cannot be filled since the FAO WIEWS code for this institute is not available. Multiple values are separated by a semicolon without space. + * @return instituteAddress + **/ + @Schema(description = "MCPD (v2.1) (COLLINSTADDRESS) 4.1.1 Address of the institute collecting the sample. This descriptor should be used only if COLLCODE cannot be filled since the FAO WIEWS code for this institute is not available. Multiple values are separated by a semicolon without space.") + public String getInstituteAddress() { + return instituteAddress; + } + + public void setInstituteAddress(String instituteAddress) { + this.instituteAddress = instituteAddress; + } + + public GermplasmMCPDCollectingInfoCollectingInstitutes instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * MCPD (v2.1) (COLLCODE) 4. FAO WIEWS code of the institute collecting the sample. If the holding institute has collected the material, the collecting institute code (COLLCODE) should be the same as the holding institute code (INSTCODE). Follows INSTCODE standard. Multiple values are separated by a semicolon without space. + * @return instituteCode + **/ + @Schema(description = "MCPD (v2.1) (COLLCODE) 4. FAO WIEWS code of the institute collecting the sample. If the holding institute has collected the material, the collecting institute code (COLLCODE) should be the same as the holding institute code (INSTCODE). Follows INSTCODE standard. Multiple values are separated by a semicolon without space.") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmMCPDCollectingInfoCollectingInstitutes instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * MCPD (v2.1) (COLLNAME) 4.1 Name of the institute collecting the sample. This descriptor should be used only if COLLCODE cannot be filled because the FAO WIEWS code for this institute is not available. Multiple values are separated by a semicolon without space. + * @return instituteName + **/ + @Schema(description = "MCPD (v2.1) (COLLNAME) 4.1 Name of the institute collecting the sample. This descriptor should be used only if COLLCODE cannot be filled because the FAO WIEWS code for this institute is not available. Multiple values are separated by a semicolon without space.") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDCollectingInfoCollectingInstitutes germplasmMCPDCollectingInfoCollectingInstitutes = (GermplasmMCPDCollectingInfoCollectingInstitutes) o; + return Objects.equals(this.instituteAddress, germplasmMCPDCollectingInfoCollectingInstitutes.instituteAddress) && + Objects.equals(this.instituteCode, germplasmMCPDCollectingInfoCollectingInstitutes.instituteCode) && + Objects.equals(this.instituteName, germplasmMCPDCollectingInfoCollectingInstitutes.instituteName); + } + + @Override + public int hashCode() { + return Objects.hash(instituteAddress, instituteCode, instituteName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDCollectingInfoCollectingInstitutes {\n"); + + sb.append(" instituteAddress: ").append(toIndentedString(instituteAddress)).append("\n"); + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingSite.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingSite.java new file mode 100755 index 00000000..75e9cc1f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDCollectingInfoCollectingSite.java @@ -0,0 +1,271 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Information about the location where the sample was collected + */ +@Schema(description = "Information about the location where the sample was collected") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDCollectingInfoCollectingSite { + @SerializedName("coordinateUncertainty") + private String coordinateUncertainty = null; + + @SerializedName("elevation") + private String elevation = null; + + @SerializedName("georeferencingMethod") + private String georeferencingMethod = null; + + @SerializedName("latitudeDecimal") + private String latitudeDecimal = null; + + @SerializedName("latitudeDegrees") + private String latitudeDegrees = null; + + @SerializedName("locationDescription") + private String locationDescription = null; + + @SerializedName("longitudeDecimal") + private String longitudeDecimal = null; + + @SerializedName("longitudeDegrees") + private String longitudeDegrees = null; + + @SerializedName("spatialReferenceSystem") + private String spatialReferenceSystem = null; + + public GermplasmMCPDCollectingInfoCollectingSite coordinateUncertainty(String coordinateUncertainty) { + this.coordinateUncertainty = coordinateUncertainty; + return this; + } + + /** + * MCPD (v2.1) (COORDUNCERT) 15.5 Uncertainty associated with the coordinates in metres. Leave the value empty if the uncertainty is unknown. + * @return coordinateUncertainty + **/ + @Schema(description = "MCPD (v2.1) (COORDUNCERT) 15.5 Uncertainty associated with the coordinates in metres. Leave the value empty if the uncertainty is unknown.") + public String getCoordinateUncertainty() { + return coordinateUncertainty; + } + + public void setCoordinateUncertainty(String coordinateUncertainty) { + this.coordinateUncertainty = coordinateUncertainty; + } + + public GermplasmMCPDCollectingInfoCollectingSite elevation(String elevation) { + this.elevation = elevation; + return this; + } + + /** + * MCPD (v2.1) (ELEVATION) 16. Elevation of collecting site expressed in metres above sea level. Negative values are allowed. + * @return elevation + **/ + @Schema(description = "MCPD (v2.1) (ELEVATION) 16. Elevation of collecting site expressed in metres above sea level. Negative values are allowed.") + public String getElevation() { + return elevation; + } + + public void setElevation(String elevation) { + this.elevation = elevation; + } + + public GermplasmMCPDCollectingInfoCollectingSite georeferencingMethod(String georeferencingMethod) { + this.georeferencingMethod = georeferencingMethod; + return this; + } + + /** + * MCPD (v2.1) (GEOREFMETH) 15.7 The georeferencing method used (GPS, determined from map, gazetteer, or estimated using software). Leave the value empty if georeferencing method is not known. + * @return georeferencingMethod + **/ + @Schema(description = "MCPD (v2.1) (GEOREFMETH) 15.7 The georeferencing method used (GPS, determined from map, gazetteer, or estimated using software). Leave the value empty if georeferencing method is not known.") + public String getGeoreferencingMethod() { + return georeferencingMethod; + } + + public void setGeoreferencingMethod(String georeferencingMethod) { + this.georeferencingMethod = georeferencingMethod; + } + + public GermplasmMCPDCollectingInfoCollectingSite latitudeDecimal(String latitudeDecimal) { + this.latitudeDecimal = latitudeDecimal; + return this; + } + + /** + * MCPD (v2.1) (DECLATITUDE) 15.1 Latitude expressed in decimal degrees. Positive values are North of the Equator; negative values are South of the Equator (e.g. -44.6975). + * @return latitudeDecimal + **/ + @Schema(description = "MCPD (v2.1) (DECLATITUDE) 15.1 Latitude expressed in decimal degrees. Positive values are North of the Equator; negative values are South of the Equator (e.g. -44.6975).") + public String getLatitudeDecimal() { + return latitudeDecimal; + } + + public void setLatitudeDecimal(String latitudeDecimal) { + this.latitudeDecimal = latitudeDecimal; + } + + public GermplasmMCPDCollectingInfoCollectingSite latitudeDegrees(String latitudeDegrees) { + this.latitudeDegrees = latitudeDegrees; + return this; + } + + /** + * MCPD (v2.1) (LATITUDE) 15.2 Degrees (2 digits) minutes (2 digits), and seconds (2 digits) followed by N (North) or S (South) (e.g. 103020S). Every missing digit (minutes or seconds) should be indicated with a hyphen. Leading zeros are required (e.g. 10 + * @return latitudeDegrees + **/ + @Schema(description = "MCPD (v2.1) (LATITUDE) 15.2 Degrees (2 digits) minutes (2 digits), and seconds (2 digits) followed by N (North) or S (South) (e.g. 103020S). Every missing digit (minutes or seconds) should be indicated with a hyphen. Leading zeros are required (e.g. 10") + public String getLatitudeDegrees() { + return latitudeDegrees; + } + + public void setLatitudeDegrees(String latitudeDegrees) { + this.latitudeDegrees = latitudeDegrees; + } + + public GermplasmMCPDCollectingInfoCollectingSite locationDescription(String locationDescription) { + this.locationDescription = locationDescription; + return this; + } + + /** + * MCPD (v2.1) (COLLSITE) 14. Location information below the country level that describes where the accession was collected, preferable in English. This might include the distance in kilometres and direction from the nearest town, village or map grid reference point, (e.g. 7 km south of Curitiba in the state of Parana). + * @return locationDescription + **/ + @Schema(description = "MCPD (v2.1) (COLLSITE) 14. Location information below the country level that describes where the accession was collected, preferable in English. This might include the distance in kilometres and direction from the nearest town, village or map grid reference point, (e.g. 7 km south of Curitiba in the state of Parana).") + public String getLocationDescription() { + return locationDescription; + } + + public void setLocationDescription(String locationDescription) { + this.locationDescription = locationDescription; + } + + public GermplasmMCPDCollectingInfoCollectingSite longitudeDecimal(String longitudeDecimal) { + this.longitudeDecimal = longitudeDecimal; + return this; + } + + /** + * MCPD (v2.1) (DECLONGITUDE) 15.3 Longitude expressed in decimal degrees. Positive values are East of the Greenwich Meridian; negative values are West of the Greenwich Meridian (e.g. +120.9123). + * @return longitudeDecimal + **/ + @Schema(description = "MCPD (v2.1) (DECLONGITUDE) 15.3 Longitude expressed in decimal degrees. Positive values are East of the Greenwich Meridian; negative values are West of the Greenwich Meridian (e.g. +120.9123).") + public String getLongitudeDecimal() { + return longitudeDecimal; + } + + public void setLongitudeDecimal(String longitudeDecimal) { + this.longitudeDecimal = longitudeDecimal; + } + + public GermplasmMCPDCollectingInfoCollectingSite longitudeDegrees(String longitudeDegrees) { + this.longitudeDegrees = longitudeDegrees; + return this; + } + + /** + * MCPD (v2.1) (LONGITUDE) 15.4 Degrees (3 digits), minutes (2 digits), and seconds (2 digits) followed by E (East) or W (West) (e.g. 0762510W). Every missing digit (minutes or seconds) should be indicated with a hyphen. Leading zeros are required (e.g. 076 + * @return longitudeDegrees + **/ + @Schema(description = "MCPD (v2.1) (LONGITUDE) 15.4 Degrees (3 digits), minutes (2 digits), and seconds (2 digits) followed by E (East) or W (West) (e.g. 0762510W). Every missing digit (minutes or seconds) should be indicated with a hyphen. Leading zeros are required (e.g. 076") + public String getLongitudeDegrees() { + return longitudeDegrees; + } + + public void setLongitudeDegrees(String longitudeDegrees) { + this.longitudeDegrees = longitudeDegrees; + } + + public GermplasmMCPDCollectingInfoCollectingSite spatialReferenceSystem(String spatialReferenceSystem) { + this.spatialReferenceSystem = spatialReferenceSystem; + return this; + } + + /** + * MCPD (v2.1) (COORDDATUM) 15.6 The geodetic datum or spatial reference system upon which the coordinates given in decimal latitude and decimal longitude are based (e.g. WGS84, ETRS89, NAD83). The GPS uses the WGS84 datum. + * @return spatialReferenceSystem + **/ + @Schema(description = "MCPD (v2.1) (COORDDATUM) 15.6 The geodetic datum or spatial reference system upon which the coordinates given in decimal latitude and decimal longitude are based (e.g. WGS84, ETRS89, NAD83). The GPS uses the WGS84 datum.") + public String getSpatialReferenceSystem() { + return spatialReferenceSystem; + } + + public void setSpatialReferenceSystem(String spatialReferenceSystem) { + this.spatialReferenceSystem = spatialReferenceSystem; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDCollectingInfoCollectingSite germplasmMCPDCollectingInfoCollectingSite = (GermplasmMCPDCollectingInfoCollectingSite) o; + return Objects.equals(this.coordinateUncertainty, germplasmMCPDCollectingInfoCollectingSite.coordinateUncertainty) && + Objects.equals(this.elevation, germplasmMCPDCollectingInfoCollectingSite.elevation) && + Objects.equals(this.georeferencingMethod, germplasmMCPDCollectingInfoCollectingSite.georeferencingMethod) && + Objects.equals(this.latitudeDecimal, germplasmMCPDCollectingInfoCollectingSite.latitudeDecimal) && + Objects.equals(this.latitudeDegrees, germplasmMCPDCollectingInfoCollectingSite.latitudeDegrees) && + Objects.equals(this.locationDescription, germplasmMCPDCollectingInfoCollectingSite.locationDescription) && + Objects.equals(this.longitudeDecimal, germplasmMCPDCollectingInfoCollectingSite.longitudeDecimal) && + Objects.equals(this.longitudeDegrees, germplasmMCPDCollectingInfoCollectingSite.longitudeDegrees) && + Objects.equals(this.spatialReferenceSystem, germplasmMCPDCollectingInfoCollectingSite.spatialReferenceSystem); + } + + @Override + public int hashCode() { + return Objects.hash(coordinateUncertainty, elevation, georeferencingMethod, latitudeDecimal, latitudeDegrees, locationDescription, longitudeDecimal, longitudeDegrees, spatialReferenceSystem); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDCollectingInfoCollectingSite {\n"); + + sb.append(" coordinateUncertainty: ").append(toIndentedString(coordinateUncertainty)).append("\n"); + sb.append(" elevation: ").append(toIndentedString(elevation)).append("\n"); + sb.append(" georeferencingMethod: ").append(toIndentedString(georeferencingMethod)).append("\n"); + sb.append(" latitudeDecimal: ").append(toIndentedString(latitudeDecimal)).append("\n"); + sb.append(" latitudeDegrees: ").append(toIndentedString(latitudeDegrees)).append("\n"); + sb.append(" locationDescription: ").append(toIndentedString(locationDescription)).append("\n"); + sb.append(" longitudeDecimal: ").append(toIndentedString(longitudeDecimal)).append("\n"); + sb.append(" longitudeDegrees: ").append(toIndentedString(longitudeDegrees)).append("\n"); + sb.append(" spatialReferenceSystem: ").append(toIndentedString(spatialReferenceSystem)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfo.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfo.java new file mode 100755 index 00000000..00fe5031 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfo.java @@ -0,0 +1,111 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmMCPDDonorInfoDonorInstitute; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Information about the donor + */ +@Schema(description = "Information about the donor") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDDonorInfo { + @SerializedName("donorAccessionNumber") + private String donorAccessionNumber = null; + + @SerializedName("donorInstitute") + private GermplasmMCPDDonorInfoDonorInstitute donorInstitute = null; + + public GermplasmMCPDDonorInfo donorAccessionNumber(String donorAccessionNumber) { + this.donorAccessionNumber = donorAccessionNumber; + return this; + } + + /** + * MCPD (v2.1) (DONORNUMB) 23. Identifier assigned to an accession by the donor. Follows ACCENUMB standard. + * @return donorAccessionNumber + **/ + @Schema(description = "MCPD (v2.1) (DONORNUMB) 23. Identifier assigned to an accession by the donor. Follows ACCENUMB standard.") + public String getDonorAccessionNumber() { + return donorAccessionNumber; + } + + public void setDonorAccessionNumber(String donorAccessionNumber) { + this.donorAccessionNumber = donorAccessionNumber; + } + + public GermplasmMCPDDonorInfo donorInstitute(GermplasmMCPDDonorInfoDonorInstitute donorInstitute) { + this.donorInstitute = donorInstitute; + return this; + } + + /** + * Get donorInstitute + * @return donorInstitute + **/ + @Schema(description = "") + public GermplasmMCPDDonorInfoDonorInstitute getDonorInstitute() { + return donorInstitute; + } + + public void setDonorInstitute(GermplasmMCPDDonorInfoDonorInstitute donorInstitute) { + this.donorInstitute = donorInstitute; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDDonorInfo germplasmMCPDDonorInfo = (GermplasmMCPDDonorInfo) o; + return Objects.equals(this.donorAccessionNumber, germplasmMCPDDonorInfo.donorAccessionNumber) && + Objects.equals(this.donorInstitute, germplasmMCPDDonorInfo.donorInstitute); + } + + @Override + public int hashCode() { + return Objects.hash(donorAccessionNumber, donorInstitute); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDDonorInfo {\n"); + + sb.append(" donorAccessionNumber: ").append(toIndentedString(donorAccessionNumber)).append("\n"); + sb.append(" donorInstitute: ").append(toIndentedString(donorInstitute)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfoDonorInstitute.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfoDonorInstitute.java new file mode 100755 index 00000000..2cbb70fb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDDonorInfoDonorInstitute.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMCPDDonorInfoDonorInstitute + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDDonorInfoDonorInstitute { + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + public GermplasmMCPDDonorInfoDonorInstitute instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * MCPD (v2.1) (DONORCODE) 22. FAO WIEWS code of the donor institute. Follows INSTCODE standard. + * @return instituteCode + **/ + @Schema(description = "MCPD (v2.1) (DONORCODE) 22. FAO WIEWS code of the donor institute. Follows INSTCODE standard.") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmMCPDDonorInfoDonorInstitute instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * MCPD (v2.1) (DONORNAME) 22.1 Name of the donor institute (or person). This descriptor should be used only if DONORCODE cannot be filled because the FAO WIEWS code for this institute is not available. + * @return instituteName + **/ + @Schema(description = "MCPD (v2.1) (DONORNAME) 22.1 Name of the donor institute (or person). This descriptor should be used only if DONORCODE cannot be filled because the FAO WIEWS code for this institute is not available.") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDDonorInfoDonorInstitute germplasmMCPDDonorInfoDonorInstitute = (GermplasmMCPDDonorInfoDonorInstitute) o; + return Objects.equals(this.instituteCode, germplasmMCPDDonorInfoDonorInstitute.instituteCode) && + Objects.equals(this.instituteName, germplasmMCPDDonorInfoDonorInstitute.instituteName); + } + + @Override + public int hashCode() { + return Objects.hash(instituteCode, instituteName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDDonorInfoDonorInstitute {\n"); + + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDResponse.java new file mode 100755 index 00000000..fb6d080c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmMCPD; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMCPDResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmMCPD result = null; + + public GermplasmMCPDResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmMCPDResponse result(GermplasmMCPD result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmMCPD getResult() { + return result; + } + + public void setResult(GermplasmMCPD result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDResponse germplasmMCPDResponse = (GermplasmMCPDResponse) o; + return Objects.equals(this.metadata, germplasmMCPDResponse.metadata) && + Objects.equals(this.result, germplasmMCPDResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDSafetyDuplicateInstitues.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDSafetyDuplicateInstitues.java new file mode 100755 index 00000000..6954647d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMCPDSafetyDuplicateInstitues.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMCPDSafetyDuplicateInstitues + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMCPDSafetyDuplicateInstitues { + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + public GermplasmMCPDSafetyDuplicateInstitues instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * MCPD (v2.1) (DUPLSITE) 25. FAO WIEWS code of the institute(s) where a safety duplicate of the accession is maintained. Follows INSTCODE standard. + * @return instituteCode + **/ + @Schema(description = "MCPD (v2.1) (DUPLSITE) 25. FAO WIEWS code of the institute(s) where a safety duplicate of the accession is maintained. Follows INSTCODE standard.") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmMCPDSafetyDuplicateInstitues instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * MCPD (v2.1) (DUPLINSTNAME) 25.1 Name of the institute where a safety duplicate of the accession is maintained. + * @return instituteName + **/ + @Schema(description = "MCPD (v2.1) (DUPLINSTNAME) 25.1 Name of the institute where a safety duplicate of the accession is maintained.") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMCPDSafetyDuplicateInstitues germplasmMCPDSafetyDuplicateInstitues = (GermplasmMCPDSafetyDuplicateInstitues) o; + return Objects.equals(this.instituteCode, germplasmMCPDSafetyDuplicateInstitues.instituteCode) && + Objects.equals(this.instituteName, germplasmMCPDSafetyDuplicateInstitues.instituteName); + } + + @Override + public int hashCode() { + return Objects.hash(instituteCode, instituteName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMCPDSafetyDuplicateInstitues {\n"); + + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesList.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesList.java new file mode 100755 index 00000000..7670af26 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesList.java @@ -0,0 +1,151 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmMarkerprofilesList + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMarkerprofilesList { + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("markerProfileDbIds") + private List markerProfileDbIds = null; + + @SerializedName("markerprofileDbIds") + private List markerprofileDbIds = null; + + public GermplasmMarkerprofilesList germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm within the given database server + * @return germplasmDbId + **/ + @Schema(description = "The ID which uniquely identifies a germplasm within the given database server") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public GermplasmMarkerprofilesList markerProfileDbIds(List markerProfileDbIds) { + this.markerProfileDbIds = markerProfileDbIds; + return this; + } + + public GermplasmMarkerprofilesList addMarkerProfileDbIdsItem(String markerProfileDbIdsItem) { + if (this.markerProfileDbIds == null) { + this.markerProfileDbIds = new ArrayList(); + } + this.markerProfileDbIds.add(markerProfileDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies a marker profile within the given database server + * @return markerProfileDbIds + **/ + @Schema(description = "The ID which uniquely identifies a marker profile within the given database server") + public List getMarkerProfileDbIds() { + return markerProfileDbIds; + } + + public void setMarkerProfileDbIds(List markerProfileDbIds) { + this.markerProfileDbIds = markerProfileDbIds; + } + + public GermplasmMarkerprofilesList markerprofileDbIds(List markerprofileDbIds) { + this.markerprofileDbIds = markerprofileDbIds; + return this; + } + + public GermplasmMarkerprofilesList addMarkerprofileDbIdsItem(String markerprofileDbIdsItem) { + if (this.markerprofileDbIds == null) { + this.markerprofileDbIds = new ArrayList(); + } + this.markerprofileDbIds.add(markerprofileDbIdsItem); + return this; + } + + /** + * DEPRECATED in v1.3 - see \"markerProfileDbIds\" (camel case) + * @return markerprofileDbIds + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"markerProfileDbIds\" (camel case)") + public List getMarkerprofileDbIds() { + return markerprofileDbIds; + } + + public void setMarkerprofileDbIds(List markerprofileDbIds) { + this.markerprofileDbIds = markerprofileDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMarkerprofilesList germplasmMarkerprofilesList = (GermplasmMarkerprofilesList) o; + return Objects.equals(this.germplasmDbId, germplasmMarkerprofilesList.germplasmDbId) && + Objects.equals(this.markerProfileDbIds, germplasmMarkerprofilesList.markerProfileDbIds) && + Objects.equals(this.markerprofileDbIds, germplasmMarkerprofilesList.markerprofileDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbId, markerProfileDbIds, markerprofileDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMarkerprofilesList {\n"); + + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" markerProfileDbIds: ").append(toIndentedString(markerProfileDbIds)).append("\n"); + sb.append(" markerprofileDbIds: ").append(toIndentedString(markerprofileDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesListResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesListResponse.java new file mode 100755 index 00000000..951b867d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmMarkerprofilesListResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmMarkerprofilesList; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmMarkerprofilesListResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmMarkerprofilesListResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmMarkerprofilesList result = null; + + public GermplasmMarkerprofilesListResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmMarkerprofilesListResponse result(GermplasmMarkerprofilesList result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmMarkerprofilesList getResult() { + return result; + } + + public void setResult(GermplasmMarkerprofilesList result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmMarkerprofilesListResponse germplasmMarkerprofilesListResponse = (GermplasmMarkerprofilesListResponse) o; + return Objects.equals(this.metadata, germplasmMarkerprofilesListResponse.metadata) && + Objects.equals(this.result, germplasmMarkerprofilesListResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmMarkerprofilesListResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse.java new file mode 100755 index 00000000..7effdb8a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmResponseResult result = null; + + public GermplasmResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmResponse result(GermplasmResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmResponseResult getResult() { + return result; + } + + public void setResult(GermplasmResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmResponse germplasmResponse = (GermplasmResponse) o; + return Objects.equals(this.metadata, germplasmResponse.metadata) && + Objects.equals(this.result, germplasmResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1.java new file mode 100755 index 00000000..9d445aba --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmResponse1Result; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmResponse1Result result = null; + + public GermplasmResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmResponse1 result(GermplasmResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public GermplasmResponse1Result getResult() { + return result; + } + + public void setResult(GermplasmResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmResponse1 germplasmResponse1 = (GermplasmResponse1) o; + return Objects.equals(this.metadata, germplasmResponse1.metadata) && + Objects.equals(this.result, germplasmResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1Result.java new file mode 100755 index 00000000..699c289e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Germplasm; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmResponse1Result { + @SerializedName("data") + private List data = null; + + public GermplasmResponse1Result data(List data) { + this.data = data; + return this; + } + + public GermplasmResponse1Result addDataItem(Germplasm dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmResponse1Result germplasmResponse1Result = (GermplasmResponse1Result) o; + return Objects.equals(this.data, germplasmResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse2.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse2.java new file mode 100755 index 00000000..93f9be02 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponse2.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Germplasm; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmResponse2 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmResponse2 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Germplasm result = null; + + public GermplasmResponse2 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmResponse2 result(Germplasm result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Germplasm getResult() { + return result; + } + + public void setResult(Germplasm result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmResponse2 germplasmResponse2 = (GermplasmResponse2) o; + return Objects.equals(this.metadata, germplasmResponse2.metadata) && + Objects.equals(this.result, germplasmResponse2.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmResponse2 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponseResult.java new file mode 100755 index 00000000..830b6a26 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Germplasm; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public GermplasmResponseResult data(List data) { + this.data = data; + return this; + } + + public GermplasmResponseResult addDataItem(Germplasm dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmResponseResult germplasmResponseResult = (GermplasmResponseResult) o; + return Objects.equals(this.data, germplasmResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSearchRequest.java new file mode 100755 index 00000000..cd53448b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSearchRequest.java @@ -0,0 +1,329 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmSearchRequest { + @SerializedName("accessionNumbers") + private List accessionNumbers = null; + + @SerializedName("commonCropNames") + private List commonCropNames = null; + + @SerializedName("germplasmDbIds") + private List germplasmDbIds = null; + + @SerializedName("germplasmGenus") + private List germplasmGenus = null; + + @SerializedName("germplasmNames") + private List germplasmNames = null; + + @SerializedName("germplasmPUIs") + private List germplasmPUIs = null; + + @SerializedName("germplasmSpecies") + private List germplasmSpecies = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + public GermplasmSearchRequest accessionNumbers(List accessionNumbers) { + this.accessionNumbers = accessionNumbers; + return this; + } + + public GermplasmSearchRequest addAccessionNumbersItem(String accessionNumbersItem) { + if (this.accessionNumbers == null) { + this.accessionNumbers = new ArrayList(); + } + this.accessionNumbers.add(accessionNumbersItem); + return this; + } + + /** + * List unique identifiers for accessions within a genebank + * @return accessionNumbers + **/ + @Schema(description = "List unique identifiers for accessions within a genebank") + public List getAccessionNumbers() { + return accessionNumbers; + } + + public void setAccessionNumbers(List accessionNumbers) { + this.accessionNumbers = accessionNumbers; + } + + public GermplasmSearchRequest commonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + return this; + } + + public GermplasmSearchRequest addCommonCropNamesItem(String commonCropNamesItem) { + if (this.commonCropNames == null) { + this.commonCropNames = new ArrayList(); + } + this.commonCropNames.add(commonCropNamesItem); + return this; + } + + /** + * List crops to search by + * @return commonCropNames + **/ + @Schema(description = "List crops to search by") + public List getCommonCropNames() { + return commonCropNames; + } + + public void setCommonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + } + + public GermplasmSearchRequest germplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + return this; + } + + public GermplasmSearchRequest addGermplasmDbIdsItem(String germplasmDbIdsItem) { + if (this.germplasmDbIds == null) { + this.germplasmDbIds = new ArrayList(); + } + this.germplasmDbIds.add(germplasmDbIdsItem); + return this; + } + + /** + * List of IDs which uniquely identify germplasm + * @return germplasmDbIds + **/ + @Schema(description = "List of IDs which uniquely identify germplasm") + public List getGermplasmDbIds() { + return germplasmDbIds; + } + + public void setGermplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + } + + public GermplasmSearchRequest germplasmGenus(List germplasmGenus) { + this.germplasmGenus = germplasmGenus; + return this; + } + + public GermplasmSearchRequest addGermplasmGenusItem(String germplasmGenusItem) { + if (this.germplasmGenus == null) { + this.germplasmGenus = new ArrayList(); + } + this.germplasmGenus.add(germplasmGenusItem); + return this; + } + + /** + * List of Genus names to identify germplasm + * @return germplasmGenus + **/ + @Schema(description = "List of Genus names to identify germplasm") + public List getGermplasmGenus() { + return germplasmGenus; + } + + public void setGermplasmGenus(List germplasmGenus) { + this.germplasmGenus = germplasmGenus; + } + + public GermplasmSearchRequest germplasmNames(List germplasmNames) { + this.germplasmNames = germplasmNames; + return this; + } + + public GermplasmSearchRequest addGermplasmNamesItem(String germplasmNamesItem) { + if (this.germplasmNames == null) { + this.germplasmNames = new ArrayList(); + } + this.germplasmNames.add(germplasmNamesItem); + return this; + } + + /** + * List of human readable names to identify germplasm + * @return germplasmNames + **/ + @Schema(description = "List of human readable names to identify germplasm") + public List getGermplasmNames() { + return germplasmNames; + } + + public void setGermplasmNames(List germplasmNames) { + this.germplasmNames = germplasmNames; + } + + public GermplasmSearchRequest germplasmPUIs(List germplasmPUIs) { + this.germplasmPUIs = germplasmPUIs; + return this; + } + + public GermplasmSearchRequest addGermplasmPUIsItem(String germplasmPUIsItem) { + if (this.germplasmPUIs == null) { + this.germplasmPUIs = new ArrayList(); + } + this.germplasmPUIs.add(germplasmPUIsItem); + return this; + } + + /** + * List of Permanent Unique Identifiers to identify germplasm + * @return germplasmPUIs + **/ + @Schema(description = "List of Permanent Unique Identifiers to identify germplasm") + public List getGermplasmPUIs() { + return germplasmPUIs; + } + + public void setGermplasmPUIs(List germplasmPUIs) { + this.germplasmPUIs = germplasmPUIs; + } + + public GermplasmSearchRequest germplasmSpecies(List germplasmSpecies) { + this.germplasmSpecies = germplasmSpecies; + return this; + } + + public GermplasmSearchRequest addGermplasmSpeciesItem(String germplasmSpeciesItem) { + if (this.germplasmSpecies == null) { + this.germplasmSpecies = new ArrayList(); + } + this.germplasmSpecies.add(germplasmSpeciesItem); + return this; + } + + /** + * List of Species names to identify germplasm + * @return germplasmSpecies + **/ + @Schema(description = "List of Species names to identify germplasm") + public List getGermplasmSpecies() { + return germplasmSpecies; + } + + public void setGermplasmSpecies(List germplasmSpecies) { + this.germplasmSpecies = germplasmSpecies; + } + + public GermplasmSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public GermplasmSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmSearchRequest germplasmSearchRequest = (GermplasmSearchRequest) o; + return Objects.equals(this.accessionNumbers, germplasmSearchRequest.accessionNumbers) && + Objects.equals(this.commonCropNames, germplasmSearchRequest.commonCropNames) && + Objects.equals(this.germplasmDbIds, germplasmSearchRequest.germplasmDbIds) && + Objects.equals(this.germplasmGenus, germplasmSearchRequest.germplasmGenus) && + Objects.equals(this.germplasmNames, germplasmSearchRequest.germplasmNames) && + Objects.equals(this.germplasmPUIs, germplasmSearchRequest.germplasmPUIs) && + Objects.equals(this.germplasmSpecies, germplasmSearchRequest.germplasmSpecies) && + Objects.equals(this.page, germplasmSearchRequest.page) && + Objects.equals(this.pageSize, germplasmSearchRequest.pageSize); + } + + @Override + public int hashCode() { + return Objects.hash(accessionNumbers, commonCropNames, germplasmDbIds, germplasmGenus, germplasmNames, germplasmPUIs, germplasmSpecies, page, pageSize); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmSearchRequest {\n"); + + sb.append(" accessionNumbers: ").append(toIndentedString(accessionNumbers)).append("\n"); + sb.append(" commonCropNames: ").append(toIndentedString(commonCropNames)).append("\n"); + sb.append(" germplasmDbIds: ").append(toIndentedString(germplasmDbIds)).append("\n"); + sb.append(" germplasmGenus: ").append(toIndentedString(germplasmGenus)).append("\n"); + sb.append(" germplasmNames: ").append(toIndentedString(germplasmNames)).append("\n"); + sb.append(" germplasmPUIs: ").append(toIndentedString(germplasmPUIs)).append("\n"); + sb.append(" germplasmSpecies: ").append(toIndentedString(germplasmSpecies)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummary.java new file mode 100755 index 00000000..121805b4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummary.java @@ -0,0 +1,676 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmDonors; +import io.swagger.client.model.TaxonID; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.LocalDate; +/** + * GermplasmSummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmSummary { + @SerializedName("accessionNumber") + private String accessionNumber = null; + + @SerializedName("acquisitionDate") + private LocalDate acquisitionDate = null; + + @SerializedName("biologicalStatusOfAccessionCode") + private Integer biologicalStatusOfAccessionCode = null; + + @SerializedName("breedingMethodDbId") + private String breedingMethodDbId = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("countryOfOriginCode") + private String countryOfOriginCode = null; + + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("donors") + private List donors = null; + + @SerializedName("entryNumber") + private String entryNumber = null; + + @SerializedName("genus") + private String genus = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("germplasmPUI") + private String germplasmPUI = null; + + @SerializedName("instituteCode") + private String instituteCode = null; + + @SerializedName("instituteName") + private String instituteName = null; + + @SerializedName("pedigree") + private String pedigree = null; + + @SerializedName("seedSource") + private String seedSource = null; + + @SerializedName("species") + private String species = null; + + @SerializedName("speciesAuthority") + private String speciesAuthority = null; + + @SerializedName("subtaxa") + private String subtaxa = null; + + @SerializedName("subtaxaAuthority") + private String subtaxaAuthority = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("taxonIds") + private List taxonIds = null; + + @SerializedName("typeOfGermplasmStorageCode") + private List typeOfGermplasmStorageCode = null; + + public GermplasmSummary accessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + return this; + } + + /** + * This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection + * @return accessionNumber + **/ + @Schema(description = "This is the unique identifier for accessions within a genebank, and is assigned when a sample is entered into the genebank collection") + public String getAccessionNumber() { + return accessionNumber; + } + + public void setAccessionNumber(String accessionNumber) { + this.accessionNumber = accessionNumber; + } + + public GermplasmSummary acquisitionDate(LocalDate acquisitionDate) { + this.acquisitionDate = acquisitionDate; + return this; + } + + /** + * The date this germplasm was aquired by the genebank (MCPD) + * @return acquisitionDate + **/ + @Schema(description = "The date this germplasm was aquired by the genebank (MCPD)") + public LocalDate getAcquisitionDate() { + return acquisitionDate; + } + + public void setAcquisitionDate(LocalDate acquisitionDate) { + this.acquisitionDate = acquisitionDate; + } + + public GermplasmSummary biologicalStatusOfAccessionCode(Integer biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + return this; + } + + /** + * The 3 digit code representing the biological status of the accession (MCPD) + * @return biologicalStatusOfAccessionCode + **/ + @Schema(description = "The 3 digit code representing the biological status of the accession (MCPD)") + public Integer getBiologicalStatusOfAccessionCode() { + return biologicalStatusOfAccessionCode; + } + + public void setBiologicalStatusOfAccessionCode(Integer biologicalStatusOfAccessionCode) { + this.biologicalStatusOfAccessionCode = biologicalStatusOfAccessionCode; + } + + public GermplasmSummary breedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + return this; + } + + /** + * The unique identifier for the breeding method used to create this germplasm + * @return breedingMethodDbId + **/ + @Schema(description = "The unique identifier for the breeding method used to create this germplasm") + public String getBreedingMethodDbId() { + return breedingMethodDbId; + } + + public void setBreedingMethodDbId(String breedingMethodDbId) { + this.breedingMethodDbId = breedingMethodDbId; + } + + public GermplasmSummary commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop (MCPD) + * @return commonCropName + **/ + @Schema(description = "Common name for the crop (MCPD)") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public GermplasmSummary countryOfOriginCode(String countryOfOriginCode) { + this.countryOfOriginCode = countryOfOriginCode; + return this; + } + + /** + * 3-letter ISO 3166-1 code of the country in which the sample was originally collected (MCPD) + * @return countryOfOriginCode + **/ + @Schema(description = "3-letter ISO 3166-1 code of the country in which the sample was originally collected (MCPD)") + public String getCountryOfOriginCode() { + return countryOfOriginCode; + } + + public void setCountryOfOriginCode(String countryOfOriginCode) { + this.countryOfOriginCode = countryOfOriginCode; + } + + public GermplasmSummary defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * Human readable name used for display purposes + * @return defaultDisplayName + **/ + @Schema(description = "Human readable name used for display purposes") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public GermplasmSummary documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public GermplasmSummary donors(List donors) { + this.donors = donors; + return this; + } + + public GermplasmSummary addDonorsItem(GermplasmDonors donorsItem) { + if (this.donors == null) { + this.donors = new ArrayList(); + } + this.donors.add(donorsItem); + return this; + } + + /** + * List of donor institutes (MCPD) + * @return donors + **/ + @Schema(description = "List of donor institutes (MCPD)") + public List getDonors() { + return donors; + } + + public void setDonors(List donors) { + this.donors = donors; + } + + public GermplasmSummary entryNumber(String entryNumber) { + this.entryNumber = entryNumber; + return this; + } + + /** + * ** Deprecated ** use /studies/{studyDbId/layout for positional germplasm relationships + * @return entryNumber + **/ + @Schema(description = "** Deprecated ** use /studies/{studyDbId/layout for positional germplasm relationships") + public String getEntryNumber() { + return entryNumber; + } + + public void setEntryNumber(String entryNumber) { + this.entryNumber = entryNumber; + } + + public GermplasmSummary genus(String genus) { + this.genus = genus; + return this; + } + + /** + * Genus name for taxon. Initial uppercase letter required. (MCPD) + * @return genus + **/ + @Schema(description = "Genus name for taxon. Initial uppercase letter required. (MCPD)") + public String getGenus() { + return genus; + } + + public void setGenus(String genus) { + this.genus = genus; + } + + public GermplasmSummary germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm within the given database server + * @return germplasmDbId + **/ + @Schema(description = "The ID which uniquely identifies a germplasm within the given database server") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public GermplasmSummary germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public GermplasmSummary germplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + return this; + } + + /** + * The Permanent Unique Identifier which represents a germplasm + * @return germplasmPUI + **/ + @Schema(description = "The Permanent Unique Identifier which represents a germplasm") + public String getGermplasmPUI() { + return germplasmPUI; + } + + public void setGermplasmPUI(String germplasmPUI) { + this.germplasmPUI = germplasmPUI; + } + + public GermplasmSummary instituteCode(String instituteCode) { + this.instituteCode = instituteCode; + return this; + } + + /** + * The code for the Institute that has bred the material. (MCPD) + * @return instituteCode + **/ + @Schema(description = "The code for the Institute that has bred the material. (MCPD)") + public String getInstituteCode() { + return instituteCode; + } + + public void setInstituteCode(String instituteCode) { + this.instituteCode = instituteCode; + } + + public GermplasmSummary instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * The name of the institution which bred the material (MCPD) + * @return instituteName + **/ + @Schema(description = "The name of the institution which bred the material (MCPD)") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + public GermplasmSummary pedigree(String pedigree) { + this.pedigree = pedigree; + return this; + } + + /** + * The cross name and optional selection history. + * @return pedigree + **/ + @Schema(description = "The cross name and optional selection history.") + public String getPedigree() { + return pedigree; + } + + public void setPedigree(String pedigree) { + this.pedigree = pedigree; + } + + public GermplasmSummary seedSource(String seedSource) { + this.seedSource = seedSource; + return this; + } + + /** + * The source of the seed + * @return seedSource + **/ + @Schema(description = "The source of the seed ") + public String getSeedSource() { + return seedSource; + } + + public void setSeedSource(String seedSource) { + this.seedSource = seedSource; + } + + public GermplasmSummary species(String species) { + this.species = species; + return this; + } + + /** + * Specific epithet portion of the scientific name in lowercase letters. (MCPD) + * @return species + **/ + @Schema(description = "Specific epithet portion of the scientific name in lowercase letters. (MCPD)") + public String getSpecies() { + return species; + } + + public void setSpecies(String species) { + this.species = species; + } + + public GermplasmSummary speciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + return this; + } + + /** + * The authority organization responsible for tracking and maintaining the species name (MCPD) + * @return speciesAuthority + **/ + @Schema(description = "The authority organization responsible for tracking and maintaining the species name (MCPD)") + public String getSpeciesAuthority() { + return speciesAuthority; + } + + public void setSpeciesAuthority(String speciesAuthority) { + this.speciesAuthority = speciesAuthority; + } + + public GermplasmSummary subtaxa(String subtaxa) { + this.subtaxa = subtaxa; + return this; + } + + /** + * Subtaxon can be used to store any additional taxonomic identifier. (MCPD) + * @return subtaxa + **/ + @Schema(description = "Subtaxon can be used to store any additional taxonomic identifier. (MCPD)") + public String getSubtaxa() { + return subtaxa; + } + + public void setSubtaxa(String subtaxa) { + this.subtaxa = subtaxa; + } + + public GermplasmSummary subtaxaAuthority(String subtaxaAuthority) { + this.subtaxaAuthority = subtaxaAuthority; + return this; + } + + /** + * The authority organization responsible for tracking and maintaining the subtaxon information (MCPD) + * @return subtaxaAuthority + **/ + @Schema(description = " The authority organization responsible for tracking and maintaining the subtaxon information (MCPD)") + public String getSubtaxaAuthority() { + return subtaxaAuthority; + } + + public void setSubtaxaAuthority(String subtaxaAuthority) { + this.subtaxaAuthority = subtaxaAuthority; + } + + public GermplasmSummary synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public GermplasmSummary addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * List of alternative names or IDs used to reference this germplasm + * @return synonyms + **/ + @Schema(description = "List of alternative names or IDs used to reference this germplasm") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public GermplasmSummary taxonIds(List taxonIds) { + this.taxonIds = taxonIds; + return this; + } + + public GermplasmSummary addTaxonIdsItem(TaxonID taxonIdsItem) { + if (this.taxonIds == null) { + this.taxonIds = new ArrayList(); + } + this.taxonIds.add(taxonIdsItem); + return this; + } + + /** + * The list of IDs for this SPECIES from different sources. If present, NCBI Taxon should be always listed as \"ncbiTaxon\" preferably with a purl. The rank of this ID should be species. + * @return taxonIds + **/ + @Schema(description = "The list of IDs for this SPECIES from different sources. If present, NCBI Taxon should be always listed as \"ncbiTaxon\" preferably with a purl. The rank of this ID should be species.") + public List getTaxonIds() { + return taxonIds; + } + + public void setTaxonIds(List taxonIds) { + this.taxonIds = taxonIds; + } + + public GermplasmSummary typeOfGermplasmStorageCode(List typeOfGermplasmStorageCode) { + this.typeOfGermplasmStorageCode = typeOfGermplasmStorageCode; + return this; + } + + public GermplasmSummary addTypeOfGermplasmStorageCodeItem(String typeOfGermplasmStorageCodeItem) { + if (this.typeOfGermplasmStorageCode == null) { + this.typeOfGermplasmStorageCode = new ArrayList(); + } + this.typeOfGermplasmStorageCode.add(typeOfGermplasmStorageCodeItem); + return this; + } + + /** + * The 2 digit code representing the type of storage this germplasm is kept in at a genebank. (MCPD) + * @return typeOfGermplasmStorageCode + **/ + @Schema(description = "The 2 digit code representing the type of storage this germplasm is kept in at a genebank. (MCPD)") + public List getTypeOfGermplasmStorageCode() { + return typeOfGermplasmStorageCode; + } + + public void setTypeOfGermplasmStorageCode(List typeOfGermplasmStorageCode) { + this.typeOfGermplasmStorageCode = typeOfGermplasmStorageCode; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmSummary germplasmSummary = (GermplasmSummary) o; + return Objects.equals(this.accessionNumber, germplasmSummary.accessionNumber) && + Objects.equals(this.acquisitionDate, germplasmSummary.acquisitionDate) && + Objects.equals(this.biologicalStatusOfAccessionCode, germplasmSummary.biologicalStatusOfAccessionCode) && + Objects.equals(this.breedingMethodDbId, germplasmSummary.breedingMethodDbId) && + Objects.equals(this.commonCropName, germplasmSummary.commonCropName) && + Objects.equals(this.countryOfOriginCode, germplasmSummary.countryOfOriginCode) && + Objects.equals(this.defaultDisplayName, germplasmSummary.defaultDisplayName) && + Objects.equals(this.documentationURL, germplasmSummary.documentationURL) && + Objects.equals(this.donors, germplasmSummary.donors) && + Objects.equals(this.entryNumber, germplasmSummary.entryNumber) && + Objects.equals(this.genus, germplasmSummary.genus) && + Objects.equals(this.germplasmDbId, germplasmSummary.germplasmDbId) && + Objects.equals(this.germplasmName, germplasmSummary.germplasmName) && + Objects.equals(this.germplasmPUI, germplasmSummary.germplasmPUI) && + Objects.equals(this.instituteCode, germplasmSummary.instituteCode) && + Objects.equals(this.instituteName, germplasmSummary.instituteName) && + Objects.equals(this.pedigree, germplasmSummary.pedigree) && + Objects.equals(this.seedSource, germplasmSummary.seedSource) && + Objects.equals(this.species, germplasmSummary.species) && + Objects.equals(this.speciesAuthority, germplasmSummary.speciesAuthority) && + Objects.equals(this.subtaxa, germplasmSummary.subtaxa) && + Objects.equals(this.subtaxaAuthority, germplasmSummary.subtaxaAuthority) && + Objects.equals(this.synonyms, germplasmSummary.synonyms) && + Objects.equals(this.taxonIds, germplasmSummary.taxonIds) && + Objects.equals(this.typeOfGermplasmStorageCode, germplasmSummary.typeOfGermplasmStorageCode); + } + + @Override + public int hashCode() { + return Objects.hash(accessionNumber, acquisitionDate, biologicalStatusOfAccessionCode, breedingMethodDbId, commonCropName, countryOfOriginCode, defaultDisplayName, documentationURL, donors, entryNumber, genus, germplasmDbId, germplasmName, germplasmPUI, instituteCode, instituteName, pedigree, seedSource, species, speciesAuthority, subtaxa, subtaxaAuthority, synonyms, taxonIds, typeOfGermplasmStorageCode); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmSummary {\n"); + + sb.append(" accessionNumber: ").append(toIndentedString(accessionNumber)).append("\n"); + sb.append(" acquisitionDate: ").append(toIndentedString(acquisitionDate)).append("\n"); + sb.append(" biologicalStatusOfAccessionCode: ").append(toIndentedString(biologicalStatusOfAccessionCode)).append("\n"); + sb.append(" breedingMethodDbId: ").append(toIndentedString(breedingMethodDbId)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" countryOfOriginCode: ").append(toIndentedString(countryOfOriginCode)).append("\n"); + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" donors: ").append(toIndentedString(donors)).append("\n"); + sb.append(" entryNumber: ").append(toIndentedString(entryNumber)).append("\n"); + sb.append(" genus: ").append(toIndentedString(genus)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" germplasmPUI: ").append(toIndentedString(germplasmPUI)).append("\n"); + sb.append(" instituteCode: ").append(toIndentedString(instituteCode)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).append("\n"); + sb.append(" pedigree: ").append(toIndentedString(pedigree)).append("\n"); + sb.append(" seedSource: ").append(toIndentedString(seedSource)).append("\n"); + sb.append(" species: ").append(toIndentedString(species)).append("\n"); + sb.append(" speciesAuthority: ").append(toIndentedString(speciesAuthority)).append("\n"); + sb.append(" subtaxa: ").append(toIndentedString(subtaxa)).append("\n"); + sb.append(" subtaxaAuthority: ").append(toIndentedString(subtaxaAuthority)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" taxonIds: ").append(toIndentedString(taxonIds)).append("\n"); + sb.append(" typeOfGermplasmStorageCode: ").append(toIndentedString(typeOfGermplasmStorageCode)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryList.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryList.java new file mode 100755 index 00000000..56ef095a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryList.java @@ -0,0 +1,144 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmSummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * GermplasmSummaryList + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmSummaryList { + @SerializedName("data") + private List data = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public GermplasmSummaryList data(List data) { + this.data = data; + return this; + } + + public GermplasmSummaryList addDataItem(GermplasmSummary dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of germplasm associated with a given trial and study + * @return data + **/ + @Schema(description = "List of germplasm associated with a given trial and study") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public GermplasmSummaryList studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * ** Deprecated ** The request contains the studyDbId The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "** Deprecated ** The request contains the studyDbId The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public GermplasmSummaryList trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * ** Deprecated ** trialName not relevent The human readable name of a trial + * @return trialName + **/ + @Schema(description = "** Deprecated ** trialName not relevent The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmSummaryList germplasmSummaryList = (GermplasmSummaryList) o; + return Objects.equals(this.data, germplasmSummaryList.data) && + Objects.equals(this.studyDbId, germplasmSummaryList.studyDbId) && + Objects.equals(this.trialName, germplasmSummaryList.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(data, studyDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmSummaryList {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryListResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryListResponse.java new file mode 100755 index 00000000..46051edd --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/GermplasmSummaryListResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GermplasmSummaryList; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * GermplasmSummaryListResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class GermplasmSummaryListResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GermplasmSummaryList result = null; + + public GermplasmSummaryListResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public GermplasmSummaryListResponse result(GermplasmSummaryList result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GermplasmSummaryList getResult() { + return result; + } + + public void setResult(GermplasmSummaryList result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GermplasmSummaryListResponse germplasmSummaryListResponse = (GermplasmSummaryListResponse) o; + return Objects.equals(this.metadata, germplasmSummaryListResponse.metadata) && + Objects.equals(this.result, germplasmSummaryListResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GermplasmSummaryListResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Image.java b/brapi-client/src/main/resources/swagger-generated-client/model/Image.java new file mode 100755 index 00000000..b58aecc3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Image.java @@ -0,0 +1,462 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GeoJSON; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * Image + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Image { + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("copyright") + private String copyright = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("descriptiveOntologyTerms") + private List descriptiveOntologyTerms = null; + + @SerializedName("imageDbId") + private String imageDbId = null; + + @SerializedName("imageFileName") + private String imageFileName = null; + + @SerializedName("imageFileSize") + private Integer imageFileSize = null; + + @SerializedName("imageHeight") + private Integer imageHeight = null; + + @SerializedName("imageLocation") + private GeoJSON imageLocation = null; + + @SerializedName("imageName") + private String imageName = null; + + @SerializedName("imageTimeStamp") + private LocalDate imageTimeStamp = null; + + @SerializedName("imageURL") + private String imageURL = null; + + @SerializedName("imageWidth") + private Integer imageWidth = null; + + @SerializedName("mimeType") + private String mimeType = null; + + @SerializedName("observationDbIds") + private List observationDbIds = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + public Image additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public Image putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Get additionalInfo + * @return additionalInfo + **/ + @Schema(description = "") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public Image copyright(String copyright) { + this.copyright = copyright; + return this; + } + + /** + * The copyright information of this image. Example 'Copyright 2018 Bob Robertson' + * @return copyright + **/ + @Schema(description = "The copyright information of this image. Example 'Copyright 2018 Bob Robertson'") + public String getCopyright() { + return copyright; + } + + public void setCopyright(String copyright) { + this.copyright = copyright; + } + + public Image description(String description) { + this.description = description; + return this; + } + + /** + * The human readable description of an image. + * @return description + **/ + @Schema(description = "The human readable description of an image.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Image descriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + return this; + } + + public Image addDescriptiveOntologyTermsItem(String descriptiveOntologyTermsItem) { + if (this.descriptiveOntologyTerms == null) { + this.descriptiveOntologyTerms = new ArrayList(); + } + this.descriptiveOntologyTerms.add(descriptiveOntologyTermsItem); + return this; + } + + /** + * A list of terms to formally describe the image. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL. + * @return descriptiveOntologyTerms + **/ + @Schema(description = "A list of terms to formally describe the image. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL.") + public List getDescriptiveOntologyTerms() { + return descriptiveOntologyTerms; + } + + public void setDescriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + } + + public Image imageDbId(String imageDbId) { + this.imageDbId = imageDbId; + return this; + } + + /** + * The unique identifier of an image + * @return imageDbId + **/ + @Schema(description = "The unique identifier of an image") + public String getImageDbId() { + return imageDbId; + } + + public void setImageDbId(String imageDbId) { + this.imageDbId = imageDbId; + } + + public Image imageFileName(String imageFileName) { + this.imageFileName = imageFileName; + return this; + } + + /** + * The name of the image file. Might be the same as 'imageName', but could be different. + * @return imageFileName + **/ + @Schema(description = "The name of the image file. Might be the same as 'imageName', but could be different.") + public String getImageFileName() { + return imageFileName; + } + + public void setImageFileName(String imageFileName) { + this.imageFileName = imageFileName; + } + + public Image imageFileSize(Integer imageFileSize) { + this.imageFileSize = imageFileSize; + return this; + } + + /** + * The size of the image in Bytes. + * @return imageFileSize + **/ + @Schema(description = "The size of the image in Bytes.") + public Integer getImageFileSize() { + return imageFileSize; + } + + public void setImageFileSize(Integer imageFileSize) { + this.imageFileSize = imageFileSize; + } + + public Image imageHeight(Integer imageHeight) { + this.imageHeight = imageHeight; + return this; + } + + /** + * The height of the image in Pixels. + * @return imageHeight + **/ + @Schema(description = "The height of the image in Pixels.") + public Integer getImageHeight() { + return imageHeight; + } + + public void setImageHeight(Integer imageHeight) { + this.imageHeight = imageHeight; + } + + public Image imageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + return this; + } + + /** + * Get imageLocation + * @return imageLocation + **/ + @Schema(description = "") + public GeoJSON getImageLocation() { + return imageLocation; + } + + public void setImageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + } + + public Image imageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * The human readable name of an image. Might be the same as 'imageFileName', but could be different. + * @return imageName + **/ + @Schema(description = "The human readable name of an image. Might be the same as 'imageFileName', but could be different.") + public String getImageName() { + return imageName; + } + + public void setImageName(String imageName) { + this.imageName = imageName; + } + + public Image imageTimeStamp(LocalDate imageTimeStamp) { + this.imageTimeStamp = imageTimeStamp; + return this; + } + + /** + * The date and time the image was taken + * @return imageTimeStamp + **/ + @Schema(description = "The date and time the image was taken") + public LocalDate getImageTimeStamp() { + return imageTimeStamp; + } + + public void setImageTimeStamp(LocalDate imageTimeStamp) { + this.imageTimeStamp = imageTimeStamp; + } + + public Image imageURL(String imageURL) { + this.imageURL = imageURL; + return this; + } + + /** + * The complete, absolute URI path to the image file. Images might be stored on a different host or path than the BrAPI web server. + * @return imageURL + **/ + @Schema(description = "The complete, absolute URI path to the image file. Images might be stored on a different host or path than the BrAPI web server.") + public String getImageURL() { + return imageURL; + } + + public void setImageURL(String imageURL) { + this.imageURL = imageURL; + } + + public Image imageWidth(Integer imageWidth) { + this.imageWidth = imageWidth; + return this; + } + + /** + * The width of the image in Pixels. + * @return imageWidth + **/ + @Schema(description = "The width of the image in Pixels.") + public Integer getImageWidth() { + return imageWidth; + } + + public void setImageWidth(Integer imageWidth) { + this.imageWidth = imageWidth; + } + + public Image mimeType(String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * The file type of the image. Examples 'image/jpeg', 'image/png', 'image/svg', etc + * @return mimeType + **/ + @Schema(description = "The file type of the image. Examples 'image/jpeg', 'image/png', 'image/svg', etc") + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public Image observationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + return this; + } + + public Image addObservationDbIdsItem(String observationDbIdsItem) { + if (this.observationDbIds == null) { + this.observationDbIds = new ArrayList(); + } + this.observationDbIds.add(observationDbIdsItem); + return this; + } + + /** + * A list of observation Ids this image is associated with, if applicable. + * @return observationDbIds + **/ + @Schema(description = "A list of observation Ids this image is associated with, if applicable.") + public List getObservationDbIds() { + return observationDbIds; + } + + public void setObservationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + } + + public Image observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The related observation unit identifier, if relevent. + * @return observationUnitDbId + **/ + @Schema(description = "The related observation unit identifier, if relevent.") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Image image = (Image) o; + return Objects.equals(this.additionalInfo, image.additionalInfo) && + Objects.equals(this.copyright, image.copyright) && + Objects.equals(this.description, image.description) && + Objects.equals(this.descriptiveOntologyTerms, image.descriptiveOntologyTerms) && + Objects.equals(this.imageDbId, image.imageDbId) && + Objects.equals(this.imageFileName, image.imageFileName) && + Objects.equals(this.imageFileSize, image.imageFileSize) && + Objects.equals(this.imageHeight, image.imageHeight) && + Objects.equals(this.imageLocation, image.imageLocation) && + Objects.equals(this.imageName, image.imageName) && + Objects.equals(this.imageTimeStamp, image.imageTimeStamp) && + Objects.equals(this.imageURL, image.imageURL) && + Objects.equals(this.imageWidth, image.imageWidth) && + Objects.equals(this.mimeType, image.mimeType) && + Objects.equals(this.observationDbIds, image.observationDbIds) && + Objects.equals(this.observationUnitDbId, image.observationUnitDbId); + } + + @Override + public int hashCode() { + return Objects.hash(additionalInfo, copyright, description, descriptiveOntologyTerms, imageDbId, imageFileName, imageFileSize, imageHeight, imageLocation, imageName, imageTimeStamp, imageURL, imageWidth, mimeType, observationDbIds, observationUnitDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Image {\n"); + + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" copyright: ").append(toIndentedString(copyright)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" descriptiveOntologyTerms: ").append(toIndentedString(descriptiveOntologyTerms)).append("\n"); + sb.append(" imageDbId: ").append(toIndentedString(imageDbId)).append("\n"); + sb.append(" imageFileName: ").append(toIndentedString(imageFileName)).append("\n"); + sb.append(" imageFileSize: ").append(toIndentedString(imageFileSize)).append("\n"); + sb.append(" imageHeight: ").append(toIndentedString(imageHeight)).append("\n"); + sb.append(" imageLocation: ").append(toIndentedString(imageLocation)).append("\n"); + sb.append(" imageName: ").append(toIndentedString(imageName)).append("\n"); + sb.append(" imageTimeStamp: ").append(toIndentedString(imageTimeStamp)).append("\n"); + sb.append(" imageURL: ").append(toIndentedString(imageURL)).append("\n"); + sb.append(" imageWidth: ").append(toIndentedString(imageWidth)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" observationDbIds: ").append(toIndentedString(observationDbIds)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ImageResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ImageResponse.java new file mode 100755 index 00000000..e3449ae5 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ImageResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Image; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ImageResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ImageResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Image result = null; + + public ImageResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ImageResponse result(Image result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Image getResult() { + return result; + } + + public void setResult(Image result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageResponse imageResponse = (ImageResponse) o; + return Objects.equals(this.metadata, imageResponse.metadata) && + Objects.equals(this.result, imageResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponse.java new file mode 100755 index 00000000..c1997a4e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ImagesResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ImagesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ImagesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ImagesResponseResult result = null; + + public ImagesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ImagesResponse result(ImagesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ImagesResponseResult getResult() { + return result; + } + + public void setResult(ImagesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagesResponse imagesResponse = (ImagesResponse) o; + return Objects.equals(this.metadata, imagesResponse.metadata) && + Objects.equals(this.result, imagesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponseResult.java new file mode 100755 index 00000000..0679ccde --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Image; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ImagesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ImagesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ImagesResponseResult data(List data) { + this.data = data; + return this; + } + + public ImagesResponseResult addDataItem(Image dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Array of image meta data + * @return data + **/ + @Schema(required = true, description = "Array of image meta data") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagesResponseResult imagesResponseResult = (ImagesResponseResult) o; + return Objects.equals(this.data, imagesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ImagesSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesSearchRequest.java new file mode 100755 index 00000000..74cb7cd4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ImagesSearchRequest.java @@ -0,0 +1,461 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GeoJSON; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.LocalDate; +/** + * ImagesSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ImagesSearchRequest { + @SerializedName("descriptiveOntologyTerms") + private List descriptiveOntologyTerms = null; + + @SerializedName("imageFileNames") + private List imageFileNames = null; + + @SerializedName("imageFileSizeMax") + private Integer imageFileSizeMax = null; + + @SerializedName("imageFileSizeMin") + private Integer imageFileSizeMin = null; + + @SerializedName("imageHeightMax") + private Integer imageHeightMax = null; + + @SerializedName("imageHeightMin") + private Integer imageHeightMin = null; + + @SerializedName("imageLocation") + private GeoJSON imageLocation = null; + + @SerializedName("imageNames") + private List imageNames = null; + + @SerializedName("imageTimeStampRangeEnd") + private LocalDate imageTimeStampRangeEnd = null; + + @SerializedName("imageTimeStampRangeStart") + private LocalDate imageTimeStampRangeStart = null; + + @SerializedName("imageWidthMax") + private Integer imageWidthMax = null; + + @SerializedName("imageWidthMin") + private Integer imageWidthMin = null; + + @SerializedName("mimeTypes") + private List mimeTypes = null; + + @SerializedName("observationDbIds") + private List observationDbIds = null; + + @SerializedName("observationUnitDbIds") + private List observationUnitDbIds = null; + + public ImagesSearchRequest descriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + return this; + } + + public ImagesSearchRequest addDescriptiveOntologyTermsItem(String descriptiveOntologyTermsItem) { + if (this.descriptiveOntologyTerms == null) { + this.descriptiveOntologyTerms = new ArrayList(); + } + this.descriptiveOntologyTerms.add(descriptiveOntologyTermsItem); + return this; + } + + /** + * A list of terms to formally describe the image to search for. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL. + * @return descriptiveOntologyTerms + **/ + @Schema(description = "A list of terms to formally describe the image to search for. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL.") + public List getDescriptiveOntologyTerms() { + return descriptiveOntologyTerms; + } + + public void setDescriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + } + + public ImagesSearchRequest imageFileNames(List imageFileNames) { + this.imageFileNames = imageFileNames; + return this; + } + + public ImagesSearchRequest addImageFileNamesItem(String imageFileNamesItem) { + if (this.imageFileNames == null) { + this.imageFileNames = new ArrayList(); + } + this.imageFileNames.add(imageFileNamesItem); + return this; + } + + /** + * Image file names to search for. + * @return imageFileNames + **/ + @Schema(description = "Image file names to search for.") + public List getImageFileNames() { + return imageFileNames; + } + + public void setImageFileNames(List imageFileNames) { + this.imageFileNames = imageFileNames; + } + + public ImagesSearchRequest imageFileSizeMax(Integer imageFileSizeMax) { + this.imageFileSizeMax = imageFileSizeMax; + return this; + } + + /** + * A maximum image file size to search for. + * @return imageFileSizeMax + **/ + @Schema(description = "A maximum image file size to search for.") + public Integer getImageFileSizeMax() { + return imageFileSizeMax; + } + + public void setImageFileSizeMax(Integer imageFileSizeMax) { + this.imageFileSizeMax = imageFileSizeMax; + } + + public ImagesSearchRequest imageFileSizeMin(Integer imageFileSizeMin) { + this.imageFileSizeMin = imageFileSizeMin; + return this; + } + + /** + * A minimum image file size to search for. + * @return imageFileSizeMin + **/ + @Schema(description = "A minimum image file size to search for.") + public Integer getImageFileSizeMin() { + return imageFileSizeMin; + } + + public void setImageFileSizeMin(Integer imageFileSizeMin) { + this.imageFileSizeMin = imageFileSizeMin; + } + + public ImagesSearchRequest imageHeightMax(Integer imageHeightMax) { + this.imageHeightMax = imageHeightMax; + return this; + } + + /** + * A maximum image height to search for. + * @return imageHeightMax + **/ + @Schema(description = "A maximum image height to search for.") + public Integer getImageHeightMax() { + return imageHeightMax; + } + + public void setImageHeightMax(Integer imageHeightMax) { + this.imageHeightMax = imageHeightMax; + } + + public ImagesSearchRequest imageHeightMin(Integer imageHeightMin) { + this.imageHeightMin = imageHeightMin; + return this; + } + + /** + * A minimum image height to search for. + * @return imageHeightMin + **/ + @Schema(description = "A minimum image height to search for.") + public Integer getImageHeightMin() { + return imageHeightMin; + } + + public void setImageHeightMin(Integer imageHeightMin) { + this.imageHeightMin = imageHeightMin; + } + + public ImagesSearchRequest imageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + return this; + } + + /** + * Get imageLocation + * @return imageLocation + **/ + @Schema(description = "") + public GeoJSON getImageLocation() { + return imageLocation; + } + + public void setImageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + } + + public ImagesSearchRequest imageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + public ImagesSearchRequest addImageNamesItem(String imageNamesItem) { + if (this.imageNames == null) { + this.imageNames = new ArrayList(); + } + this.imageNames.add(imageNamesItem); + return this; + } + + /** + * Human readable names to search for. + * @return imageNames + **/ + @Schema(description = "Human readable names to search for.") + public List getImageNames() { + return imageNames; + } + + public void setImageNames(List imageNames) { + this.imageNames = imageNames; + } + + public ImagesSearchRequest imageTimeStampRangeEnd(LocalDate imageTimeStampRangeEnd) { + this.imageTimeStampRangeEnd = imageTimeStampRangeEnd; + return this; + } + + /** + * The latest timestamp to search for. + * @return imageTimeStampRangeEnd + **/ + @Schema(description = "The latest timestamp to search for.") + public LocalDate getImageTimeStampRangeEnd() { + return imageTimeStampRangeEnd; + } + + public void setImageTimeStampRangeEnd(LocalDate imageTimeStampRangeEnd) { + this.imageTimeStampRangeEnd = imageTimeStampRangeEnd; + } + + public ImagesSearchRequest imageTimeStampRangeStart(LocalDate imageTimeStampRangeStart) { + this.imageTimeStampRangeStart = imageTimeStampRangeStart; + return this; + } + + /** + * The earliest timestamp to search for. + * @return imageTimeStampRangeStart + **/ + @Schema(description = "The earliest timestamp to search for.") + public LocalDate getImageTimeStampRangeStart() { + return imageTimeStampRangeStart; + } + + public void setImageTimeStampRangeStart(LocalDate imageTimeStampRangeStart) { + this.imageTimeStampRangeStart = imageTimeStampRangeStart; + } + + public ImagesSearchRequest imageWidthMax(Integer imageWidthMax) { + this.imageWidthMax = imageWidthMax; + return this; + } + + /** + * A maximum image width to search for. + * @return imageWidthMax + **/ + @Schema(description = "A maximum image width to search for.") + public Integer getImageWidthMax() { + return imageWidthMax; + } + + public void setImageWidthMax(Integer imageWidthMax) { + this.imageWidthMax = imageWidthMax; + } + + public ImagesSearchRequest imageWidthMin(Integer imageWidthMin) { + this.imageWidthMin = imageWidthMin; + return this; + } + + /** + * A minimum image width to search for. + * @return imageWidthMin + **/ + @Schema(description = "A minimum image width to search for.") + public Integer getImageWidthMin() { + return imageWidthMin; + } + + public void setImageWidthMin(Integer imageWidthMin) { + this.imageWidthMin = imageWidthMin; + } + + public ImagesSearchRequest mimeTypes(List mimeTypes) { + this.mimeTypes = mimeTypes; + return this; + } + + public ImagesSearchRequest addMimeTypesItem(String mimeTypesItem) { + if (this.mimeTypes == null) { + this.mimeTypes = new ArrayList(); + } + this.mimeTypes.add(mimeTypesItem); + return this; + } + + /** + * A set of image file types to search for. + * @return mimeTypes + **/ + @Schema(description = "A set of image file types to search for.") + public List getMimeTypes() { + return mimeTypes; + } + + public void setMimeTypes(List mimeTypes) { + this.mimeTypes = mimeTypes; + } + + public ImagesSearchRequest observationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + return this; + } + + public ImagesSearchRequest addObservationDbIdsItem(String observationDbIdsItem) { + if (this.observationDbIds == null) { + this.observationDbIds = new ArrayList(); + } + this.observationDbIds.add(observationDbIdsItem); + return this; + } + + /** + * A list of observation Ids this image is associated with to search for + * @return observationDbIds + **/ + @Schema(description = "A list of observation Ids this image is associated with to search for") + public List getObservationDbIds() { + return observationDbIds; + } + + public void setObservationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + } + + public ImagesSearchRequest observationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + return this; + } + + public ImagesSearchRequest addObservationUnitDbIdsItem(String observationUnitDbIdsItem) { + if (this.observationUnitDbIds == null) { + this.observationUnitDbIds = new ArrayList(); + } + this.observationUnitDbIds.add(observationUnitDbIdsItem); + return this; + } + + /** + * A set of observation unit identifiers to search for. + * @return observationUnitDbIds + **/ + @Schema(description = "A set of observation unit identifiers to search for.") + public List getObservationUnitDbIds() { + return observationUnitDbIds; + } + + public void setObservationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagesSearchRequest imagesSearchRequest = (ImagesSearchRequest) o; + return Objects.equals(this.descriptiveOntologyTerms, imagesSearchRequest.descriptiveOntologyTerms) && + Objects.equals(this.imageFileNames, imagesSearchRequest.imageFileNames) && + Objects.equals(this.imageFileSizeMax, imagesSearchRequest.imageFileSizeMax) && + Objects.equals(this.imageFileSizeMin, imagesSearchRequest.imageFileSizeMin) && + Objects.equals(this.imageHeightMax, imagesSearchRequest.imageHeightMax) && + Objects.equals(this.imageHeightMin, imagesSearchRequest.imageHeightMin) && + Objects.equals(this.imageLocation, imagesSearchRequest.imageLocation) && + Objects.equals(this.imageNames, imagesSearchRequest.imageNames) && + Objects.equals(this.imageTimeStampRangeEnd, imagesSearchRequest.imageTimeStampRangeEnd) && + Objects.equals(this.imageTimeStampRangeStart, imagesSearchRequest.imageTimeStampRangeStart) && + Objects.equals(this.imageWidthMax, imagesSearchRequest.imageWidthMax) && + Objects.equals(this.imageWidthMin, imagesSearchRequest.imageWidthMin) && + Objects.equals(this.mimeTypes, imagesSearchRequest.mimeTypes) && + Objects.equals(this.observationDbIds, imagesSearchRequest.observationDbIds) && + Objects.equals(this.observationUnitDbIds, imagesSearchRequest.observationUnitDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(descriptiveOntologyTerms, imageFileNames, imageFileSizeMax, imageFileSizeMin, imageHeightMax, imageHeightMin, imageLocation, imageNames, imageTimeStampRangeEnd, imageTimeStampRangeStart, imageWidthMax, imageWidthMin, mimeTypes, observationDbIds, observationUnitDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagesSearchRequest {\n"); + + sb.append(" descriptiveOntologyTerms: ").append(toIndentedString(descriptiveOntologyTerms)).append("\n"); + sb.append(" imageFileNames: ").append(toIndentedString(imageFileNames)).append("\n"); + sb.append(" imageFileSizeMax: ").append(toIndentedString(imageFileSizeMax)).append("\n"); + sb.append(" imageFileSizeMin: ").append(toIndentedString(imageFileSizeMin)).append("\n"); + sb.append(" imageHeightMax: ").append(toIndentedString(imageHeightMax)).append("\n"); + sb.append(" imageHeightMin: ").append(toIndentedString(imageHeightMin)).append("\n"); + sb.append(" imageLocation: ").append(toIndentedString(imageLocation)).append("\n"); + sb.append(" imageNames: ").append(toIndentedString(imageNames)).append("\n"); + sb.append(" imageTimeStampRangeEnd: ").append(toIndentedString(imageTimeStampRangeEnd)).append("\n"); + sb.append(" imageTimeStampRangeStart: ").append(toIndentedString(imageTimeStampRangeStart)).append("\n"); + sb.append(" imageWidthMax: ").append(toIndentedString(imageWidthMax)).append("\n"); + sb.append(" imageWidthMin: ").append(toIndentedString(imageWidthMin)).append("\n"); + sb.append(" mimeTypes: ").append(toIndentedString(mimeTypes)).append("\n"); + sb.append(" observationDbIds: ").append(toIndentedString(observationDbIds)).append("\n"); + sb.append(" observationUnitDbIds: ").append(toIndentedString(observationUnitDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/LinearRing.java b/brapi-client/src/main/resources/swagger-generated-client/model/LinearRing.java new file mode 100755 index 00000000..b65a25eb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/LinearRing.java @@ -0,0 +1,65 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import io.swagger.client.model.Position; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; + +/** + * An array of at least four positions where the first equals the last + */ +@Schema(description = "An array of at least four positions where the first equals the last") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class LinearRing extends ArrayList { + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinearRing {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/LinkageGroup.java b/brapi-client/src/main/resources/swagger-generated-client/model/LinkageGroup.java new file mode 100755 index 00000000..477c4d51 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/LinkageGroup.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * LinkageGroup + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class LinkageGroup { + @SerializedName("linkageGroupName") + private String linkageGroupName = null; + + @SerializedName("markerCount") + private Integer markerCount = null; + + @SerializedName("maxPosition") + private Integer maxPosition = null; + + public LinkageGroup linkageGroupName(String linkageGroupName) { + this.linkageGroupName = linkageGroupName; + return this; + } + + /** + * The Uniquely Identifiable name of this linkage group + * @return linkageGroupName + **/ + @Schema(description = "The Uniquely Identifiable name of this linkage group") + public String getLinkageGroupName() { + return linkageGroupName; + } + + public void setLinkageGroupName(String linkageGroupName) { + this.linkageGroupName = linkageGroupName; + } + + public LinkageGroup markerCount(Integer markerCount) { + this.markerCount = markerCount; + return this; + } + + /** + * The number of markers associated with this linkage group + * @return markerCount + **/ + @Schema(description = "The number of markers associated with this linkage group") + public Integer getMarkerCount() { + return markerCount; + } + + public void setMarkerCount(Integer markerCount) { + this.markerCount = markerCount; + } + + public LinkageGroup maxPosition(Integer maxPosition) { + this.maxPosition = maxPosition; + return this; + } + + /** + * The maximum position of a marker within this linkage group + * @return maxPosition + **/ + @Schema(description = "The maximum position of a marker within this linkage group") + public Integer getMaxPosition() { + return maxPosition; + } + + public void setMaxPosition(Integer maxPosition) { + this.maxPosition = maxPosition; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkageGroup linkageGroup = (LinkageGroup) o; + return Objects.equals(this.linkageGroupName, linkageGroup.linkageGroupName) && + Objects.equals(this.markerCount, linkageGroup.markerCount) && + Objects.equals(this.maxPosition, linkageGroup.maxPosition); + } + + @Override + public int hashCode() { + return Objects.hash(linkageGroupName, markerCount, maxPosition); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LinkageGroup {\n"); + + sb.append(" linkageGroupName: ").append(toIndentedString(linkageGroupName)).append("\n"); + sb.append(" markerCount: ").append(toIndentedString(markerCount)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListDetails.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListDetails.java new file mode 100755 index 00000000..279c68f2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListDetails.java @@ -0,0 +1,101 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListSummary; +import io.swagger.client.model.ListTypes; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.OffsetDateTime; +/** + * ListDetails + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ListDetails extends ListSummary { + @SerializedName("data") + private List data = null; + + public ListDetails data(List data) { + this.data = data; + return this; + } + + public ListDetails addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDetails listDetails = (ListDetails) o; + return Objects.equals(this.data, listDetails.data) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(data, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListDetails {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListResponse.java new file mode 100755 index 00000000..f0ccf0e8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListDetails; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ListResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ListResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ListDetails result = null; + + public ListResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ListResponse result(ListDetails result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ListDetails getResult() { + return result; + } + + public void setResult(ListDetails result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListResponse listResponse = (ListResponse) o; + return Objects.equals(this.metadata, listResponse.metadata) && + Objects.equals(this.result, listResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListSummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummary.java new file mode 100755 index 00000000..a4f885b4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummary.java @@ -0,0 +1,295 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListTypes; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * ListSummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ListSummary { + @SerializedName("dateCreated") + private OffsetDateTime dateCreated = null; + + @SerializedName("dateModified") + private OffsetDateTime dateModified = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("listDbId") + private String listDbId = null; + + @SerializedName("listName") + private String listName = null; + + @SerializedName("listOwnerName") + private String listOwnerName = null; + + @SerializedName("listOwnerPersonDbId") + private String listOwnerPersonDbId = null; + + @SerializedName("listSize") + private Integer listSize = null; + + @SerializedName("listSource") + private String listSource = null; + + @SerializedName("listType") + private ListTypes listType = null; + + public ListSummary dateCreated(OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Get dateCreated + * @return dateCreated + **/ + @Schema(description = "") + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public ListSummary dateModified(OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Get dateModified + * @return dateModified + **/ + @Schema(description = "") + public OffsetDateTime getDateModified() { + return dateModified; + } + + public void setDateModified(OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + public ListSummary description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @Schema(description = "") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ListSummary listDbId(String listDbId) { + this.listDbId = listDbId; + return this; + } + + /** + * Get listDbId + * @return listDbId + **/ + @Schema(required = true, description = "") + public String getListDbId() { + return listDbId; + } + + public void setListDbId(String listDbId) { + this.listDbId = listDbId; + } + + public ListSummary listName(String listName) { + this.listName = listName; + return this; + } + + /** + * Get listName + * @return listName + **/ + @Schema(description = "") + public String getListName() { + return listName; + } + + public void setListName(String listName) { + this.listName = listName; + } + + public ListSummary listOwnerName(String listOwnerName) { + this.listOwnerName = listOwnerName; + return this; + } + + /** + * Get listOwnerName + * @return listOwnerName + **/ + @Schema(description = "") + public String getListOwnerName() { + return listOwnerName; + } + + public void setListOwnerName(String listOwnerName) { + this.listOwnerName = listOwnerName; + } + + public ListSummary listOwnerPersonDbId(String listOwnerPersonDbId) { + this.listOwnerPersonDbId = listOwnerPersonDbId; + return this; + } + + /** + * Get listOwnerPersonDbId + * @return listOwnerPersonDbId + **/ + @Schema(description = "") + public String getListOwnerPersonDbId() { + return listOwnerPersonDbId; + } + + public void setListOwnerPersonDbId(String listOwnerPersonDbId) { + this.listOwnerPersonDbId = listOwnerPersonDbId; + } + + public ListSummary listSize(Integer listSize) { + this.listSize = listSize; + return this; + } + + /** + * Get listSize + * @return listSize + **/ + @Schema(description = "") + public Integer getListSize() { + return listSize; + } + + public void setListSize(Integer listSize) { + this.listSize = listSize; + } + + public ListSummary listSource(String listSource) { + this.listSource = listSource; + return this; + } + + /** + * Get listSource + * @return listSource + **/ + @Schema(description = "") + public String getListSource() { + return listSource; + } + + public void setListSource(String listSource) { + this.listSource = listSource; + } + + public ListSummary listType(ListTypes listType) { + this.listType = listType; + return this; + } + + /** + * Get listType + * @return listType + **/ + @Schema(required = true, description = "") + public ListTypes getListType() { + return listType; + } + + public void setListType(ListTypes listType) { + this.listType = listType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSummary listSummary = (ListSummary) o; + return Objects.equals(this.dateCreated, listSummary.dateCreated) && + Objects.equals(this.dateModified, listSummary.dateModified) && + Objects.equals(this.description, listSummary.description) && + Objects.equals(this.listDbId, listSummary.listDbId) && + Objects.equals(this.listName, listSummary.listName) && + Objects.equals(this.listOwnerName, listSummary.listOwnerName) && + Objects.equals(this.listOwnerPersonDbId, listSummary.listOwnerPersonDbId) && + Objects.equals(this.listSize, listSummary.listSize) && + Objects.equals(this.listSource, listSummary.listSource) && + Objects.equals(this.listType, listSummary.listType); + } + + @Override + public int hashCode() { + return Objects.hash(dateCreated, dateModified, description, listDbId, listName, listOwnerName, listOwnerPersonDbId, listSize, listSource, listType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSummary {\n"); + + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" listDbId: ").append(toIndentedString(listDbId)).append("\n"); + sb.append(" listName: ").append(toIndentedString(listName)).append("\n"); + sb.append(" listOwnerName: ").append(toIndentedString(listOwnerName)).append("\n"); + sb.append(" listOwnerPersonDbId: ").append(toIndentedString(listOwnerPersonDbId)).append("\n"); + sb.append(" listSize: ").append(toIndentedString(listSize)).append("\n"); + sb.append(" listSource: ").append(toIndentedString(listSource)).append("\n"); + sb.append(" listType: ").append(toIndentedString(listType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponse.java new file mode 100755 index 00000000..c202b39f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListSummaryResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ListSummaryResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ListSummaryResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ListSummaryResponseResult result = null; + + public ListSummaryResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ListSummaryResponse result(ListSummaryResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ListSummaryResponseResult getResult() { + return result; + } + + public void setResult(ListSummaryResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSummaryResponse listSummaryResponse = (ListSummaryResponse) o; + return Objects.equals(this.metadata, listSummaryResponse.metadata) && + Objects.equals(this.result, listSummaryResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSummaryResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponseResult.java new file mode 100755 index 00000000..65b4cb2e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListSummaryResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListSummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ListSummaryResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ListSummaryResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ListSummaryResponseResult data(List data) { + this.data = data; + return this; + } + + public ListSummaryResponseResult addDataItem(ListSummary dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Array of generic list summaries + * @return data + **/ + @Schema(required = true, description = "Array of generic list summaries") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSummaryResponseResult listSummaryResponseResult = (ListSummaryResponseResult) o; + return Objects.equals(this.data, listSummaryResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSummaryResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ListTypes.java b/brapi-client/src/main/resources/swagger-generated-client/model/ListTypes.java new file mode 100755 index 00000000..cfc5f2a6 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ListTypes.java @@ -0,0 +1,72 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets listTypes + */ +@JsonAdapter(ListTypes.Adapter.class) +public enum ListTypes { + GERMPLASM("germplasm"), + MARKERS("markers"), + PROGRAMS("programs"), + TRIALS("trials"), + STUDIES("studies"), + OBSERVATIONUNITS("observationUnits"), + OBSERVATIONS("observations"), + OBSERVATIONVARIABLES("observationVariables"), + SAMPLES("samples"); + + private String value; + + ListTypes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ListTypes fromValue(String text) { + for (ListTypes b : ListTypes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ListTypes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ListTypes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ListTypes.fromValue(String.valueOf(value)); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Location.java b/brapi-client/src/main/resources/swagger-generated-client/model/Location.java new file mode 100755 index 00000000..8dc32d9c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Location.java @@ -0,0 +1,443 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +/** + * Location + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Location { + @SerializedName("abbreviation") + private String abbreviation = null; + + @SerializedName("abreviation") + private String abreviation = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("altitude") + private BigDecimal altitude = null; + + @SerializedName("countryCode") + private String countryCode = null; + + @SerializedName("countryName") + private String countryName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("instituteAddress") + private String instituteAddress = null; + + @SerializedName("instituteAdress") + private String instituteAdress = null; + + @SerializedName("instituteName") + private String instituteName = null; + + @SerializedName("latitude") + private BigDecimal latitude = null; + + @SerializedName("locationDbId") + private String locationDbId = null; + + @SerializedName("locationName") + private String locationName = null; + + @SerializedName("locationType") + private String locationType = null; + + @SerializedName("longitude") + private BigDecimal longitude = null; + + @SerializedName("name") + private String name = null; + + public Location abbreviation(String abbreviation) { + this.abbreviation = abbreviation; + return this; + } + + /** + * An abbreviation which represents this location + * @return abbreviation + **/ + @Schema(description = "An abbreviation which represents this location") + public String getAbbreviation() { + return abbreviation; + } + + public void setAbbreviation(String abbreviation) { + this.abbreviation = abbreviation; + } + + public Location abreviation(String abreviation) { + this.abreviation = abreviation; + return this; + } + + /** + * Deprecated Use abbreviation + * @return abreviation + **/ + @Schema(description = "Deprecated Use abbreviation ") + public String getAbreviation() { + return abreviation; + } + + public void setAbreviation(String abreviation) { + this.abreviation = abreviation; + } + + public Location additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public Location putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public Location altitude(BigDecimal altitude) { + this.altitude = altitude; + return this; + } + + /** + * The altitude of this location + * @return altitude + **/ + @Schema(description = "The altitude of this location") + public BigDecimal getAltitude() { + return altitude; + } + + public void setAltitude(BigDecimal altitude) { + this.altitude = altitude; + } + + public Location countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * [ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec + * @return countryCode + **/ + @Schema(description = "[ISO_3166-1_alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) spec") + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + public Location countryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * The full name of the country where this location is + * @return countryName + **/ + @Schema(description = "The full name of the country where this location is") + public String getCountryName() { + return countryName; + } + + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + public Location documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Location instituteAddress(String instituteAddress) { + this.instituteAddress = instituteAddress; + return this; + } + + /** + * The street address of the institute representing this location + * @return instituteAddress + **/ + @Schema(description = "The street address of the institute representing this location") + public String getInstituteAddress() { + return instituteAddress; + } + + public void setInstituteAddress(String instituteAddress) { + this.instituteAddress = instituteAddress; + } + + public Location instituteAdress(String instituteAdress) { + this.instituteAdress = instituteAdress; + return this; + } + + /** + * Deprecated Use instituteAddress + * @return instituteAdress + **/ + @Schema(description = "Deprecated Use instituteAddress ") + public String getInstituteAdress() { + return instituteAdress; + } + + public void setInstituteAdress(String instituteAdress) { + this.instituteAdress = instituteAdress; + } + + public Location instituteName(String instituteName) { + this.instituteName = instituteName; + return this; + } + + /** + * each institute/laboratory can have several experimental field + * @return instituteName + **/ + @Schema(description = "each institute/laboratory can have several experimental field") + public String getInstituteName() { + return instituteName; + } + + public void setInstituteName(String instituteName) { + this.instituteName = instituteName; + } + + public Location latitude(BigDecimal latitude) { + this.latitude = latitude; + return this; + } + + /** + * The latitude of this location + * @return latitude + **/ + @Schema(description = "The latitude of this location") + public BigDecimal getLatitude() { + return latitude; + } + + public void setLatitude(BigDecimal latitude) { + this.latitude = latitude; + } + + public Location locationDbId(String locationDbId) { + this.locationDbId = locationDbId; + return this; + } + + /** + * string identifier + * @return locationDbId + **/ + @Schema(description = "string identifier") + public String getLocationDbId() { + return locationDbId; + } + + public void setLocationDbId(String locationDbId) { + this.locationDbId = locationDbId; + } + + public Location locationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * A human readable name for this location + * @return locationName + **/ + @Schema(description = "A human readable name for this location") + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public Location locationType(String locationType) { + this.locationType = locationType; + return this; + } + + /** + * The type of location this represents (ex. Breeding Location, Storage Location, etc) + * @return locationType + **/ + @Schema(description = "The type of location this represents (ex. Breeding Location, Storage Location, etc)") + public String getLocationType() { + return locationType; + } + + public void setLocationType(String locationType) { + this.locationType = locationType; + } + + public Location longitude(BigDecimal longitude) { + this.longitude = longitude; + return this; + } + + /** + * the longitude of this location + * @return longitude + **/ + @Schema(description = "the longitude of this location") + public BigDecimal getLongitude() { + return longitude; + } + + public void setLongitude(BigDecimal longitude) { + this.longitude = longitude; + } + + public Location name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"locationName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"locationName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Location location = (Location) o; + return Objects.equals(this.abbreviation, location.abbreviation) && + Objects.equals(this.abreviation, location.abreviation) && + Objects.equals(this.additionalInfo, location.additionalInfo) && + Objects.equals(this.altitude, location.altitude) && + Objects.equals(this.countryCode, location.countryCode) && + Objects.equals(this.countryName, location.countryName) && + Objects.equals(this.documentationURL, location.documentationURL) && + Objects.equals(this.instituteAddress, location.instituteAddress) && + Objects.equals(this.instituteAdress, location.instituteAdress) && + Objects.equals(this.instituteName, location.instituteName) && + Objects.equals(this.latitude, location.latitude) && + Objects.equals(this.locationDbId, location.locationDbId) && + Objects.equals(this.locationName, location.locationName) && + Objects.equals(this.locationType, location.locationType) && + Objects.equals(this.longitude, location.longitude) && + Objects.equals(this.name, location.name); + } + + @Override + public int hashCode() { + return Objects.hash(abbreviation, abreviation, additionalInfo, altitude, countryCode, countryName, documentationURL, instituteAddress, instituteAdress, instituteName, latitude, locationDbId, locationName, locationType, longitude, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Location {\n"); + + sb.append(" abbreviation: ").append(toIndentedString(abbreviation)).append("\n"); + sb.append(" abreviation: ").append(toIndentedString(abreviation)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" altitude: ").append(toIndentedString(altitude)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" countryName: ").append(toIndentedString(countryName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" instituteAddress: ").append(toIndentedString(instituteAddress)).append("\n"); + sb.append(" instituteAdress: ").append(toIndentedString(instituteAdress)).append("\n"); + sb.append(" instituteName: ").append(toIndentedString(instituteName)).append("\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" locationDbId: ").append(toIndentedString(locationDbId)).append("\n"); + sb.append(" locationName: ").append(toIndentedString(locationName)).append("\n"); + sb.append(" locationType: ").append(toIndentedString(locationType)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/LocationResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/LocationResponse.java new file mode 100755 index 00000000..2010a601 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/LocationResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Location; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * LocationResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class LocationResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Location result = null; + + public LocationResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public LocationResponse result(Location result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Location getResult() { + return result; + } + + public void setResult(Location result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationResponse locationResponse = (LocationResponse) o; + return Objects.equals(this.metadata, locationResponse.metadata) && + Objects.equals(this.result, locationResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocationResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponse.java new file mode 100755 index 00000000..c3fe04b2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.LocationsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * LocationsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class LocationsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private LocationsResponseResult result = null; + + public LocationsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public LocationsResponse result(LocationsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public LocationsResponseResult getResult() { + return result; + } + + public void setResult(LocationsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationsResponse locationsResponse = (LocationsResponse) o; + return Objects.equals(this.metadata, locationsResponse.metadata) && + Objects.equals(this.result, locationsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocationsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponseResult.java new file mode 100755 index 00000000..fc2ce035 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/LocationsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Location; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * LocationsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class LocationsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public LocationsResponseResult data(List data) { + this.data = data; + return this; + } + + public LocationsResponseResult addDataItem(Location dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationsResponseResult locationsResponseResult = (LocationsResponseResult) o; + return Objects.equals(this.data, locationsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LocationsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MapDetailsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MapDetailsResponse.java new file mode 100755 index 00000000..930025b3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MapDetailsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GenomeMapDetails; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MapDetailsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MapDetailsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private GenomeMapDetails result = null; + + public MapDetailsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MapDetailsResponse result(GenomeMapDetails result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public GenomeMapDetails getResult() { + return result; + } + + public void setResult(GenomeMapDetails result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapDetailsResponse mapDetailsResponse = (MapDetailsResponse) o; + return Objects.equals(this.metadata, mapDetailsResponse.metadata) && + Objects.equals(this.result, mapDetailsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapDetailsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Marker.java b/brapi-client/src/main/resources/swagger-generated-client/model/Marker.java new file mode 100755 index 00000000..b876d3ae --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Marker.java @@ -0,0 +1,251 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Marker + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Marker { + @SerializedName("analysisMethods") + private List analysisMethods = null; + + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("markerDbId") + private String markerDbId = null; + + @SerializedName("markerName") + private String markerName = null; + + @SerializedName("refAlt") + private List refAlt = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("type") + private String type = null; + + public Marker analysisMethods(List analysisMethods) { + this.analysisMethods = analysisMethods; + return this; + } + + public Marker addAnalysisMethodsItem(String analysisMethodsItem) { + if (this.analysisMethods == null) { + this.analysisMethods = new ArrayList(); + } + this.analysisMethods.add(analysisMethodsItem); + return this; + } + + /** + * List of the genotyping platforms used to interrogate the marker + * @return analysisMethods + **/ + @Schema(description = "List of the genotyping platforms used to interrogate the marker") + public List getAnalysisMethods() { + return analysisMethods; + } + + public void setAnalysisMethods(List analysisMethods) { + this.analysisMethods = analysisMethods; + } + + public Marker defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * DEPRECATED in v 1.3 - see \"markerName\" + * @return defaultDisplayName + **/ + @Schema(description = "DEPRECATED in v 1.3 - see \"markerName\"") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public Marker markerDbId(String markerDbId) { + this.markerDbId = markerDbId; + return this; + } + + /** + * Internal db identifier + * @return markerDbId + **/ + @Schema(description = "Internal db identifier") + public String getMarkerDbId() { + return markerDbId; + } + + public void setMarkerDbId(String markerDbId) { + this.markerDbId = markerDbId; + } + + public Marker markerName(String markerName) { + this.markerName = markerName; + return this; + } + + /** + * A string representing the marker that will be meaningful to the user + * @return markerName + **/ + @Schema(description = "A string representing the marker that will be meaningful to the user") + public String getMarkerName() { + return markerName; + } + + public void setMarkerName(String markerName) { + this.markerName = markerName; + } + + public Marker refAlt(List refAlt) { + this.refAlt = refAlt; + return this; + } + + public Marker addRefAltItem(String refAltItem) { + if (this.refAlt == null) { + this.refAlt = new ArrayList(); + } + this.refAlt.add(refAltItem); + return this; + } + + /** + * List of the reference (as the first item) and alternatives (the remaining items) + * @return refAlt + **/ + @Schema(description = "List of the reference (as the first item) and alternatives (the remaining items)") + public List getRefAlt() { + return refAlt; + } + + public void setRefAlt(List refAlt) { + this.refAlt = refAlt; + } + + public Marker synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public Marker addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * List of other names for this marker + * @return synonyms + **/ + @Schema(description = "List of other names for this marker") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public Marker type(String type) { + this.type = type; + return this; + } + + /** + * The type of marker, e.g. SNP + * @return type + **/ + @Schema(description = "The type of marker, e.g. SNP") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Marker marker = (Marker) o; + return Objects.equals(this.analysisMethods, marker.analysisMethods) && + Objects.equals(this.defaultDisplayName, marker.defaultDisplayName) && + Objects.equals(this.markerDbId, marker.markerDbId) && + Objects.equals(this.markerName, marker.markerName) && + Objects.equals(this.refAlt, marker.refAlt) && + Objects.equals(this.synonyms, marker.synonyms) && + Objects.equals(this.type, marker.type); + } + + @Override + public int hashCode() { + return Objects.hash(analysisMethods, defaultDisplayName, markerDbId, markerName, refAlt, synonyms, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Marker {\n"); + + sb.append(" analysisMethods: ").append(toIndentedString(analysisMethods)).append("\n"); + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" markerDbId: ").append(toIndentedString(markerDbId)).append("\n"); + sb.append(" markerName: ").append(toIndentedString(markerName)).append("\n"); + sb.append(" refAlt: ").append(toIndentedString(refAlt)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfile.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfile.java new file mode 100755 index 00000000..95fc23d0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfile.java @@ -0,0 +1,233 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +/** + * MarkerProfile + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerProfile { + @SerializedName("analysisMethod") + private String analysisMethod = null; + + @SerializedName("data") + private List> data = new ArrayList>(); + + @SerializedName("extractDbId") + private String extractDbId = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("markerProfileDbId") + private String markerProfileDbId = null; + + @SerializedName("markerprofileDbId") + private String markerprofileDbId = null; + + @SerializedName("uniqueDisplayName") + private String uniqueDisplayName = null; + + public MarkerProfile analysisMethod(String analysisMethod) { + this.analysisMethod = analysisMethod; + return this; + } + + /** + * The type of analysis performed to determine a set of marker data + * @return analysisMethod + **/ + @Schema(description = "The type of analysis performed to determine a set of marker data") + public String getAnalysisMethod() { + return analysisMethod; + } + + public void setAnalysisMethod(String analysisMethod) { + this.analysisMethod = analysisMethod; + } + + public MarkerProfile data(List> data) { + this.data = data; + return this; + } + + public MarkerProfile addDataItem(Map dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * array of marker-name/score pairs + * @return data + **/ + @Schema(required = true, description = "array of marker-name/score pairs") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + public MarkerProfile extractDbId(String extractDbId) { + this.extractDbId = extractDbId; + return this; + } + + /** + * Required + * @return extractDbId + **/ + @Schema(required = true, description = "Required") + public String getExtractDbId() { + return extractDbId; + } + + public void setExtractDbId(String extractDbId) { + this.extractDbId = extractDbId; + } + + public MarkerProfile germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * Required + * @return germplasmDbId + **/ + @Schema(required = true, description = "Required") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public MarkerProfile markerProfileDbId(String markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + return this; + } + + /** + * Unique in the database. Can be a catenation of unique IDs for germplasm and extract. Required + * @return markerProfileDbId + **/ + @Schema(required = true, description = "Unique in the database. Can be a catenation of unique IDs for germplasm and extract. Required") + public String getMarkerProfileDbId() { + return markerProfileDbId; + } + + public void setMarkerProfileDbId(String markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + } + + public MarkerProfile markerprofileDbId(String markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) + * @return markerprofileDbId + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case)") + public String getMarkerprofileDbId() { + return markerprofileDbId; + } + + public void setMarkerprofileDbId(String markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + } + + public MarkerProfile uniqueDisplayName(String uniqueDisplayName) { + this.uniqueDisplayName = uniqueDisplayName; + return this; + } + + /** + * Human readable display name for this marker profile + * @return uniqueDisplayName + **/ + @Schema(description = "Human readable display name for this marker profile") + public String getUniqueDisplayName() { + return uniqueDisplayName; + } + + public void setUniqueDisplayName(String uniqueDisplayName) { + this.uniqueDisplayName = uniqueDisplayName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerProfile markerProfile = (MarkerProfile) o; + return Objects.equals(this.analysisMethod, markerProfile.analysisMethod) && + Objects.equals(this.data, markerProfile.data) && + Objects.equals(this.extractDbId, markerProfile.extractDbId) && + Objects.equals(this.germplasmDbId, markerProfile.germplasmDbId) && + Objects.equals(this.markerProfileDbId, markerProfile.markerProfileDbId) && + Objects.equals(this.markerprofileDbId, markerProfile.markerprofileDbId) && + Objects.equals(this.uniqueDisplayName, markerProfile.uniqueDisplayName); + } + + @Override + public int hashCode() { + return Objects.hash(analysisMethod, data, extractDbId, germplasmDbId, markerProfileDbId, markerprofileDbId, uniqueDisplayName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerProfile {\n"); + + sb.append(" analysisMethod: ").append(toIndentedString(analysisMethod)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" extractDbId: ").append(toIndentedString(extractDbId)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" markerProfileDbId: ").append(toIndentedString(markerProfileDbId)).append("\n"); + sb.append(" markerprofileDbId: ").append(toIndentedString(markerprofileDbId)).append("\n"); + sb.append(" uniqueDisplayName: ").append(toIndentedString(uniqueDisplayName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescription.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescription.java new file mode 100755 index 00000000..75310af3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescription.java @@ -0,0 +1,248 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerProfileDescription + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerProfileDescription { + @SerializedName("analysisMethod") + private String analysisMethod = null; + + @SerializedName("extractDbId") + private String extractDbId = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("markerProfileDbId") + private String markerProfileDbId = null; + + @SerializedName("markerprofileDbId") + private String markerprofileDbId = null; + + @SerializedName("resultCount") + private Integer resultCount = null; + + @SerializedName("sampleDbId") + private String sampleDbId = null; + + @SerializedName("uniqueDisplayName") + private String uniqueDisplayName = null; + + public MarkerProfileDescription analysisMethod(String analysisMethod) { + this.analysisMethod = analysisMethod; + return this; + } + + /** + * The type of analysis performed to determine a set of marker data + * @return analysisMethod + **/ + @Schema(description = "The type of analysis performed to determine a set of marker data") + public String getAnalysisMethod() { + return analysisMethod; + } + + public void setAnalysisMethod(String analysisMethod) { + this.analysisMethod = analysisMethod; + } + + public MarkerProfileDescription extractDbId(String extractDbId) { + this.extractDbId = extractDbId; + return this; + } + + /** + * The ID which uniquely identifies this data extract + * @return extractDbId + **/ + @Schema(description = " The ID which uniquely identifies this data extract") + public String getExtractDbId() { + return extractDbId; + } + + public void setExtractDbId(String extractDbId) { + this.extractDbId = extractDbId; + } + + public MarkerProfileDescription germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public MarkerProfileDescription markerProfileDbId(String markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + return this; + } + + /** + * Unique in the database. Can be a catenation of unique IDs for germplasm and extract. Required + * @return markerProfileDbId + **/ + @Schema(required = true, description = "Unique in the database. Can be a catenation of unique IDs for germplasm and extract. Required") + public String getMarkerProfileDbId() { + return markerProfileDbId; + } + + public void setMarkerProfileDbId(String markerProfileDbId) { + this.markerProfileDbId = markerProfileDbId; + } + + public MarkerProfileDescription markerprofileDbId(String markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case) + * @return markerprofileDbId + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"markerProfileDbId\" (camel case)") + public String getMarkerprofileDbId() { + return markerprofileDbId; + } + + public void setMarkerprofileDbId(String markerprofileDbId) { + this.markerprofileDbId = markerprofileDbId; + } + + public MarkerProfileDescription resultCount(Integer resultCount) { + this.resultCount = resultCount; + return this; + } + + /** + * Number of markers present in the marker profile + * @return resultCount + **/ + @Schema(description = "Number of markers present in the marker profile") + public Integer getResultCount() { + return resultCount; + } + + public void setResultCount(Integer resultCount) { + this.resultCount = resultCount; + } + + public MarkerProfileDescription sampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + return this; + } + + /** + * The ID which uniquely identifies a sample + * @return sampleDbId + **/ + @Schema(description = "The ID which uniquely identifies a sample") + public String getSampleDbId() { + return sampleDbId; + } + + public void setSampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + } + + public MarkerProfileDescription uniqueDisplayName(String uniqueDisplayName) { + this.uniqueDisplayName = uniqueDisplayName; + return this; + } + + /** + * Human readable display name for this marker profile + * @return uniqueDisplayName + **/ + @Schema(description = "Human readable display name for this marker profile") + public String getUniqueDisplayName() { + return uniqueDisplayName; + } + + public void setUniqueDisplayName(String uniqueDisplayName) { + this.uniqueDisplayName = uniqueDisplayName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerProfileDescription markerProfileDescription = (MarkerProfileDescription) o; + return Objects.equals(this.analysisMethod, markerProfileDescription.analysisMethod) && + Objects.equals(this.extractDbId, markerProfileDescription.extractDbId) && + Objects.equals(this.germplasmDbId, markerProfileDescription.germplasmDbId) && + Objects.equals(this.markerProfileDbId, markerProfileDescription.markerProfileDbId) && + Objects.equals(this.markerprofileDbId, markerProfileDescription.markerprofileDbId) && + Objects.equals(this.resultCount, markerProfileDescription.resultCount) && + Objects.equals(this.sampleDbId, markerProfileDescription.sampleDbId) && + Objects.equals(this.uniqueDisplayName, markerProfileDescription.uniqueDisplayName); + } + + @Override + public int hashCode() { + return Objects.hash(analysisMethod, extractDbId, germplasmDbId, markerProfileDbId, markerprofileDbId, resultCount, sampleDbId, uniqueDisplayName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerProfileDescription {\n"); + + sb.append(" analysisMethod: ").append(toIndentedString(analysisMethod)).append("\n"); + sb.append(" extractDbId: ").append(toIndentedString(extractDbId)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" markerProfileDbId: ").append(toIndentedString(markerProfileDbId)).append("\n"); + sb.append(" markerprofileDbId: ").append(toIndentedString(markerprofileDbId)).append("\n"); + sb.append(" resultCount: ").append(toIndentedString(resultCount)).append("\n"); + sb.append(" sampleDbId: ").append(toIndentedString(sampleDbId)).append("\n"); + sb.append(" uniqueDisplayName: ").append(toIndentedString(uniqueDisplayName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponse.java new file mode 100755 index 00000000..f435e8f5 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerProfileDescriptionsResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerProfileDescriptionsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerProfileDescriptionsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MarkerProfileDescriptionsResponseResult result = null; + + public MarkerProfileDescriptionsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkerProfileDescriptionsResponse result(MarkerProfileDescriptionsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public MarkerProfileDescriptionsResponseResult getResult() { + return result; + } + + public void setResult(MarkerProfileDescriptionsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerProfileDescriptionsResponse markerProfileDescriptionsResponse = (MarkerProfileDescriptionsResponse) o; + return Objects.equals(this.metadata, markerProfileDescriptionsResponse.metadata) && + Objects.equals(this.result, markerProfileDescriptionsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerProfileDescriptionsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponseResult.java new file mode 100755 index 00000000..68507c83 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfileDescriptionsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerProfileDescription; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * MarkerProfileDescriptionsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerProfileDescriptionsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public MarkerProfileDescriptionsResponseResult data(List data) { + this.data = data; + return this; + } + + public MarkerProfileDescriptionsResponseResult addDataItem(MarkerProfileDescription dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerProfileDescriptionsResponseResult markerProfileDescriptionsResponseResult = (MarkerProfileDescriptionsResponseResult) o; + return Objects.equals(this.data, markerProfileDescriptionsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerProfileDescriptionsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfilesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfilesResponse.java new file mode 100755 index 00000000..dbd9d6ad --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerProfilesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerProfile; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerProfilesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerProfilesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MarkerProfile result = null; + + public MarkerProfilesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkerProfilesResponse result(MarkerProfile result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public MarkerProfile getResult() { + return result; + } + + public void setResult(MarkerProfile result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerProfilesResponse markerProfilesResponse = (MarkerProfilesResponse) o; + return Objects.equals(this.metadata, markerProfilesResponse.metadata) && + Objects.equals(this.result, markerProfilesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerProfilesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerResponse.java new file mode 100755 index 00000000..ebd4de60 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Marker; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Marker result = null; + + public MarkerResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkerResponse result(Marker result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public Marker getResult() { + return result; + } + + public void setResult(Marker result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerResponse markerResponse = (MarkerResponse) o; + return Objects.equals(this.metadata, markerResponse.metadata) && + Objects.equals(this.result, markerResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroup.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroup.java new file mode 100755 index 00000000..be6540fd --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroup.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerSummaryLinkageGroup + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryLinkageGroup { + @SerializedName("location") + private String location = null; + + @SerializedName("markerDbId") + private String markerDbId = null; + + @SerializedName("markerName") + private String markerName = null; + + public MarkerSummaryLinkageGroup location(String location) { + this.location = location; + return this; + } + + /** + * The position of a marker within a linkage group + * @return location + **/ + @Schema(description = "The position of a marker within a linkage group") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public MarkerSummaryLinkageGroup markerDbId(String markerDbId) { + this.markerDbId = markerDbId; + return this; + } + + /** + * Internal db identifier + * @return markerDbId + **/ + @Schema(description = "Internal db identifier") + public String getMarkerDbId() { + return markerDbId; + } + + public void setMarkerDbId(String markerDbId) { + this.markerDbId = markerDbId; + } + + public MarkerSummaryLinkageGroup markerName(String markerName) { + this.markerName = markerName; + return this; + } + + /** + * The human readable name for a marker + * @return markerName + **/ + @Schema(description = "The human readable name for a marker") + public String getMarkerName() { + return markerName; + } + + public void setMarkerName(String markerName) { + this.markerName = markerName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryLinkageGroup markerSummaryLinkageGroup = (MarkerSummaryLinkageGroup) o; + return Objects.equals(this.location, markerSummaryLinkageGroup.location) && + Objects.equals(this.markerDbId, markerSummaryLinkageGroup.markerDbId) && + Objects.equals(this.markerName, markerSummaryLinkageGroup.markerName); + } + + @Override + public int hashCode() { + return Objects.hash(location, markerDbId, markerName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryLinkageGroup {\n"); + + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" markerDbId: ").append(toIndentedString(markerDbId)).append("\n"); + sb.append(" markerName: ").append(toIndentedString(markerName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponse.java new file mode 100755 index 00000000..a545f3a7 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerSummaryLinkageGroupResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerSummaryLinkageGroupResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryLinkageGroupResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MarkerSummaryLinkageGroupResponseResult result = null; + + public MarkerSummaryLinkageGroupResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkerSummaryLinkageGroupResponse result(MarkerSummaryLinkageGroupResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public MarkerSummaryLinkageGroupResponseResult getResult() { + return result; + } + + public void setResult(MarkerSummaryLinkageGroupResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryLinkageGroupResponse markerSummaryLinkageGroupResponse = (MarkerSummaryLinkageGroupResponse) o; + return Objects.equals(this.metadata, markerSummaryLinkageGroupResponse.metadata) && + Objects.equals(this.result, markerSummaryLinkageGroupResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryLinkageGroupResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponseResult.java new file mode 100755 index 00000000..06752cea --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryLinkageGroupResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerSummaryLinkageGroup; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * MarkerSummaryLinkageGroupResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryLinkageGroupResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public MarkerSummaryLinkageGroupResponseResult data(List data) { + this.data = data; + return this; + } + + public MarkerSummaryLinkageGroupResponseResult addDataItem(MarkerSummaryLinkageGroup dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryLinkageGroupResponseResult markerSummaryLinkageGroupResponseResult = (MarkerSummaryLinkageGroupResponseResult) o; + return Objects.equals(this.data, markerSummaryLinkageGroupResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryLinkageGroupResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMap.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMap.java new file mode 100755 index 00000000..7905119c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMap.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerSummaryMap + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryMap { + @SerializedName("linkageGroupName") + private String linkageGroupName = null; + + @SerializedName("location") + private String location = null; + + @SerializedName("markerDbId") + private String markerDbId = null; + + @SerializedName("markerName") + private String markerName = null; + + public MarkerSummaryMap linkageGroupName(String linkageGroupName) { + this.linkageGroupName = linkageGroupName; + return this; + } + + /** + * The Uniquely Identifiable name of this linkage group + * @return linkageGroupName + **/ + @Schema(description = "The Uniquely Identifiable name of this linkage group") + public String getLinkageGroupName() { + return linkageGroupName; + } + + public void setLinkageGroupName(String linkageGroupName) { + this.linkageGroupName = linkageGroupName; + } + + public MarkerSummaryMap location(String location) { + this.location = location; + return this; + } + + /** + * The position of a marker within a linkage group + * @return location + **/ + @Schema(description = "The position of a marker within a linkage group") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public MarkerSummaryMap markerDbId(String markerDbId) { + this.markerDbId = markerDbId; + return this; + } + + /** + * Internal db identifier + * @return markerDbId + **/ + @Schema(description = "Internal db identifier") + public String getMarkerDbId() { + return markerDbId; + } + + public void setMarkerDbId(String markerDbId) { + this.markerDbId = markerDbId; + } + + public MarkerSummaryMap markerName(String markerName) { + this.markerName = markerName; + return this; + } + + /** + * The human readable name for a marker + * @return markerName + **/ + @Schema(description = "The human readable name for a marker") + public String getMarkerName() { + return markerName; + } + + public void setMarkerName(String markerName) { + this.markerName = markerName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryMap markerSummaryMap = (MarkerSummaryMap) o; + return Objects.equals(this.linkageGroupName, markerSummaryMap.linkageGroupName) && + Objects.equals(this.location, markerSummaryMap.location) && + Objects.equals(this.markerDbId, markerSummaryMap.markerDbId) && + Objects.equals(this.markerName, markerSummaryMap.markerName); + } + + @Override + public int hashCode() { + return Objects.hash(linkageGroupName, location, markerDbId, markerName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryMap {\n"); + + sb.append(" linkageGroupName: ").append(toIndentedString(linkageGroupName)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" markerDbId: ").append(toIndentedString(markerDbId)).append("\n"); + sb.append(" markerName: ").append(toIndentedString(markerName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponse.java new file mode 100755 index 00000000..5e668e9a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerSummaryMapResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkerSummaryMapResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryMapResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MarkerSummaryMapResponseResult result = null; + + public MarkerSummaryMapResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkerSummaryMapResponse result(MarkerSummaryMapResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public MarkerSummaryMapResponseResult getResult() { + return result; + } + + public void setResult(MarkerSummaryMapResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryMapResponse markerSummaryMapResponse = (MarkerSummaryMapResponse) o; + return Objects.equals(this.metadata, markerSummaryMapResponse.metadata) && + Objects.equals(this.result, markerSummaryMapResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryMapResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponseResult.java new file mode 100755 index 00000000..a5078775 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkerSummaryMapResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkerSummaryMap; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * MarkerSummaryMapResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkerSummaryMapResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public MarkerSummaryMapResponseResult data(List data) { + this.data = data; + return this; + } + + public MarkerSummaryMapResponseResult addDataItem(MarkerSummaryMap dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkerSummaryMapResponseResult markerSummaryMapResponseResult = (MarkerSummaryMapResponseResult) o; + return Objects.equals(this.data, markerSummaryMapResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkerSummaryMapResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponse.java new file mode 100755 index 00000000..78048a40 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MarkersResponseResult; +import io.swagger.client.model.Metadata; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MarkersResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkersResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MarkersResponseResult result = null; + + public MarkersResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MarkersResponse result(MarkersResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public MarkersResponseResult getResult() { + return result; + } + + public void setResult(MarkersResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkersResponse markersResponse = (MarkersResponse) o; + return Objects.equals(this.metadata, markersResponse.metadata) && + Objects.equals(this.result, markersResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkersResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponseResult.java new file mode 100755 index 00000000..875cb518 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersResponseResult.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Marker; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * MarkersResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkersResponseResult { + @SerializedName("data") + private List data = null; + + public MarkersResponseResult data(List data) { + this.data = data; + return this; + } + + public MarkersResponseResult addDataItem(Marker dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkersResponseResult markersResponseResult = (MarkersResponseResult) o; + return Objects.equals(this.data, markersResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkersResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MarkersSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersSearchRequest.java new file mode 100755 index 00000000..a1c191c1 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MarkersSearchRequest.java @@ -0,0 +1,343 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * MarkersSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MarkersSearchRequest { + @SerializedName("includeSynonyms") + private Boolean includeSynonyms = null; + + @SerializedName("markerDbIds") + private List markerDbIds = null; + + @SerializedName("markerNames") + private List markerNames = null; + + /** + * How to perform string matching during search. 'exact' will search for exact, case sensitive matches only. 'case_insensitive' will search for exact matches, but case insensitive. 'wildcard' will allow the special characters '*' (star) and '%' (percent) to represent variable length arbitrary strings, and the special character '?' (question) to represent one arbitrary character. + */ + @JsonAdapter(MatchMethodEnum.Adapter.class) + public enum MatchMethodEnum { + EXACT("exact"), + CASE_INSENSITIVE("case_insensitive"), + WILDCARD("wildcard"); + + private String value; + + MatchMethodEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static MatchMethodEnum fromValue(String text) { + for (MatchMethodEnum b : MatchMethodEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MatchMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MatchMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MatchMethodEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("matchMethod") + private MatchMethodEnum matchMethod = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("types") + private List types = null; + + public MarkersSearchRequest includeSynonyms(Boolean includeSynonyms) { + this.includeSynonyms = includeSynonyms; + return this; + } + + /** + * Should an array of synonyms be included in the response + * @return includeSynonyms + **/ + @Schema(description = "Should an array of synonyms be included in the response") + public Boolean isIncludeSynonyms() { + return includeSynonyms; + } + + public void setIncludeSynonyms(Boolean includeSynonyms) { + this.includeSynonyms = includeSynonyms; + } + + public MarkersSearchRequest markerDbIds(List markerDbIds) { + this.markerDbIds = markerDbIds; + return this; + } + + public MarkersSearchRequest addMarkerDbIdsItem(String markerDbIdsItem) { + if (this.markerDbIds == null) { + this.markerDbIds = new ArrayList(); + } + this.markerDbIds.add(markerDbIdsItem); + return this; + } + + /** + * List of IDs which uniquely identify markers + * @return markerDbIds + **/ + @Schema(description = "List of IDs which uniquely identify markers ") + public List getMarkerDbIds() { + return markerDbIds; + } + + public void setMarkerDbIds(List markerDbIds) { + this.markerDbIds = markerDbIds; + } + + public MarkersSearchRequest markerNames(List markerNames) { + this.markerNames = markerNames; + return this; + } + + public MarkersSearchRequest addMarkerNamesItem(String markerNamesItem) { + if (this.markerNames == null) { + this.markerNames = new ArrayList(); + } + this.markerNames.add(markerNamesItem); + return this; + } + + /** + * The search pattern for the marker name or synonym. + * @return markerNames + **/ + @Schema(description = "The search pattern for the marker name or synonym.") + public List getMarkerNames() { + return markerNames; + } + + public void setMarkerNames(List markerNames) { + this.markerNames = markerNames; + } + + public MarkersSearchRequest matchMethod(MatchMethodEnum matchMethod) { + this.matchMethod = matchMethod; + return this; + } + + /** + * How to perform string matching during search. 'exact' will search for exact, case sensitive matches only. 'case_insensitive' will search for exact matches, but case insensitive. 'wildcard' will allow the special characters '*' (star) and '%' (percent) to represent variable length arbitrary strings, and the special character '?' (question) to represent one arbitrary character. + * @return matchMethod + **/ + @Schema(description = "How to perform string matching during search. 'exact' will search for exact, case sensitive matches only. 'case_insensitive' will search for exact matches, but case insensitive. 'wildcard' will allow the special characters '*' (star) and '%' (percent) to represent variable length arbitrary strings, and the special character '?' (question) to represent one arbitrary character.") + public MatchMethodEnum getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(MatchMethodEnum matchMethod) { + this.matchMethod = matchMethod; + } + + public MarkersSearchRequest name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v 1.3 - see \"markerNames\" + * @return name + **/ + @Schema(description = "DEPRECATED in v 1.3 - see \"markerNames\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MarkersSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public MarkersSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public MarkersSearchRequest type(String type) { + this.type = type; + return this; + } + + /** + * DEPRECATED in v 1.3 - see \"types\" + * @return type + **/ + @Schema(description = "DEPRECATED in v 1.3 - see \"types\"") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public MarkersSearchRequest types(List types) { + this.types = types; + return this; + } + + public MarkersSearchRequest addTypesItem(String typesItem) { + if (this.types == null) { + this.types = new ArrayList(); + } + this.types.add(typesItem); + return this; + } + + /** + * The type of marker, e.g. SNP + * @return types + **/ + @Schema(description = "The type of marker, e.g. SNP") + public List getTypes() { + return types; + } + + public void setTypes(List types) { + this.types = types; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkersSearchRequest markersSearchRequest = (MarkersSearchRequest) o; + return Objects.equals(this.includeSynonyms, markersSearchRequest.includeSynonyms) && + Objects.equals(this.markerDbIds, markersSearchRequest.markerDbIds) && + Objects.equals(this.markerNames, markersSearchRequest.markerNames) && + Objects.equals(this.matchMethod, markersSearchRequest.matchMethod) && + Objects.equals(this.name, markersSearchRequest.name) && + Objects.equals(this.page, markersSearchRequest.page) && + Objects.equals(this.pageSize, markersSearchRequest.pageSize) && + Objects.equals(this.type, markersSearchRequest.type) && + Objects.equals(this.types, markersSearchRequest.types); + } + + @Override + public int hashCode() { + return Objects.hash(includeSynonyms, markerDbIds, markerNames, matchMethod, name, page, pageSize, type, types); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MarkersSearchRequest {\n"); + + sb.append(" includeSynonyms: ").append(toIndentedString(includeSynonyms)).append("\n"); + sb.append(" markerDbIds: ").append(toIndentedString(markerDbIds)).append("\n"); + sb.append(" markerNames: ").append(toIndentedString(markerNames)).append("\n"); + sb.append(" matchMethod: ").append(toIndentedString(matchMethod)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" types: ").append(toIndentedString(types)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Measurement.java b/brapi-client/src/main/resources/swagger-generated-client/model/Measurement.java new file mode 100755 index 00000000..514f3213 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Measurement.java @@ -0,0 +1,111 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.math.BigDecimal; +/** + * A value with units + */ +@Schema(description = "A value with units") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Measurement { + @SerializedName("units") + private String units = null; + + @SerializedName("value") + private BigDecimal value = null; + + public Measurement units(String units) { + this.units = units; + return this; + } + + /** + * Units (example: \"ng/ul\") + * @return units + **/ + @Schema(description = "Units (example: \"ng/ul\")") + public String getUnits() { + return units; + } + + public void setUnits(String units) { + this.units = units; + } + + public Measurement value(BigDecimal value) { + this.value = value; + return this; + } + + /** + * Value (example: \"2.3\") + * @return value + **/ + @Schema(description = "Value (example: \"2.3\")") + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Measurement measurement = (Measurement) o; + return Objects.equals(this.units, measurement.units) && + Objects.equals(this.value, measurement.value); + } + + @Override + public int hashCode() { + return Objects.hash(units, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Measurement {\n"); + + sb.append(" units: ").append(toIndentedString(units)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Metadata.java b/brapi-client/src/main/resources/swagger-generated-client/model/Metadata.java new file mode 100755 index 00000000..b7d5fb74 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Metadata.java @@ -0,0 +1,153 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.MetadataPagination; +import io.swagger.client.model.Status; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Metadata + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Metadata { + @SerializedName("datafiles") + private List datafiles = null; + + @SerializedName("pagination") + private MetadataPagination pagination = null; + + @SerializedName("status") + private List status = null; + + public Metadata datafiles(List datafiles) { + this.datafiles = datafiles; + return this; + } + + public Metadata addDatafilesItem(String datafilesItem) { + if (this.datafiles == null) { + this.datafiles = new ArrayList(); + } + this.datafiles.add(datafilesItem); + return this; + } + + /** + * The datafiles key contains a list of file paths, which can be relative or complete URLs. These files contain additional information related to the returned object and can be retrieved by a subsequent call. The empty list should be returned if no additional data files are present. + * @return datafiles + **/ + @Schema(description = "The datafiles key contains a list of file paths, which can be relative or complete URLs. These files contain additional information related to the returned object and can be retrieved by a subsequent call. The empty list should be returned if no additional data files are present.") + public List getDatafiles() { + return datafiles; + } + + public void setDatafiles(List datafiles) { + this.datafiles = datafiles; + } + + public Metadata pagination(MetadataPagination pagination) { + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @Schema(description = "") + public MetadataPagination getPagination() { + return pagination; + } + + public void setPagination(MetadataPagination pagination) { + this.pagination = pagination; + } + + public Metadata status(List status) { + this.status = status; + return this; + } + + public Metadata addStatusItem(Status statusItem) { + if (this.status == null) { + this.status = new ArrayList(); + } + this.status.add(statusItem); + return this; + } + + /** + * The status field contains a list of informational status messages from the server. If no status is reported, an empty list should be returned. See Error Reporting for more information. + * @return status + **/ + @Schema(description = "The status field contains a list of informational status messages from the server. If no status is reported, an empty list should be returned. See Error Reporting for more information.") + public List getStatus() { + return status; + } + + public void setStatus(List status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Metadata metadata = (Metadata) o; + return Objects.equals(this.datafiles, metadata.datafiles) && + Objects.equals(this.pagination, metadata.pagination) && + Objects.equals(this.status, metadata.status); + } + + @Override + public int hashCode() { + return Objects.hash(datafiles, pagination, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Metadata {\n"); + + sb.append(" datafiles: ").append(toIndentedString(datafiles)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MetadataPagination.java b/brapi-client/src/main/resources/swagger-generated-client/model/MetadataPagination.java new file mode 100755 index 00000000..a6d3e2f6 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MetadataPagination.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * The pagination object is applicable only when the payload contains a \"data\" key. It describes the pagination of the data contained in the \"data\" array, as a way to identify which subset of data is being returned. Pages are zero indexed, so the first page will be page 0 (zero). + */ +@Schema(description = "The pagination object is applicable only when the payload contains a \"data\" key. It describes the pagination of the data contained in the \"data\" array, as a way to identify which subset of data is being returned. Pages are zero indexed, so the first page will be page 0 (zero).") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MetadataPagination { + @SerializedName("currentPage") + private Integer currentPage = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("totalCount") + private Integer totalCount = null; + + @SerializedName("totalPages") + private Integer totalPages = null; + + public MetadataPagination currentPage(Integer currentPage) { + this.currentPage = currentPage; + return this; + } + + /** + * Get currentPage + * @return currentPage + **/ + @Schema(description = "") + public Integer getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(Integer currentPage) { + this.currentPage = currentPage; + } + + public MetadataPagination pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @Schema(description = "") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public MetadataPagination totalCount(Integer totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get totalCount + * @return totalCount + **/ + @Schema(description = "") + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public MetadataPagination totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Get totalPages + * @return totalPages + **/ + @Schema(description = "") + public Integer getTotalPages() { + return totalPages; + } + + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataPagination metadataPagination = (MetadataPagination) o; + return Objects.equals(this.currentPage, metadataPagination.currentPage) && + Objects.equals(this.pageSize, metadataPagination.pageSize) && + Objects.equals(this.totalCount, metadataPagination.totalCount) && + Objects.equals(this.totalPages, metadataPagination.totalPages); + } + + @Override + public int hashCode() { + return Objects.hash(currentPage, pageSize, totalCount, totalPages); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MetadataPagination {\n"); + + sb.append(" currentPage: ").append(toIndentedString(currentPage)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Method.java b/brapi-client/src/main/resources/swagger-generated-client/model/Method.java new file mode 100755 index 00000000..7e62e8f2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Method.java @@ -0,0 +1,249 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Method metadata + */ +@Schema(description = "Method metadata") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Method { + @SerializedName("class") + private String propertyClass = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("formula") + private String formula = null; + + @SerializedName("methodDbId") + private String methodDbId = null; + + @SerializedName("methodName") + private String methodName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("reference") + private String reference = null; + + public Method propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Method class (examples: \"Measurement\", \"Counting\", \"Estimation\", \"Computation\", etc. + * @return propertyClass + **/ + @Schema(description = "Method class (examples: \"Measurement\", \"Counting\", \"Estimation\", \"Computation\", etc.") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Method description(String description) { + this.description = description; + return this; + } + + /** + * Method description. + * @return description + **/ + @Schema(description = "Method description.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Method formula(String formula) { + this.formula = formula; + return this; + } + + /** + * For computational methods i.e., when the method consists in assessing the trait by computing measurements, write the generic formula used for the calculation + * @return formula + **/ + @Schema(description = "For computational methods i.e., when the method consists in assessing the trait by computing measurements, write the generic formula used for the calculation") + public String getFormula() { + return formula; + } + + public void setFormula(String formula) { + this.formula = formula; + } + + public Method methodDbId(String methodDbId) { + this.methodDbId = methodDbId; + return this; + } + + /** + * Method unique identifier + * @return methodDbId + **/ + @Schema(description = "Method unique identifier") + public String getMethodDbId() { + return methodDbId; + } + + public void setMethodDbId(String methodDbId) { + this.methodDbId = methodDbId; + } + + public Method methodName(String methodName) { + this.methodName = methodName; + return this; + } + + /** + * Human readable name for the method + * @return methodName + **/ + @Schema(description = "Human readable name for the method") + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + public Method name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"methodName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"methodName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Method ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public Method reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Bibliographical reference describing the method. + * @return reference + **/ + @Schema(description = "Bibliographical reference describing the method.") + public String getReference() { + return reference; + } + + public void setReference(String reference) { + this.reference = reference; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Method method = (Method) o; + return Objects.equals(this.propertyClass, method.propertyClass) && + Objects.equals(this.description, method.description) && + Objects.equals(this.formula, method.formula) && + Objects.equals(this.methodDbId, method.methodDbId) && + Objects.equals(this.methodName, method.methodName) && + Objects.equals(this.name, method.name) && + Objects.equals(this.ontologyReference, method.ontologyReference) && + Objects.equals(this.reference, method.reference); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass, description, formula, methodDbId, methodName, name, ontologyReference, reference); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Method {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" formula: ").append(toIndentedString(formula)).append("\n"); + sb.append(" methodDbId: ").append(toIndentedString(methodDbId)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MethodResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MethodResponse.java new file mode 100755 index 00000000..5839b858 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MethodResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Method; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MethodResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MethodResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Method result = null; + + public MethodResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MethodResponse result(Method result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Method getResult() { + return result; + } + + public void setResult(Method result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MethodResponse methodResponse = (MethodResponse) o; + return Objects.equals(this.metadata, methodResponse.metadata) && + Objects.equals(this.result, methodResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MethodResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponse.java new file mode 100755 index 00000000..089ec518 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.MethodsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * MethodsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MethodsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private MethodsResponseResult result = null; + + public MethodsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public MethodsResponse result(MethodsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public MethodsResponseResult getResult() { + return result; + } + + public void setResult(MethodsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MethodsResponse methodsResponse = (MethodsResponse) o; + return Objects.equals(this.metadata, methodsResponse.metadata) && + Objects.equals(this.result, methodsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MethodsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponseResult.java new file mode 100755 index 00000000..d3b24163 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/MethodsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Method; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * MethodsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class MethodsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public MethodsResponseResult data(List data) { + this.data = data; + return this; + } + + public MethodsResponseResult addDataItem(Method dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MethodsResponseResult methodsResponseResult = (MethodsResponseResult) o; + return Objects.equals(this.data, methodsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MethodsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewImageRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewImageRequest.java new file mode 100755 index 00000000..5b4b9efe --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewImageRequest.java @@ -0,0 +1,416 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.GeoJSON; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * NewImageRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewImageRequest { + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("copyright") + private String copyright = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("descriptiveOntologyTerms") + private List descriptiveOntologyTerms = null; + + @SerializedName("imageFileName") + private String imageFileName = null; + + @SerializedName("imageFileSize") + private Integer imageFileSize = null; + + @SerializedName("imageHeight") + private Integer imageHeight = null; + + @SerializedName("imageLocation") + private GeoJSON imageLocation = null; + + @SerializedName("imageName") + private String imageName = null; + + @SerializedName("imageTimeStamp") + private LocalDate imageTimeStamp = null; + + @SerializedName("imageWidth") + private Integer imageWidth = null; + + @SerializedName("mimeType") + private String mimeType = null; + + @SerializedName("observationDbIds") + private List observationDbIds = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + public NewImageRequest additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public NewImageRequest putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Get additionalInfo + * @return additionalInfo + **/ + @Schema(description = "") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public NewImageRequest copyright(String copyright) { + this.copyright = copyright; + return this; + } + + /** + * The copyright information of this image. Example 'Copyright 2018 Bob Robertson' + * @return copyright + **/ + @Schema(description = "The copyright information of this image. Example 'Copyright 2018 Bob Robertson'") + public String getCopyright() { + return copyright; + } + + public void setCopyright(String copyright) { + this.copyright = copyright; + } + + public NewImageRequest description(String description) { + this.description = description; + return this; + } + + /** + * The human readable description of an image. + * @return description + **/ + @Schema(description = "The human readable description of an image.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public NewImageRequest descriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + return this; + } + + public NewImageRequest addDescriptiveOntologyTermsItem(String descriptiveOntologyTermsItem) { + if (this.descriptiveOntologyTerms == null) { + this.descriptiveOntologyTerms = new ArrayList(); + } + this.descriptiveOntologyTerms.add(descriptiveOntologyTermsItem); + return this; + } + + /** + * A list of terms to formally describe the image. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL. + * @return descriptiveOntologyTerms + **/ + @Schema(description = "A list of terms to formally describe the image. Each item could be a simple Tag, an Ontology reference Id, or a full ontology URL.") + public List getDescriptiveOntologyTerms() { + return descriptiveOntologyTerms; + } + + public void setDescriptiveOntologyTerms(List descriptiveOntologyTerms) { + this.descriptiveOntologyTerms = descriptiveOntologyTerms; + } + + public NewImageRequest imageFileName(String imageFileName) { + this.imageFileName = imageFileName; + return this; + } + + /** + * The name of the image file. Might be the same as 'imageName', but could be different. + * @return imageFileName + **/ + @Schema(description = "The name of the image file. Might be the same as 'imageName', but could be different.") + public String getImageFileName() { + return imageFileName; + } + + public void setImageFileName(String imageFileName) { + this.imageFileName = imageFileName; + } + + public NewImageRequest imageFileSize(Integer imageFileSize) { + this.imageFileSize = imageFileSize; + return this; + } + + /** + * The size of the image in Bytes. + * @return imageFileSize + **/ + @Schema(description = "The size of the image in Bytes.") + public Integer getImageFileSize() { + return imageFileSize; + } + + public void setImageFileSize(Integer imageFileSize) { + this.imageFileSize = imageFileSize; + } + + public NewImageRequest imageHeight(Integer imageHeight) { + this.imageHeight = imageHeight; + return this; + } + + /** + * The height of the image in Pixels. + * @return imageHeight + **/ + @Schema(description = "The height of the image in Pixels.") + public Integer getImageHeight() { + return imageHeight; + } + + public void setImageHeight(Integer imageHeight) { + this.imageHeight = imageHeight; + } + + public NewImageRequest imageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + return this; + } + + /** + * Get imageLocation + * @return imageLocation + **/ + @Schema(description = "") + public GeoJSON getImageLocation() { + return imageLocation; + } + + public void setImageLocation(GeoJSON imageLocation) { + this.imageLocation = imageLocation; + } + + public NewImageRequest imageName(String imageName) { + this.imageName = imageName; + return this; + } + + /** + * The human readable name of an image. Might be the same as 'imageFileName', but could be different. + * @return imageName + **/ + @Schema(description = "The human readable name of an image. Might be the same as 'imageFileName', but could be different.") + public String getImageName() { + return imageName; + } + + public void setImageName(String imageName) { + this.imageName = imageName; + } + + public NewImageRequest imageTimeStamp(LocalDate imageTimeStamp) { + this.imageTimeStamp = imageTimeStamp; + return this; + } + + /** + * The date and time the image was taken + * @return imageTimeStamp + **/ + @Schema(description = "The date and time the image was taken") + public LocalDate getImageTimeStamp() { + return imageTimeStamp; + } + + public void setImageTimeStamp(LocalDate imageTimeStamp) { + this.imageTimeStamp = imageTimeStamp; + } + + public NewImageRequest imageWidth(Integer imageWidth) { + this.imageWidth = imageWidth; + return this; + } + + /** + * The width of the image in Pixels. + * @return imageWidth + **/ + @Schema(description = "The width of the image in Pixels.") + public Integer getImageWidth() { + return imageWidth; + } + + public void setImageWidth(Integer imageWidth) { + this.imageWidth = imageWidth; + } + + public NewImageRequest mimeType(String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * The file type of the image. Examples 'image/jpeg', 'image/png', 'image/svg', etc + * @return mimeType + **/ + @Schema(description = "The file type of the image. Examples 'image/jpeg', 'image/png', 'image/svg', etc") + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public NewImageRequest observationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + return this; + } + + public NewImageRequest addObservationDbIdsItem(String observationDbIdsItem) { + if (this.observationDbIds == null) { + this.observationDbIds = new ArrayList(); + } + this.observationDbIds.add(observationDbIdsItem); + return this; + } + + /** + * A list of observation Ids this image is associated with, if applicable. + * @return observationDbIds + **/ + @Schema(description = "A list of observation Ids this image is associated with, if applicable.") + public List getObservationDbIds() { + return observationDbIds; + } + + public void setObservationDbIds(List observationDbIds) { + this.observationDbIds = observationDbIds; + } + + public NewImageRequest observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The related observation unit identifier, if relevent. + * @return observationUnitDbId + **/ + @Schema(description = "The related observation unit identifier, if relevent.") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewImageRequest newImageRequest = (NewImageRequest) o; + return Objects.equals(this.additionalInfo, newImageRequest.additionalInfo) && + Objects.equals(this.copyright, newImageRequest.copyright) && + Objects.equals(this.description, newImageRequest.description) && + Objects.equals(this.descriptiveOntologyTerms, newImageRequest.descriptiveOntologyTerms) && + Objects.equals(this.imageFileName, newImageRequest.imageFileName) && + Objects.equals(this.imageFileSize, newImageRequest.imageFileSize) && + Objects.equals(this.imageHeight, newImageRequest.imageHeight) && + Objects.equals(this.imageLocation, newImageRequest.imageLocation) && + Objects.equals(this.imageName, newImageRequest.imageName) && + Objects.equals(this.imageTimeStamp, newImageRequest.imageTimeStamp) && + Objects.equals(this.imageWidth, newImageRequest.imageWidth) && + Objects.equals(this.mimeType, newImageRequest.mimeType) && + Objects.equals(this.observationDbIds, newImageRequest.observationDbIds) && + Objects.equals(this.observationUnitDbId, newImageRequest.observationUnitDbId); + } + + @Override + public int hashCode() { + return Objects.hash(additionalInfo, copyright, description, descriptiveOntologyTerms, imageFileName, imageFileSize, imageHeight, imageLocation, imageName, imageTimeStamp, imageWidth, mimeType, observationDbIds, observationUnitDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewImageRequest {\n"); + + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" copyright: ").append(toIndentedString(copyright)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" descriptiveOntologyTerms: ").append(toIndentedString(descriptiveOntologyTerms)).append("\n"); + sb.append(" imageFileName: ").append(toIndentedString(imageFileName)).append("\n"); + sb.append(" imageFileSize: ").append(toIndentedString(imageFileSize)).append("\n"); + sb.append(" imageHeight: ").append(toIndentedString(imageHeight)).append("\n"); + sb.append(" imageLocation: ").append(toIndentedString(imageLocation)).append("\n"); + sb.append(" imageName: ").append(toIndentedString(imageName)).append("\n"); + sb.append(" imageTimeStamp: ").append(toIndentedString(imageTimeStamp)).append("\n"); + sb.append(" imageWidth: ").append(toIndentedString(imageWidth)).append("\n"); + sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n"); + sb.append(" observationDbIds: ").append(toIndentedString(observationDbIds)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewListRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewListRequest.java new file mode 100755 index 00000000..95c43eeb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewListRequest.java @@ -0,0 +1,259 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ListTypes; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewListRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewListRequest { + @SerializedName("data") + private List data = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("listName") + private String listName = null; + + @SerializedName("listOwnerName") + private String listOwnerName = null; + + @SerializedName("listOwnerPersonDbId") + private String listOwnerPersonDbId = null; + + @SerializedName("listSize") + private Integer listSize = null; + + @SerializedName("listSource") + private String listSource = null; + + @SerializedName("listType") + private ListTypes listType = null; + + public NewListRequest data(List data) { + this.data = data; + return this; + } + + public NewListRequest addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public NewListRequest description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @Schema(description = "") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public NewListRequest listName(String listName) { + this.listName = listName; + return this; + } + + /** + * Get listName + * @return listName + **/ + @Schema(description = "") + public String getListName() { + return listName; + } + + public void setListName(String listName) { + this.listName = listName; + } + + public NewListRequest listOwnerName(String listOwnerName) { + this.listOwnerName = listOwnerName; + return this; + } + + /** + * Get listOwnerName + * @return listOwnerName + **/ + @Schema(description = "") + public String getListOwnerName() { + return listOwnerName; + } + + public void setListOwnerName(String listOwnerName) { + this.listOwnerName = listOwnerName; + } + + public NewListRequest listOwnerPersonDbId(String listOwnerPersonDbId) { + this.listOwnerPersonDbId = listOwnerPersonDbId; + return this; + } + + /** + * Get listOwnerPersonDbId + * @return listOwnerPersonDbId + **/ + @Schema(description = "") + public String getListOwnerPersonDbId() { + return listOwnerPersonDbId; + } + + public void setListOwnerPersonDbId(String listOwnerPersonDbId) { + this.listOwnerPersonDbId = listOwnerPersonDbId; + } + + public NewListRequest listSize(Integer listSize) { + this.listSize = listSize; + return this; + } + + /** + * Get listSize + * @return listSize + **/ + @Schema(description = "") + public Integer getListSize() { + return listSize; + } + + public void setListSize(Integer listSize) { + this.listSize = listSize; + } + + public NewListRequest listSource(String listSource) { + this.listSource = listSource; + return this; + } + + /** + * Get listSource + * @return listSource + **/ + @Schema(description = "") + public String getListSource() { + return listSource; + } + + public void setListSource(String listSource) { + this.listSource = listSource; + } + + public NewListRequest listType(ListTypes listType) { + this.listType = listType; + return this; + } + + /** + * Get listType + * @return listType + **/ + @Schema(required = true, description = "") + public ListTypes getListType() { + return listType; + } + + public void setListType(ListTypes listType) { + this.listType = listType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewListRequest newListRequest = (NewListRequest) o; + return Objects.equals(this.data, newListRequest.data) && + Objects.equals(this.description, newListRequest.description) && + Objects.equals(this.listName, newListRequest.listName) && + Objects.equals(this.listOwnerName, newListRequest.listOwnerName) && + Objects.equals(this.listOwnerPersonDbId, newListRequest.listOwnerPersonDbId) && + Objects.equals(this.listSize, newListRequest.listSize) && + Objects.equals(this.listSource, newListRequest.listSource) && + Objects.equals(this.listType, newListRequest.listType); + } + + @Override + public int hashCode() { + return Objects.hash(data, description, listName, listOwnerName, listOwnerPersonDbId, listSize, listSource, listType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewListRequest {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" listName: ").append(toIndentedString(listName)).append("\n"); + sb.append(" listOwnerName: ").append(toIndentedString(listOwnerName)).append("\n"); + sb.append(" listOwnerPersonDbId: ").append(toIndentedString(listOwnerPersonDbId)).append("\n"); + sb.append(" listSize: ").append(toIndentedString(listSize)).append("\n"); + sb.append(" listSource: ").append(toIndentedString(listSource)).append("\n"); + sb.append(" listType: ").append(toIndentedString(listType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewMethodRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewMethodRequest.java new file mode 100755 index 00000000..034118f1 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewMethodRequest.java @@ -0,0 +1,203 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * new Method request + */ +@Schema(description = "new Method request") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewMethodRequest { + @SerializedName("class") + private String propertyClass = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("formula") + private String formula = null; + + @SerializedName("methodName") + private String methodName = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("reference") + private String reference = null; + + public NewMethodRequest propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Method class (examples: \"Measurement\", \"Counting\", \"Estimation\", \"Computation\", etc.) + * @return propertyClass + **/ + @Schema(description = "Method class (examples: \"Measurement\", \"Counting\", \"Estimation\", \"Computation\", etc.)") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public NewMethodRequest description(String description) { + this.description = description; + return this; + } + + /** + * Method description. + * @return description + **/ + @Schema(description = "Method description.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public NewMethodRequest formula(String formula) { + this.formula = formula; + return this; + } + + /** + * For computational methods i.e., when the method consists in assessing the trait by computing measurements, write the generic formula used for the calculation + * @return formula + **/ + @Schema(description = "For computational methods i.e., when the method consists in assessing the trait by computing measurements, write the generic formula used for the calculation") + public String getFormula() { + return formula; + } + + public void setFormula(String formula) { + this.formula = formula; + } + + public NewMethodRequest methodName(String methodName) { + this.methodName = methodName; + return this; + } + + /** + * Human readable name for the method + * @return methodName + **/ + @Schema(description = "Human readable name for the method") + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + public NewMethodRequest ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public NewMethodRequest reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Bibliographical reference describing the method. + * @return reference + **/ + @Schema(description = "Bibliographical reference describing the method.") + public String getReference() { + return reference; + } + + public void setReference(String reference) { + this.reference = reference; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewMethodRequest newMethodRequest = (NewMethodRequest) o; + return Objects.equals(this.propertyClass, newMethodRequest.propertyClass) && + Objects.equals(this.description, newMethodRequest.description) && + Objects.equals(this.formula, newMethodRequest.formula) && + Objects.equals(this.methodName, newMethodRequest.methodName) && + Objects.equals(this.ontologyReference, newMethodRequest.ontologyReference) && + Objects.equals(this.reference, newMethodRequest.reference); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass, description, formula, methodName, ontologyReference, reference); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewMethodRequest {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" formula: ").append(toIndentedString(formula)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIds.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIds.java new file mode 100755 index 00000000..438b86b2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIds.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.NewObservationDbIdsObservations; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationDbIds + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationDbIds { + @SerializedName("observations") + private List observations = null; + + public NewObservationDbIds observations(List observations) { + this.observations = observations; + return this; + } + + public NewObservationDbIds addObservationsItem(NewObservationDbIdsObservations observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * List of observation references which have been created or updated + * @return observations + **/ + @Schema(description = "List of observation references which have been created or updated") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationDbIds newObservationDbIds = (NewObservationDbIds) o; + return Objects.equals(this.observations, newObservationDbIds.observations); + } + + @Override + public int hashCode() { + return Objects.hash(observations); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationDbIds {\n"); + + sb.append(" observations: ").append(toIndentedString(observations)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsObservations.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsObservations.java new file mode 100755 index 00000000..1ab6eded --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsObservations.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewObservationDbIdsObservations + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationDbIdsObservations { + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + public NewObservationDbIdsObservations observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * Get observationDbId + * @return observationDbId + **/ + @Schema(description = "") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public NewObservationDbIdsObservations observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * Get observationUnitDbId + * @return observationUnitDbId + **/ + @Schema(description = "") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public NewObservationDbIdsObservations observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * Get observationVariableDbId + * @return observationVariableDbId + **/ + @Schema(description = "") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationDbIdsObservations newObservationDbIdsObservations = (NewObservationDbIdsObservations) o; + return Objects.equals(this.observationDbId, newObservationDbIdsObservations.observationDbId) && + Objects.equals(this.observationUnitDbId, newObservationDbIdsObservations.observationUnitDbId) && + Objects.equals(this.observationVariableDbId, newObservationDbIdsObservations.observationVariableDbId); + } + + @Override + public int hashCode() { + return Objects.hash(observationDbId, observationUnitDbId, observationVariableDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationDbIdsObservations {\n"); + + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsResponse.java new file mode 100755 index 00000000..a858d066 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationDbIdsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.NewObservationDbIds; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewObservationDbIdsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationDbIdsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private NewObservationDbIds result = null; + + public NewObservationDbIdsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public NewObservationDbIdsResponse result(NewObservationDbIds result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public NewObservationDbIds getResult() { + return result; + } + + public void setResult(NewObservationDbIds result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationDbIdsResponse newObservationDbIdsResponse = (NewObservationDbIdsResponse) o; + return Objects.equals(this.metadata, newObservationDbIdsResponse.metadata) && + Objects.equals(this.result, newObservationDbIdsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationDbIdsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIds.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIds.java new file mode 100755 index 00000000..12ed45ba --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIds.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationUnitDbIds + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationUnitDbIds { + @SerializedName("observationUnitDbIds") + private List observationUnitDbIds = null; + + public NewObservationUnitDbIds observationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + return this; + } + + public NewObservationUnitDbIds addObservationUnitDbIdsItem(String observationUnitDbIdsItem) { + if (this.observationUnitDbIds == null) { + this.observationUnitDbIds = new ArrayList(); + } + this.observationUnitDbIds.add(observationUnitDbIdsItem); + return this; + } + + /** + * List of observation unit references which have been created or updated + * @return observationUnitDbIds + **/ + @Schema(description = "List of observation unit references which have been created or updated") + public List getObservationUnitDbIds() { + return observationUnitDbIds; + } + + public void setObservationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationUnitDbIds newObservationUnitDbIds = (NewObservationUnitDbIds) o; + return Objects.equals(this.observationUnitDbIds, newObservationUnitDbIds.observationUnitDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(observationUnitDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationUnitDbIds {\n"); + + sb.append(" observationUnitDbIds: ").append(toIndentedString(observationUnitDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIdsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIdsResponse.java new file mode 100755 index 00000000..1106e073 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitDbIdsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.NewObservationUnitDbIds; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewObservationUnitDbIdsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationUnitDbIdsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private NewObservationUnitDbIds result = null; + + public NewObservationUnitDbIdsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public NewObservationUnitDbIdsResponse result(NewObservationUnitDbIds result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public NewObservationUnitDbIds getResult() { + return result; + } + + public void setResult(NewObservationUnitDbIds result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationUnitDbIdsResponse newObservationUnitDbIdsResponse = (NewObservationUnitDbIdsResponse) o; + return Objects.equals(this.metadata, newObservationUnitDbIdsResponse.metadata) && + Objects.equals(this.result, newObservationUnitDbIdsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationUnitDbIdsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitRequest.java new file mode 100755 index 00000000..376fc3ec --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationUnitRequest.java @@ -0,0 +1,651 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.Observation; +import io.swagger.client.model.ObservationTreatment; +import io.swagger.client.model.ObservationUnitXref; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationUnitRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationUnitRequest { + @SerializedName("X") + private String X = null; + + @SerializedName("Y") + private String Y = null; + + @SerializedName("blockNumber") + private String blockNumber = null; + + @SerializedName("entryNumber") + private String entryNumber = null; + + @SerializedName("entryType") + private String entryType = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationUnitName") + private String observationUnitName = null; + + @SerializedName("observationUnitXref") + private List observationUnitXref = null; + + @SerializedName("observations") + private List observations = null; + + @SerializedName("plantNumber") + private String plantNumber = null; + + @SerializedName("plotNumber") + private String plotNumber = null; + + @SerializedName("positionCoordinateX") + private String positionCoordinateX = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateXTypeEnum.Adapter.class) + public enum PositionCoordinateXTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateXTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateXTypeEnum fromValue(String text) { + for (PositionCoordinateXTypeEnum b : PositionCoordinateXTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateXTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateXTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateXTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateXType") + private PositionCoordinateXTypeEnum positionCoordinateXType = null; + + @SerializedName("positionCoordinateY") + private String positionCoordinateY = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateYTypeEnum.Adapter.class) + public enum PositionCoordinateYTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateYTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateYTypeEnum fromValue(String text) { + for (PositionCoordinateYTypeEnum b : PositionCoordinateYTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateYTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateYTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateYTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateYType") + private PositionCoordinateYTypeEnum positionCoordinateYType = null; + + @SerializedName("replicate") + private String replicate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("treatments") + private List treatments = null; + + public NewObservationUnitRequest X(String X) { + this.X = X; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateX\" + * @return X + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateX\"") + public String getX() { + return X; + } + + public void setX(String X) { + this.X = X; + } + + public NewObservationUnitRequest Y(String Y) { + this.Y = Y; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateY\" + * @return Y + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateY\"") + public String getY() { + return Y; + } + + public void setY(String Y) { + this.Y = Y; + } + + public NewObservationUnitRequest blockNumber(String blockNumber) { + this.blockNumber = blockNumber; + return this; + } + + /** + * The block number for an observation unit. Different systems may use different block designs. + * @return blockNumber + **/ + @Schema(description = "The block number for an observation unit. Different systems may use different block designs.") + public String getBlockNumber() { + return blockNumber; + } + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + public NewObservationUnitRequest entryNumber(String entryNumber) { + this.entryNumber = entryNumber; + return this; + } + + /** + * The entry number for an observation unit. Different systems may use different entry systems. + * @return entryNumber + **/ + @Schema(description = "The entry number for an observation unit. Different systems may use different entry systems.") + public String getEntryNumber() { + return entryNumber; + } + + public void setEntryNumber(String entryNumber) { + this.entryNumber = entryNumber; + } + + public NewObservationUnitRequest entryType(String entryType) { + this.entryType = entryType; + return this; + } + + /** + * The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\" + * @return entryType + **/ + @Schema(description = "The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\"") + public String getEntryType() { + return entryType; + } + + public void setEntryType(String entryType) { + this.entryType = entryType; + } + + public NewObservationUnitRequest germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public NewObservationUnitRequest observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The level of an observation unit. ex. \"plot\", \"plant\" + * @return observationLevel + **/ + @Schema(description = "The level of an observation unit. ex. \"plot\", \"plant\"") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public NewObservationUnitRequest observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public NewObservationUnitRequest observationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + return this; + } + + /** + * A human readable name for an observation unit + * @return observationUnitName + **/ + @Schema(description = "A human readable name for an observation unit") + public String getObservationUnitName() { + return observationUnitName; + } + + public void setObservationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + } + + public NewObservationUnitRequest observationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + return this; + } + + public NewObservationUnitRequest addObservationUnitXrefItem(ObservationUnitXref observationUnitXrefItem) { + if (this.observationUnitXref == null) { + this.observationUnitXref = new ArrayList(); + } + this.observationUnitXref.add(observationUnitXrefItem); + return this; + } + + /** + * A list of external references to this observation unit + * @return observationUnitXref + **/ + @Schema(description = "A list of external references to this observation unit") + public List getObservationUnitXref() { + return observationUnitXref; + } + + public void setObservationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + } + + public NewObservationUnitRequest observations(List observations) { + this.observations = observations; + return this; + } + + public NewObservationUnitRequest addObservationsItem(Observation observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * List of observations associated with this observation unit + * @return observations + **/ + @Schema(description = "List of observations associated with this observation unit") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + public NewObservationUnitRequest plantNumber(String plantNumber) { + this.plantNumber = plantNumber; + return this; + } + + /** + * The plant number in a field. Applicable for observationLevel: \"plant\" + * @return plantNumber + **/ + @Schema(description = "The plant number in a field. Applicable for observationLevel: \"plant\"") + public String getPlantNumber() { + return plantNumber; + } + + public void setPlantNumber(String plantNumber) { + this.plantNumber = plantNumber; + } + + public NewObservationUnitRequest plotNumber(String plotNumber) { + this.plotNumber = plotNumber; + return this; + } + + /** + * The plot number in a field. Applicable for observationLevel: \"plot\" + * @return plotNumber + **/ + @Schema(description = "The plot number in a field. Applicable for observationLevel: \"plot\"") + public String getPlotNumber() { + return plotNumber; + } + + public void setPlotNumber(String plotNumber) { + this.plotNumber = plotNumber; + } + + public NewObservationUnitRequest positionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + return this; + } + + /** + * The X position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateX + **/ + @Schema(description = "The X position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateX() { + return positionCoordinateX; + } + + public void setPositionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + } + + public NewObservationUnitRequest positionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateXType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateXTypeEnum getPositionCoordinateXType() { + return positionCoordinateXType; + } + + public void setPositionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + } + + public NewObservationUnitRequest positionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + return this; + } + + /** + * The Y position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateY + **/ + @Schema(description = "The Y position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateY() { + return positionCoordinateY; + } + + public void setPositionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + } + + public NewObservationUnitRequest positionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateYType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateYTypeEnum getPositionCoordinateYType() { + return positionCoordinateYType; + } + + public void setPositionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + } + + public NewObservationUnitRequest replicate(String replicate) { + this.replicate = replicate; + return this; + } + + /** + * The replicate number of an observation unit. May be the same as blockNumber. + * @return replicate + **/ + @Schema(description = "The replicate number of an observation unit. May be the same as blockNumber.") + public String getReplicate() { + return replicate; + } + + public void setReplicate(String replicate) { + this.replicate = replicate; + } + + public NewObservationUnitRequest studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public NewObservationUnitRequest treatments(List treatments) { + this.treatments = treatments; + return this; + } + + public NewObservationUnitRequest addTreatmentsItem(ObservationTreatment treatmentsItem) { + if (this.treatments == null) { + this.treatments = new ArrayList(); + } + this.treatments.add(treatmentsItem); + return this; + } + + /** + * List of treatments applied to an observation unit. + * @return treatments + **/ + @Schema(description = "List of treatments applied to an observation unit.") + public List getTreatments() { + return treatments; + } + + public void setTreatments(List treatments) { + this.treatments = treatments; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationUnitRequest newObservationUnitRequest = (NewObservationUnitRequest) o; + return Objects.equals(this.X, newObservationUnitRequest.X) && + Objects.equals(this.Y, newObservationUnitRequest.Y) && + Objects.equals(this.blockNumber, newObservationUnitRequest.blockNumber) && + Objects.equals(this.entryNumber, newObservationUnitRequest.entryNumber) && + Objects.equals(this.entryType, newObservationUnitRequest.entryType) && + Objects.equals(this.germplasmDbId, newObservationUnitRequest.germplasmDbId) && + Objects.equals(this.observationLevel, newObservationUnitRequest.observationLevel) && + Objects.equals(this.observationUnitDbId, newObservationUnitRequest.observationUnitDbId) && + Objects.equals(this.observationUnitName, newObservationUnitRequest.observationUnitName) && + Objects.equals(this.observationUnitXref, newObservationUnitRequest.observationUnitXref) && + Objects.equals(this.observations, newObservationUnitRequest.observations) && + Objects.equals(this.plantNumber, newObservationUnitRequest.plantNumber) && + Objects.equals(this.plotNumber, newObservationUnitRequest.plotNumber) && + Objects.equals(this.positionCoordinateX, newObservationUnitRequest.positionCoordinateX) && + Objects.equals(this.positionCoordinateXType, newObservationUnitRequest.positionCoordinateXType) && + Objects.equals(this.positionCoordinateY, newObservationUnitRequest.positionCoordinateY) && + Objects.equals(this.positionCoordinateYType, newObservationUnitRequest.positionCoordinateYType) && + Objects.equals(this.replicate, newObservationUnitRequest.replicate) && + Objects.equals(this.studyDbId, newObservationUnitRequest.studyDbId) && + Objects.equals(this.treatments, newObservationUnitRequest.treatments); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, blockNumber, entryNumber, entryType, germplasmDbId, observationLevel, observationUnitDbId, observationUnitName, observationUnitXref, observations, plantNumber, plotNumber, positionCoordinateX, positionCoordinateXType, positionCoordinateY, positionCoordinateYType, replicate, studyDbId, treatments); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationUnitRequest {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" entryNumber: ").append(toIndentedString(entryNumber)).append("\n"); + sb.append(" entryType: ").append(toIndentedString(entryType)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationUnitName: ").append(toIndentedString(observationUnitName)).append("\n"); + sb.append(" observationUnitXref: ").append(toIndentedString(observationUnitXref)).append("\n"); + sb.append(" observations: ").append(toIndentedString(observations)).append("\n"); + sb.append(" plantNumber: ").append(toIndentedString(plantNumber)).append("\n"); + sb.append(" plotNumber: ").append(toIndentedString(plotNumber)).append("\n"); + sb.append(" positionCoordinateX: ").append(toIndentedString(positionCoordinateX)).append("\n"); + sb.append(" positionCoordinateXType: ").append(toIndentedString(positionCoordinateXType)).append("\n"); + sb.append(" positionCoordinateY: ").append(toIndentedString(positionCoordinateY)).append("\n"); + sb.append(" positionCoordinateYType: ").append(toIndentedString(positionCoordinateYType)).append("\n"); + sb.append(" replicate: ").append(toIndentedString(replicate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" treatments: ").append(toIndentedString(treatments)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequest.java new file mode 100755 index 00000000..3b6f3026 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequest.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.NewObservationsRequestObservations; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationsRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsRequest { + @SerializedName("observations") + private List observations = null; + + public NewObservationsRequest observations(List observations) { + this.observations = observations; + return this; + } + + public NewObservationsRequest addObservationsItem(NewObservationsRequestObservations observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * List of observation references to be created or updated + * @return observations + **/ + @Schema(description = "List of observation references to be created or updated") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsRequest newObservationsRequest = (NewObservationsRequest) o; + return Objects.equals(this.observations, newObservationsRequest.observations); + } + + @Override + public int hashCode() { + return Objects.hash(observations); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsRequest {\n"); + + sb.append(" observations: ").append(toIndentedString(observations)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecated.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecated.java new file mode 100755 index 00000000..39847597 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecated.java @@ -0,0 +1,144 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.NewObservationsRequestDeprecatedData; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationsRequestDeprecated + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsRequestDeprecated { + @SerializedName("commit") + private String commit = null; + + @SerializedName("data") + private List data = null; + + @SerializedName("transactionDbId") + private String transactionDbId = null; + + public NewObservationsRequestDeprecated commit(String commit) { + this.commit = commit; + return this; + } + + /** + * Should these changes be commited + * @return commit + **/ + @Schema(description = "Should these changes be commited") + public String getCommit() { + return commit; + } + + public void setCommit(String commit) { + this.commit = commit; + } + + public NewObservationsRequestDeprecated data(List data) { + this.data = data; + return this; + } + + public NewObservationsRequestDeprecated addDataItem(NewObservationsRequestDeprecatedData dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Required array of marker-name/score pairs + * @return data + **/ + @Schema(description = "Required array of marker-name/score pairs") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public NewObservationsRequestDeprecated transactionDbId(String transactionDbId) { + this.transactionDbId = transactionDbId; + return this; + } + + /** + * The ID representing this transaction + * @return transactionDbId + **/ + @Schema(description = "The ID representing this transaction") + public String getTransactionDbId() { + return transactionDbId; + } + + public void setTransactionDbId(String transactionDbId) { + this.transactionDbId = transactionDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsRequestDeprecated newObservationsRequestDeprecated = (NewObservationsRequestDeprecated) o; + return Objects.equals(this.commit, newObservationsRequestDeprecated.commit) && + Objects.equals(this.data, newObservationsRequestDeprecated.data) && + Objects.equals(this.transactionDbId, newObservationsRequestDeprecated.transactionDbId); + } + + @Override + public int hashCode() { + return Objects.hash(commit, data, transactionDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsRequestDeprecated {\n"); + + sb.append(" commit: ").append(toIndentedString(commit)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" transactionDbId: ").append(toIndentedString(transactionDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecatedData.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecatedData.java new file mode 100755 index 00000000..b6a43ab4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestDeprecatedData.java @@ -0,0 +1,145 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.NewObservationsRequestObservations; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationsRequestDeprecatedData + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsRequestDeprecatedData { + @SerializedName("observatioUnitDbId") + private String observatioUnitDbId = null; + + @SerializedName("observations") + private List observations = null; + + @SerializedName("studyDbId") + private BigDecimal studyDbId = null; + + public NewObservationsRequestDeprecatedData observatioUnitDbId(String observatioUnitDbId) { + this.observatioUnitDbId = observatioUnitDbId; + return this; + } + + /** + * Get observatioUnitDbId + * @return observatioUnitDbId + **/ + @Schema(description = "") + public String getObservatioUnitDbId() { + return observatioUnitDbId; + } + + public void setObservatioUnitDbId(String observatioUnitDbId) { + this.observatioUnitDbId = observatioUnitDbId; + } + + public NewObservationsRequestDeprecatedData observations(List observations) { + this.observations = observations; + return this; + } + + public NewObservationsRequestDeprecatedData addObservationsItem(NewObservationsRequestObservations observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * Get observations + * @return observations + **/ + @Schema(description = "") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + public NewObservationsRequestDeprecatedData studyDbId(BigDecimal studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Get studyDbId + * @return studyDbId + **/ + @Schema(description = "") + public BigDecimal getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(BigDecimal studyDbId) { + this.studyDbId = studyDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsRequestDeprecatedData newObservationsRequestDeprecatedData = (NewObservationsRequestDeprecatedData) o; + return Objects.equals(this.observatioUnitDbId, newObservationsRequestDeprecatedData.observatioUnitDbId) && + Objects.equals(this.observations, newObservationsRequestDeprecatedData.observations) && + Objects.equals(this.studyDbId, newObservationsRequestDeprecatedData.studyDbId); + } + + @Override + public int hashCode() { + return Objects.hash(observatioUnitDbId, observations, studyDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsRequestDeprecatedData {\n"); + + sb.append(" observatioUnitDbId: ").append(toIndentedString(observatioUnitDbId)).append("\n"); + sb.append(" observations: ").append(toIndentedString(observations)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestObservations.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestObservations.java new file mode 100755 index 00000000..9e1e510b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestObservations.java @@ -0,0 +1,202 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * NewObservationsRequestObservations + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsRequestObservations { + @SerializedName("collector") + private String collector = null; + + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationTimeStamp") + private OffsetDateTime observationTimeStamp = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("value") + private String value = null; + + public NewObservationsRequestObservations collector(String collector) { + this.collector = collector; + return this; + } + + /** + * Get collector + * @return collector + **/ + @Schema(description = "") + public String getCollector() { + return collector; + } + + public void setCollector(String collector) { + this.collector = collector; + } + + public NewObservationsRequestObservations observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * Get observationDbId + * @return observationDbId + **/ + @Schema(description = "") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public NewObservationsRequestObservations observationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + return this; + } + + /** + * Get observationTimeStamp + * @return observationTimeStamp + **/ + @Schema(description = "") + public OffsetDateTime getObservationTimeStamp() { + return observationTimeStamp; + } + + public void setObservationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + } + + public NewObservationsRequestObservations observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * Get observationUnitDbId + * @return observationUnitDbId + **/ + @Schema(description = "") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public NewObservationsRequestObservations observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * Get observationVariableDbId + * @return observationVariableDbId + **/ + @Schema(description = "") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public NewObservationsRequestObservations value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @Schema(description = "") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsRequestObservations newObservationsRequestObservations = (NewObservationsRequestObservations) o; + return Objects.equals(this.collector, newObservationsRequestObservations.collector) && + Objects.equals(this.observationDbId, newObservationsRequestObservations.observationDbId) && + Objects.equals(this.observationTimeStamp, newObservationsRequestObservations.observationTimeStamp) && + Objects.equals(this.observationUnitDbId, newObservationsRequestObservations.observationUnitDbId) && + Objects.equals(this.observationVariableDbId, newObservationsRequestObservations.observationVariableDbId) && + Objects.equals(this.value, newObservationsRequestObservations.value); + } + + @Override + public int hashCode() { + return Objects.hash(collector, observationDbId, observationTimeStamp, observationUnitDbId, observationVariableDbId, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsRequestObservations {\n"); + + sb.append(" collector: ").append(toIndentedString(collector)).append("\n"); + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationTimeStamp: ").append(toIndentedString(observationTimeStamp)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestWrapperDeprecated.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestWrapperDeprecated.java new file mode 100755 index 00000000..597f1f3b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsRequestWrapperDeprecated.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.NewObservationsRequestDeprecated; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewObservationsRequestWrapperDeprecated + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsRequestWrapperDeprecated { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private NewObservationsRequestDeprecated result = null; + + public NewObservationsRequestWrapperDeprecated metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public NewObservationsRequestWrapperDeprecated result(NewObservationsRequestDeprecated result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public NewObservationsRequestDeprecated getResult() { + return result; + } + + public void setResult(NewObservationsRequestDeprecated result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsRequestWrapperDeprecated newObservationsRequestWrapperDeprecated = (NewObservationsRequestWrapperDeprecated) o; + return Objects.equals(this.metadata, newObservationsRequestWrapperDeprecated.metadata) && + Objects.equals(this.result, newObservationsRequestWrapperDeprecated.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsRequestWrapperDeprecated {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequest.java new file mode 100755 index 00000000..146bbacb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequest.java @@ -0,0 +1,206 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.NewObservationsTableRequestResult; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewObservationsTableRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsTableRequest { + @SerializedName("data") + private List> data = null; + + @SerializedName("headerRow") + private List headerRow = null; + + @SerializedName("metadata") + private Object metadata = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("result") + private NewObservationsTableRequestResult result = null; + + public NewObservationsTableRequest data(List> data) { + this.data = data; + return this; + } + + public NewObservationsTableRequest addDataItem(List dataItem) { + if (this.data == null) { + this.data = new ArrayList>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Matrix of observation data recorded for different observation variables across different observation units + * @return data + **/ + @Schema(description = "Matrix of observation data recorded for different observation variables across different observation units") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + public NewObservationsTableRequest headerRow(List headerRow) { + this.headerRow = headerRow; + return this; + } + + public NewObservationsTableRequest addHeaderRowItem(String headerRowItem) { + if (this.headerRow == null) { + this.headerRow = new ArrayList(); + } + this.headerRow.add(headerRowItem); + return this; + } + + /** + * The header row describing the data matrix. Append 'observationVariableDbIds' for complete header row. + * @return headerRow + **/ + @Schema(description = "The header row describing the data matrix. Append 'observationVariableDbIds' for complete header row.") + public List getHeaderRow() { + return headerRow; + } + + public void setHeaderRow(List headerRow) { + this.headerRow = headerRow; + } + + public NewObservationsTableRequest metadata(Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * DEPRECATED + * @return metadata + **/ + @Schema(description = "DEPRECATED") + public Object getMetadata() { + return metadata; + } + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + public NewObservationsTableRequest observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public NewObservationsTableRequest addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * The list of observation variables which have values recorded for them in the data matrix. Append to the 'headerRow' for comlete header row. + * @return observationVariableDbIds + **/ + @Schema(description = "The list of observation variables which have values recorded for them in the data matrix. Append to the 'headerRow' for comlete header row.") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public NewObservationsTableRequest result(NewObservationsTableRequestResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public NewObservationsTableRequestResult getResult() { + return result; + } + + public void setResult(NewObservationsTableRequestResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsTableRequest newObservationsTableRequest = (NewObservationsTableRequest) o; + return Objects.equals(this.data, newObservationsTableRequest.data) && + Objects.equals(this.headerRow, newObservationsTableRequest.headerRow) && + Objects.equals(this.metadata, newObservationsTableRequest.metadata) && + Objects.equals(this.observationVariableDbIds, newObservationsTableRequest.observationVariableDbIds) && + Objects.equals(this.result, newObservationsTableRequest.result); + } + + @Override + public int hashCode() { + return Objects.hash(data, headerRow, metadata, observationVariableDbIds, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsTableRequest {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" headerRow: ").append(toIndentedString(headerRow)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequestResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequestResult.java new file mode 100755 index 00000000..22a1ae08 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewObservationsTableRequestResult.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * DEPRECATED + */ +@Schema(description = "DEPRECATED") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewObservationsTableRequestResult { + @SerializedName("data") + private List> data = null; + + public NewObservationsTableRequestResult data(List> data) { + this.data = data; + return this; + } + + public NewObservationsTableRequestResult addDataItem(List dataItem) { + if (this.data == null) { + this.data = new ArrayList>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewObservationsTableRequestResult newObservationsTableRequestResult = (NewObservationsTableRequestResult) o; + return Objects.equals(this.data, newObservationsTableRequestResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewObservationsTableRequestResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewPersonRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewPersonRequest.java new file mode 100755 index 00000000..263f7a71 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewPersonRequest.java @@ -0,0 +1,248 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewPersonRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewPersonRequest { + @SerializedName("description") + private String description = null; + + @SerializedName("emailAddress") + private String emailAddress = null; + + @SerializedName("firstName") + private String firstName = null; + + @SerializedName("lastName") + private String lastName = null; + + @SerializedName("mailingAddress") + private String mailingAddress = null; + + @SerializedName("middleName") + private String middleName = null; + + @SerializedName("phoneNumber") + private String phoneNumber = null; + + @SerializedName("userID") + private String userID = null; + + public NewPersonRequest description(String description) { + this.description = description; + return this; + } + + /** + * description of this person + * @return description + **/ + @Schema(description = "description of this person") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public NewPersonRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * email address for this person + * @return emailAddress + **/ + @Schema(description = "email address for this person") + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public NewPersonRequest firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Persons first name + * @return firstName + **/ + @Schema(description = "Persons first name") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public NewPersonRequest lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Persons last name + * @return lastName + **/ + @Schema(description = "Persons last name") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public NewPersonRequest mailingAddress(String mailingAddress) { + this.mailingAddress = mailingAddress; + return this; + } + + /** + * physical address of this person + * @return mailingAddress + **/ + @Schema(description = "physical address of this person") + public String getMailingAddress() { + return mailingAddress; + } + + public void setMailingAddress(String mailingAddress) { + this.mailingAddress = mailingAddress; + } + + public NewPersonRequest middleName(String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Persons middle name + * @return middleName + **/ + @Schema(description = "Persons middle name") + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public NewPersonRequest phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * phone number of this person + * @return phoneNumber + **/ + @Schema(description = "phone number of this person") + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public NewPersonRequest userID(String userID) { + this.userID = userID; + return this; + } + + /** + * A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. + * @return userID + **/ + @Schema(description = "A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system.") + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewPersonRequest newPersonRequest = (NewPersonRequest) o; + return Objects.equals(this.description, newPersonRequest.description) && + Objects.equals(this.emailAddress, newPersonRequest.emailAddress) && + Objects.equals(this.firstName, newPersonRequest.firstName) && + Objects.equals(this.lastName, newPersonRequest.lastName) && + Objects.equals(this.mailingAddress, newPersonRequest.mailingAddress) && + Objects.equals(this.middleName, newPersonRequest.middleName) && + Objects.equals(this.phoneNumber, newPersonRequest.phoneNumber) && + Objects.equals(this.userID, newPersonRequest.userID); + } + + @Override + public int hashCode() { + return Objects.hash(description, emailAddress, firstName, lastName, mailingAddress, middleName, phoneNumber, userID); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewPersonRequest {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" mailingAddress: ").append(toIndentedString(mailingAddress)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbId.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbId.java new file mode 100755 index 00000000..36606abc --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbId.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.NewSampleDbIdResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * NewSampleDbId + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewSampleDbId { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private NewSampleDbIdResult result = null; + + public NewSampleDbId metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public NewSampleDbId result(NewSampleDbIdResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public NewSampleDbIdResult getResult() { + return result; + } + + public void setResult(NewSampleDbIdResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSampleDbId newSampleDbId = (NewSampleDbId) o; + return Objects.equals(this.metadata, newSampleDbId.metadata) && + Objects.equals(this.result, newSampleDbId.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSampleDbId {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbIdResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbIdResult.java new file mode 100755 index 00000000..794b756f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewSampleDbIdResult.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * List of sample references which have been created or updated + */ +@Schema(description = "List of sample references which have been created or updated") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewSampleDbIdResult { + @SerializedName("sampleDbId") + private String sampleDbId = null; + + @SerializedName("sampleId") + private String sampleId = null; + + public NewSampleDbIdResult sampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + return this; + } + + /** + * Get sampleDbId + * @return sampleDbId + **/ + @Schema(description = "") + public String getSampleDbId() { + return sampleDbId; + } + + public void setSampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + } + + public NewSampleDbIdResult sampleId(String sampleId) { + this.sampleId = sampleId; + return this; + } + + /** + * ** Deprecated ** use sampleDbId + * @return sampleId + **/ + @Schema(description = "** Deprecated ** use sampleDbId") + public String getSampleId() { + return sampleId; + } + + public void setSampleId(String sampleId) { + this.sampleId = sampleId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSampleDbIdResult newSampleDbIdResult = (NewSampleDbIdResult) o; + return Objects.equals(this.sampleDbId, newSampleDbIdResult.sampleDbId) && + Objects.equals(this.sampleId, newSampleDbIdResult.sampleId); + } + + @Override + public int hashCode() { + return Objects.hash(sampleDbId, sampleId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSampleDbIdResult {\n"); + + sb.append(" sampleDbId: ").append(toIndentedString(sampleDbId)).append("\n"); + sb.append(" sampleId: ").append(toIndentedString(sampleId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewScaleRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewScaleRequest.java new file mode 100755 index 00000000..c85bfbf4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewScaleRequest.java @@ -0,0 +1,205 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.client.model.TraitDataType; +import io.swagger.client.model.ValidValues; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * New scale request object + */ +@Schema(description = "New scale request object") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewScaleRequest { + @SerializedName("dataType") + private TraitDataType dataType = null; + + @SerializedName("decimalPlaces") + private Integer decimalPlaces = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("scaleName") + private String scaleName = null; + + @SerializedName("validValues") + private ValidValues validValues = null; + + @SerializedName("xref") + private String xref = null; + + public NewScaleRequest dataType(TraitDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get dataType + * @return dataType + **/ + @Schema(description = "") + public TraitDataType getDataType() { + return dataType; + } + + public void setDataType(TraitDataType dataType) { + this.dataType = dataType; + } + + public NewScaleRequest decimalPlaces(Integer decimalPlaces) { + this.decimalPlaces = decimalPlaces; + return this; + } + + /** + * For numerical, number of decimal places to be reported + * @return decimalPlaces + **/ + @Schema(description = "For numerical, number of decimal places to be reported") + public Integer getDecimalPlaces() { + return decimalPlaces; + } + + public void setDecimalPlaces(Integer decimalPlaces) { + this.decimalPlaces = decimalPlaces; + } + + public NewScaleRequest ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public NewScaleRequest scaleName(String scaleName) { + this.scaleName = scaleName; + return this; + } + + /** + * Name of the scale + * @return scaleName + **/ + @Schema(description = "Name of the scale") + public String getScaleName() { + return scaleName; + } + + public void setScaleName(String scaleName) { + this.scaleName = scaleName; + } + + public NewScaleRequest validValues(ValidValues validValues) { + this.validValues = validValues; + return this; + } + + /** + * Get validValues + * @return validValues + **/ + @Schema(description = "") + public ValidValues getValidValues() { + return validValues; + } + + public void setValidValues(ValidValues validValues) { + this.validValues = validValues; + } + + public NewScaleRequest xref(String xref) { + this.xref = xref; + return this; + } + + /** + * Cross reference to the scale, for example to a unit ontology such as UO or to a unit of an external major database + * @return xref + **/ + @Schema(description = "Cross reference to the scale, for example to a unit ontology such as UO or to a unit of an external major database") + public String getXref() { + return xref; + } + + public void setXref(String xref) { + this.xref = xref; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewScaleRequest newScaleRequest = (NewScaleRequest) o; + return Objects.equals(this.dataType, newScaleRequest.dataType) && + Objects.equals(this.decimalPlaces, newScaleRequest.decimalPlaces) && + Objects.equals(this.ontologyReference, newScaleRequest.ontologyReference) && + Objects.equals(this.scaleName, newScaleRequest.scaleName) && + Objects.equals(this.validValues, newScaleRequest.validValues) && + Objects.equals(this.xref, newScaleRequest.xref); + } + + @Override + public int hashCode() { + return Objects.hash(dataType, decimalPlaces, ontologyReference, scaleName, validValues, xref); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewScaleRequest {\n"); + + sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); + sb.append(" decimalPlaces: ").append(toIndentedString(decimalPlaces)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" scaleName: ").append(toIndentedString(scaleName)).append("\n"); + sb.append(" validValues: ").append(toIndentedString(validValues)).append("\n"); + sb.append(" xref: ").append(toIndentedString(xref)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/NewTraitRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/NewTraitRequest.java new file mode 100755 index 00000000..96d10c7f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/NewTraitRequest.java @@ -0,0 +1,336 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * NewTraitRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class NewTraitRequest { + @SerializedName("alternativeAbbreviations") + private List alternativeAbbreviations = null; + + @SerializedName("attribute") + private String attribute = null; + + @SerializedName("class") + private String propertyClass = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("entity") + private String entity = null; + + @SerializedName("mainAbbreviation") + private String mainAbbreviation = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("status") + private String status = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("traitName") + private String traitName = null; + + @SerializedName("xref") + private String xref = null; + + public NewTraitRequest alternativeAbbreviations(List alternativeAbbreviations) { + this.alternativeAbbreviations = alternativeAbbreviations; + return this; + } + + public NewTraitRequest addAlternativeAbbreviationsItem(String alternativeAbbreviationsItem) { + if (this.alternativeAbbreviations == null) { + this.alternativeAbbreviations = new ArrayList(); + } + this.alternativeAbbreviations.add(alternativeAbbreviationsItem); + return this; + } + + /** + * Other frequent abbreviations of the trait, if any. These abbreviations do not have to follow a convention + * @return alternativeAbbreviations + **/ + @Schema(description = "Other frequent abbreviations of the trait, if any. These abbreviations do not have to follow a convention") + public List getAlternativeAbbreviations() { + return alternativeAbbreviations; + } + + public void setAlternativeAbbreviations(List alternativeAbbreviations) { + this.alternativeAbbreviations = alternativeAbbreviations; + } + + public NewTraitRequest attribute(String attribute) { + this.attribute = attribute; + return this; + } + + /** + * A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the attribute is the observed feature (or characteristic) of the entity e.g., for \"grain colour\", attribute = \"colour\" + * @return attribute + **/ + @Schema(description = "A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the attribute is the observed feature (or characteristic) of the entity e.g., for \"grain colour\", attribute = \"colour\"") + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public NewTraitRequest propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Trait class. (examples: \"morphological trait\", \"phenological trait\", \"agronomical trait\", \"physiological trait\", \"abiotic stress trait\", \"biotic stress trait\", \"biochemical trait\", \"quality traits trait\", \"fertility trait\", etc.) + * @return propertyClass + **/ + @Schema(description = "Trait class. (examples: \"morphological trait\", \"phenological trait\", \"agronomical trait\", \"physiological trait\", \"abiotic stress trait\", \"biotic stress trait\", \"biochemical trait\", \"quality traits trait\", \"fertility trait\", etc.)") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public NewTraitRequest description(String description) { + this.description = description; + return this; + } + + /** + * The description of a trait + * @return description + **/ + @Schema(description = "The description of a trait") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public NewTraitRequest entity(String entity) { + this.entity = entity; + return this; + } + + /** + * A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the entity is the part of the plant that the trait refers to e.g., for \"grain colour\", entity = \"grain\" + * @return entity + **/ + @Schema(description = "A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the entity is the part of the plant that the trait refers to e.g., for \"grain colour\", entity = \"grain\"") + public String getEntity() { + return entity; + } + + public void setEntity(String entity) { + this.entity = entity; + } + + public NewTraitRequest mainAbbreviation(String mainAbbreviation) { + this.mainAbbreviation = mainAbbreviation; + return this; + } + + /** + * Main abbreviation for trait name. (examples: \"Carotenoid content\" => \"CC\") + * @return mainAbbreviation + **/ + @Schema(description = "Main abbreviation for trait name. (examples: \"Carotenoid content\" => \"CC\")") + public String getMainAbbreviation() { + return mainAbbreviation; + } + + public void setMainAbbreviation(String mainAbbreviation) { + this.mainAbbreviation = mainAbbreviation; + } + + public NewTraitRequest ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public NewTraitRequest status(String status) { + this.status = status; + return this; + } + + /** + * Trait status (examples: \"recommended\", \"obsolete\", \"legacy\", etc.) + * @return status + **/ + @Schema(description = "Trait status (examples: \"recommended\", \"obsolete\", \"legacy\", etc.)") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public NewTraitRequest synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public NewTraitRequest addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * Other trait names + * @return synonyms + **/ + @Schema(description = "Other trait names") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public NewTraitRequest traitName(String traitName) { + this.traitName = traitName; + return this; + } + + /** + * The human readable name of a trait + * @return traitName + **/ + @Schema(description = "The human readable name of a trait") + public String getTraitName() { + return traitName; + } + + public void setTraitName(String traitName) { + this.traitName = traitName; + } + + public NewTraitRequest xref(String xref) { + this.xref = xref; + return this; + } + + /** + * Cross reference of the trait to an external ontology or database term e.g., Xref to a trait ontology (TO) term + * @return xref + **/ + @Schema(description = "Cross reference of the trait to an external ontology or database term e.g., Xref to a trait ontology (TO) term") + public String getXref() { + return xref; + } + + public void setXref(String xref) { + this.xref = xref; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewTraitRequest newTraitRequest = (NewTraitRequest) o; + return Objects.equals(this.alternativeAbbreviations, newTraitRequest.alternativeAbbreviations) && + Objects.equals(this.attribute, newTraitRequest.attribute) && + Objects.equals(this.propertyClass, newTraitRequest.propertyClass) && + Objects.equals(this.description, newTraitRequest.description) && + Objects.equals(this.entity, newTraitRequest.entity) && + Objects.equals(this.mainAbbreviation, newTraitRequest.mainAbbreviation) && + Objects.equals(this.ontologyReference, newTraitRequest.ontologyReference) && + Objects.equals(this.status, newTraitRequest.status) && + Objects.equals(this.synonyms, newTraitRequest.synonyms) && + Objects.equals(this.traitName, newTraitRequest.traitName) && + Objects.equals(this.xref, newTraitRequest.xref); + } + + @Override + public int hashCode() { + return Objects.hash(alternativeAbbreviations, attribute, propertyClass, description, entity, mainAbbreviation, ontologyReference, status, synonyms, traitName, xref); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewTraitRequest {\n"); + + sb.append(" alternativeAbbreviations: ").append(toIndentedString(alternativeAbbreviations)).append("\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" mainAbbreviation: ").append(toIndentedString(mainAbbreviation)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" traitName: ").append(toIndentedString(traitName)).append("\n"); + sb.append(" xref: ").append(toIndentedString(xref)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Observation.java b/brapi-client/src/main/resources/swagger-generated-client/model/Observation.java new file mode 100755 index 00000000..d3ac5926 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Observation.java @@ -0,0 +1,387 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Season; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * Observation + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Observation { + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationTimeStamp") + private OffsetDateTime observationTimeStamp = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationUnitName") + private String observationUnitName = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("observationVariableName") + private String observationVariableName = null; + + @SerializedName("operator") + private String operator = null; + + @SerializedName("season") + private Season season = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("uploadedBy") + private String uploadedBy = null; + + @SerializedName("value") + private String value = null; + + public Observation germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public Observation germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public Observation observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation + * @return observationDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public Observation observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The level of an observation unit. ex. \"plot\", \"plant\" + * @return observationLevel + **/ + @Schema(description = "The level of an observation unit. ex. \"plot\", \"plant\"") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public Observation observationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + return this; + } + + /** + * The date and time when this observation was made + * @return observationTimeStamp + **/ + @Schema(description = "The date and time when this observation was made ") + public OffsetDateTime getObservationTimeStamp() { + return observationTimeStamp; + } + + public void setObservationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + } + + public Observation observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public Observation observationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + return this; + } + + /** + * A human readable name for an observation unit + * @return observationUnitName + **/ + @Schema(description = "A human readable name for an observation unit") + public String getObservationUnitName() { + return observationUnitName; + } + + public void setObservationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + } + + public Observation observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation variable + * @return observationVariableDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation variable") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public Observation observationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + return this; + } + + /** + * A human readable name for an observation variable + * @return observationVariableName + **/ + @Schema(description = "A human readable name for an observation variable") + public String getObservationVariableName() { + return observationVariableName; + } + + public void setObservationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + } + + public Observation operator(String operator) { + this.operator = operator; + return this; + } + + /** + * The name or identifier of the entity which collected the observation + * @return operator + **/ + @Schema(description = "The name or identifier of the entity which collected the observation") + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public Observation season(Season season) { + this.season = season; + return this; + } + + /** + * Get season + * @return season + **/ + @Schema(description = "") + public Season getSeason() { + return season; + } + + public void setSeason(Season season) { + this.season = season; + } + + public Observation studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public Observation uploadedBy(String uploadedBy) { + this.uploadedBy = uploadedBy; + return this; + } + + /** + * The name or id of the user who uploaded the observation to the database system + * @return uploadedBy + **/ + @Schema(description = "The name or id of the user who uploaded the observation to the database system") + public String getUploadedBy() { + return uploadedBy; + } + + public void setUploadedBy(String uploadedBy) { + this.uploadedBy = uploadedBy; + } + + public Observation value(String value) { + this.value = value; + return this; + } + + /** + * The value of the data collected as an observation + * @return value + **/ + @Schema(description = "The value of the data collected as an observation") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Observation observation = (Observation) o; + return Objects.equals(this.germplasmDbId, observation.germplasmDbId) && + Objects.equals(this.germplasmName, observation.germplasmName) && + Objects.equals(this.observationDbId, observation.observationDbId) && + Objects.equals(this.observationLevel, observation.observationLevel) && + Objects.equals(this.observationTimeStamp, observation.observationTimeStamp) && + Objects.equals(this.observationUnitDbId, observation.observationUnitDbId) && + Objects.equals(this.observationUnitName, observation.observationUnitName) && + Objects.equals(this.observationVariableDbId, observation.observationVariableDbId) && + Objects.equals(this.observationVariableName, observation.observationVariableName) && + Objects.equals(this.operator, observation.operator) && + Objects.equals(this.season, observation.season) && + Objects.equals(this.studyDbId, observation.studyDbId) && + Objects.equals(this.uploadedBy, observation.uploadedBy) && + Objects.equals(this.value, observation.value); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbId, germplasmName, observationDbId, observationLevel, observationTimeStamp, observationUnitDbId, observationUnitName, observationVariableDbId, observationVariableName, operator, season, studyDbId, uploadedBy, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Observation {\n"); + + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationTimeStamp: ").append(toIndentedString(observationTimeStamp)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationUnitName: ").append(toIndentedString(observationUnitName)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" observationVariableName: ").append(toIndentedString(observationVariableName)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" season: ").append(toIndentedString(season)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" uploadedBy: ").append(toIndentedString(uploadedBy)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse.java new file mode 100755 index 00000000..7adbb089 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationLevelsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationLevelsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationLevelsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationLevelsResponseResult result = null; + + public ObservationLevelsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationLevelsResponse result(ObservationLevelsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public ObservationLevelsResponseResult getResult() { + return result; + } + + public void setResult(ObservationLevelsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationLevelsResponse observationLevelsResponse = (ObservationLevelsResponse) o; + return Objects.equals(this.metadata, observationLevelsResponse.metadata) && + Objects.equals(this.result, observationLevelsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationLevelsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1.java new file mode 100755 index 00000000..ea40124d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationLevelsResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationLevelsResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationLevelsResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationLevelsResponse1Result result = null; + + public ObservationLevelsResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationLevelsResponse1 result(ObservationLevelsResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationLevelsResponse1Result getResult() { + return result; + } + + public void setResult(ObservationLevelsResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationLevelsResponse1 observationLevelsResponse1 = (ObservationLevelsResponse1) o; + return Objects.equals(this.metadata, observationLevelsResponse1.metadata) && + Objects.equals(this.result, observationLevelsResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationLevelsResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1Result.java new file mode 100755 index 00000000..f7b3dfe0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponse1Result.java @@ -0,0 +1,94 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationLevelsResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationLevelsResponse1Result { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationLevelsResponse1Result data(List data) { + this.data = data; + return this; + } + + public ObservationLevelsResponse1Result addDataItem(String dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationLevelsResponse1Result observationLevelsResponse1Result = (ObservationLevelsResponse1Result) o; + return Objects.equals(this.data, observationLevelsResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationLevelsResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponseResult.java new file mode 100755 index 00000000..f5ce1669 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationLevelsResponseResult.java @@ -0,0 +1,97 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationLevelsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationLevelsResponseResult { + @SerializedName("data") + private List data = null; + + public ObservationLevelsResponseResult data(List data) { + this.data = data; + return this; + } + + public ObservationLevelsResponseResult addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationLevelsResponseResult observationLevelsResponseResult = (ObservationLevelsResponseResult) o; + return Objects.equals(this.data, observationLevelsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationLevelsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummary.java new file mode 100755 index 00000000..347492d9 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummary.java @@ -0,0 +1,226 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Season; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * ObservationSummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationSummary { + @SerializedName("collector") + private String collector = null; + + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationTimeStamp") + private OffsetDateTime observationTimeStamp = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("observationVariableName") + private String observationVariableName = null; + + @SerializedName("season") + private Season season = null; + + @SerializedName("value") + private String value = null; + + public ObservationSummary collector(String collector) { + this.collector = collector; + return this; + } + + /** + * The name or identifier of the entity which collected the observation + * @return collector + **/ + @Schema(description = "The name or identifier of the entity which collected the observation") + public String getCollector() { + return collector; + } + + public void setCollector(String collector) { + this.collector = collector; + } + + public ObservationSummary observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation + * @return observationDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public ObservationSummary observationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + return this; + } + + /** + * The date and time when this observation was made + * @return observationTimeStamp + **/ + @Schema(description = "The date and time when this observation was made ") + public OffsetDateTime getObservationTimeStamp() { + return observationTimeStamp; + } + + public void setObservationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + } + + public ObservationSummary observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation variable + * @return observationVariableDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation variable") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public ObservationSummary observationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + return this; + } + + /** + * A human readable name for an observation variable + * @return observationVariableName + **/ + @Schema(description = "A human readable name for an observation variable") + public String getObservationVariableName() { + return observationVariableName; + } + + public void setObservationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + } + + public ObservationSummary season(Season season) { + this.season = season; + return this; + } + + /** + * Get season + * @return season + **/ + @Schema(description = "") + public Season getSeason() { + return season; + } + + public void setSeason(Season season) { + this.season = season; + } + + public ObservationSummary value(String value) { + this.value = value; + return this; + } + + /** + * The value of the data collected as an observation + * @return value + **/ + @Schema(description = "The value of the data collected as an observation") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationSummary observationSummary = (ObservationSummary) o; + return Objects.equals(this.collector, observationSummary.collector) && + Objects.equals(this.observationDbId, observationSummary.observationDbId) && + Objects.equals(this.observationTimeStamp, observationSummary.observationTimeStamp) && + Objects.equals(this.observationVariableDbId, observationSummary.observationVariableDbId) && + Objects.equals(this.observationVariableName, observationSummary.observationVariableName) && + Objects.equals(this.season, observationSummary.season) && + Objects.equals(this.value, observationSummary.value); + } + + @Override + public int hashCode() { + return Objects.hash(collector, observationDbId, observationTimeStamp, observationVariableDbId, observationVariableName, season, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationSummary {\n"); + + sb.append(" collector: ").append(toIndentedString(collector)).append("\n"); + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationTimeStamp: ").append(toIndentedString(observationTimeStamp)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" observationVariableName: ").append(toIndentedString(observationVariableName)).append("\n"); + sb.append(" season: ").append(toIndentedString(season)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummaryPhenotype.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummaryPhenotype.java new file mode 100755 index 00000000..a3523251 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationSummaryPhenotype.java @@ -0,0 +1,225 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * ObservationSummaryPhenotype + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationSummaryPhenotype { + @SerializedName("collector") + private String collector = null; + + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationTimeStamp") + private OffsetDateTime observationTimeStamp = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("observationVariableName") + private String observationVariableName = null; + + @SerializedName("season") + private String season = null; + + @SerializedName("value") + private String value = null; + + public ObservationSummaryPhenotype collector(String collector) { + this.collector = collector; + return this; + } + + /** + * The name or identifier of the entity which collected the observation + * @return collector + **/ + @Schema(description = "The name or identifier of the entity which collected the observation") + public String getCollector() { + return collector; + } + + public void setCollector(String collector) { + this.collector = collector; + } + + public ObservationSummaryPhenotype observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation + * @return observationDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public ObservationSummaryPhenotype observationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + return this; + } + + /** + * The date and time when this observation was made + * @return observationTimeStamp + **/ + @Schema(description = "The date and time when this observation was made ") + public OffsetDateTime getObservationTimeStamp() { + return observationTimeStamp; + } + + public void setObservationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + } + + public ObservationSummaryPhenotype observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation variable + * @return observationVariableDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation variable") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public ObservationSummaryPhenotype observationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + return this; + } + + /** + * A human readable name for an observation variable + * @return observationVariableName + **/ + @Schema(description = "A human readable name for an observation variable") + public String getObservationVariableName() { + return observationVariableName; + } + + public void setObservationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + } + + public ObservationSummaryPhenotype season(String season) { + this.season = season; + return this; + } + + /** + * The season when the observation data was collected + * @return season + **/ + @Schema(description = "The season when the observation data was collected") + public String getSeason() { + return season; + } + + public void setSeason(String season) { + this.season = season; + } + + public ObservationSummaryPhenotype value(String value) { + this.value = value; + return this; + } + + /** + * The value of the data collected as an observation + * @return value + **/ + @Schema(description = "The value of the data collected as an observation") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationSummaryPhenotype observationSummaryPhenotype = (ObservationSummaryPhenotype) o; + return Objects.equals(this.collector, observationSummaryPhenotype.collector) && + Objects.equals(this.observationDbId, observationSummaryPhenotype.observationDbId) && + Objects.equals(this.observationTimeStamp, observationSummaryPhenotype.observationTimeStamp) && + Objects.equals(this.observationVariableDbId, observationSummaryPhenotype.observationVariableDbId) && + Objects.equals(this.observationVariableName, observationSummaryPhenotype.observationVariableName) && + Objects.equals(this.season, observationSummaryPhenotype.season) && + Objects.equals(this.value, observationSummaryPhenotype.value); + } + + @Override + public int hashCode() { + return Objects.hash(collector, observationDbId, observationTimeStamp, observationVariableDbId, observationVariableName, season, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationSummaryPhenotype {\n"); + + sb.append(" collector: ").append(toIndentedString(collector)).append("\n"); + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationTimeStamp: ").append(toIndentedString(observationTimeStamp)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" observationVariableName: ").append(toIndentedString(observationVariableName)).append("\n"); + sb.append(" season: ").append(toIndentedString(season)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationTreatment.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationTreatment.java new file mode 100755 index 00000000..b6372420 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationTreatment.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationTreatment + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationTreatment { + @SerializedName("factor") + private String factor = null; + + @SerializedName("modality") + private String modality = null; + + public ObservationTreatment factor(String factor) { + this.factor = factor; + return this; + } + + /** + * The type of treatment/factor. ex. 'fertilizer', 'inoculation', 'irrigation', etc + * @return factor + **/ + @Schema(description = "The type of treatment/factor. ex. 'fertilizer', 'inoculation', 'irrigation', etc") + public String getFactor() { + return factor; + } + + public void setFactor(String factor) { + this.factor = factor; + } + + public ObservationTreatment modality(String modality) { + this.modality = modality; + return this; + } + + /** + * The treatment/factor descritpion. ex. 'low fertilizer', 'yellow rust inoculation', 'high water', etc + * @return modality + **/ + @Schema(description = "The treatment/factor descritpion. ex. 'low fertilizer', 'yellow rust inoculation', 'high water', etc") + public String getModality() { + return modality; + } + + public void setModality(String modality) { + this.modality = modality; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationTreatment observationTreatment = (ObservationTreatment) o; + return Objects.equals(this.factor, observationTreatment.factor) && + Objects.equals(this.modality, observationTreatment.modality); + } + + @Override + public int hashCode() { + return Objects.hash(factor, modality); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationTreatment {\n"); + + sb.append(" factor: ").append(toIndentedString(factor)).append("\n"); + sb.append(" modality: ").append(toIndentedString(modality)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnit.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnit.java new file mode 100755 index 00000000..82b8f5ac --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnit.java @@ -0,0 +1,927 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.ObservationSummary; +import io.swagger.client.model.ObservationTreatment; +import io.swagger.client.model.ObservationUnitXref; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnit + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnit { + @SerializedName("X") + private String X = null; + + @SerializedName("Y") + private String Y = null; + + @SerializedName("blockNumber") + private String blockNumber = null; + + @SerializedName("entryNumber") + private String entryNumber = null; + + @SerializedName("entryType") + private String entryType = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("locationDbId") + private String locationDbId = null; + + @SerializedName("locationName") + private String locationName = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationLevels") + private String observationLevels = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationUnitName") + private String observationUnitName = null; + + @SerializedName("observationUnitXref") + private List observationUnitXref = null; + + @SerializedName("observations") + private List observations = null; + + @SerializedName("pedigree") + private String pedigree = null; + + @SerializedName("plantNumber") + private String plantNumber = null; + + @SerializedName("plotNumber") + private String plotNumber = null; + + @SerializedName("positionCoordinateX") + private String positionCoordinateX = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateXTypeEnum.Adapter.class) + public enum PositionCoordinateXTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateXTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateXTypeEnum fromValue(String text) { + for (PositionCoordinateXTypeEnum b : PositionCoordinateXTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateXTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateXTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateXTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateXType") + private PositionCoordinateXTypeEnum positionCoordinateXType = null; + + @SerializedName("positionCoordinateY") + private String positionCoordinateY = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateYTypeEnum.Adapter.class) + public enum PositionCoordinateYTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateYTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateYTypeEnum fromValue(String text) { + for (PositionCoordinateYTypeEnum b : PositionCoordinateYTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateYTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateYTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateYTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateYType") + private PositionCoordinateYTypeEnum positionCoordinateYType = null; + + @SerializedName("programDbId") + private String programDbId = null; + + @SerializedName("programName") + private String programName = null; + + @SerializedName("replicate") + private String replicate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("studyLocation") + private String studyLocation = null; + + @SerializedName("studyLocationDbId") + private String studyLocationDbId = null; + + @SerializedName("studyName") + private String studyName = null; + + @SerializedName("treatments") + private List treatments = null; + + @SerializedName("trialDbId") + private String trialDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public ObservationUnit X(String X) { + this.X = X; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateX\" + * @return X + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateX\"") + public String getX() { + return X; + } + + public void setX(String X) { + this.X = X; + } + + public ObservationUnit Y(String Y) { + this.Y = Y; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateY\" + * @return Y + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateY\"") + public String getY() { + return Y; + } + + public void setY(String Y) { + this.Y = Y; + } + + public ObservationUnit blockNumber(String blockNumber) { + this.blockNumber = blockNumber; + return this; + } + + /** + * The block number for an observation unit. Different systems may use different block designs. + * @return blockNumber + **/ + @Schema(description = "The block number for an observation unit. Different systems may use different block designs.") + public String getBlockNumber() { + return blockNumber; + } + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + public ObservationUnit entryNumber(String entryNumber) { + this.entryNumber = entryNumber; + return this; + } + + /** + * The entry number for an observation unit. Different systems may use different entry systems. + * @return entryNumber + **/ + @Schema(description = "The entry number for an observation unit. Different systems may use different entry systems.") + public String getEntryNumber() { + return entryNumber; + } + + public void setEntryNumber(String entryNumber) { + this.entryNumber = entryNumber; + } + + public ObservationUnit entryType(String entryType) { + this.entryType = entryType; + return this; + } + + /** + * The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\" + * @return entryType + **/ + @Schema(description = "The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\"") + public String getEntryType() { + return entryType; + } + + public void setEntryType(String entryType) { + this.entryType = entryType; + } + + public ObservationUnit germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public ObservationUnit germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public ObservationUnit locationDbId(String locationDbId) { + this.locationDbId = locationDbId; + return this; + } + + /** + * The ID which uniquely identifies a location, associated with this study + * @return locationDbId + **/ + @Schema(description = "The ID which uniquely identifies a location, associated with this study") + public String getLocationDbId() { + return locationDbId; + } + + public void setLocationDbId(String locationDbId) { + this.locationDbId = locationDbId; + } + + public ObservationUnit locationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * The human readable name of a location associated with this study + * @return locationName + **/ + @Schema(description = "The human readable name of a location associated with this study") + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public ObservationUnit observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The level of an observation unit. ex. \"plot\", \"plant\" + * @return observationLevel + **/ + @Schema(description = "The level of an observation unit. ex. \"plot\", \"plant\"") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public ObservationUnit observationLevels(String observationLevels) { + this.observationLevels = observationLevels; + return this; + } + + /** + * Concatenation of the levels of this observationUnit. Used to handle non canonical level structures. Format levelType:levelID,levelType:levelID + * @return observationLevels + **/ + @Schema(description = "Concatenation of the levels of this observationUnit. Used to handle non canonical level structures. Format levelType:levelID,levelType:levelID") + public String getObservationLevels() { + return observationLevels; + } + + public void setObservationLevels(String observationLevels) { + this.observationLevels = observationLevels; + } + + public ObservationUnit observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public ObservationUnit observationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + return this; + } + + /** + * A human readable name for an observation unit + * @return observationUnitName + **/ + @Schema(description = "A human readable name for an observation unit") + public String getObservationUnitName() { + return observationUnitName; + } + + public void setObservationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + } + + public ObservationUnit observationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + return this; + } + + public ObservationUnit addObservationUnitXrefItem(ObservationUnitXref observationUnitXrefItem) { + if (this.observationUnitXref == null) { + this.observationUnitXref = new ArrayList(); + } + this.observationUnitXref.add(observationUnitXrefItem); + return this; + } + + /** + * A list of external references to this observation unit + * @return observationUnitXref + **/ + @Schema(description = "A list of external references to this observation unit") + public List getObservationUnitXref() { + return observationUnitXref; + } + + public void setObservationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + } + + public ObservationUnit observations(List observations) { + this.observations = observations; + return this; + } + + public ObservationUnit addObservationsItem(ObservationSummary observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * List of observations associated with this observation unit + * @return observations + **/ + @Schema(description = "List of observations associated with this observation unit") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + public ObservationUnit pedigree(String pedigree) { + this.pedigree = pedigree; + return this; + } + + /** + * The string representation of the pedigree of this observation unit + * @return pedigree + **/ + @Schema(description = "The string representation of the pedigree of this observation unit") + public String getPedigree() { + return pedigree; + } + + public void setPedigree(String pedigree) { + this.pedigree = pedigree; + } + + public ObservationUnit plantNumber(String plantNumber) { + this.plantNumber = plantNumber; + return this; + } + + /** + * The plant number in a field. Applicable for observationLevel: \"plant\" + * @return plantNumber + **/ + @Schema(description = "The plant number in a field. Applicable for observationLevel: \"plant\"") + public String getPlantNumber() { + return plantNumber; + } + + public void setPlantNumber(String plantNumber) { + this.plantNumber = plantNumber; + } + + public ObservationUnit plotNumber(String plotNumber) { + this.plotNumber = plotNumber; + return this; + } + + /** + * The plot number in a field. Applicable for observationLevel: \"plot\" + * @return plotNumber + **/ + @Schema(description = "The plot number in a field. Applicable for observationLevel: \"plot\"") + public String getPlotNumber() { + return plotNumber; + } + + public void setPlotNumber(String plotNumber) { + this.plotNumber = plotNumber; + } + + public ObservationUnit positionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + return this; + } + + /** + * The X position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateX + **/ + @Schema(description = "The X position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateX() { + return positionCoordinateX; + } + + public void setPositionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + } + + public ObservationUnit positionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateXType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateXTypeEnum getPositionCoordinateXType() { + return positionCoordinateXType; + } + + public void setPositionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + } + + public ObservationUnit positionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + return this; + } + + /** + * The Y position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateY + **/ + @Schema(description = "The Y position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateY() { + return positionCoordinateY; + } + + public void setPositionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + } + + public ObservationUnit positionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateYType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateYTypeEnum getPositionCoordinateYType() { + return positionCoordinateYType; + } + + public void setPositionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + } + + public ObservationUnit programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * The ID which uniquely identifies a program + * @return programDbId + **/ + @Schema(description = "The ID which uniquely identifies a program") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + public ObservationUnit programName(String programName) { + this.programName = programName; + return this; + } + + /** + * The human readable name of a program + * @return programName + **/ + @Schema(description = "The human readable name of a program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + public ObservationUnit replicate(String replicate) { + this.replicate = replicate; + return this; + } + + /** + * The replicate number of an observation unit. May be the same as blockNumber. + * @return replicate + **/ + @Schema(description = "The replicate number of an observation unit. May be the same as blockNumber.") + public String getReplicate() { + return replicate; + } + + public void setReplicate(String replicate) { + this.replicate = replicate; + } + + public ObservationUnit studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public ObservationUnit studyLocation(String studyLocation) { + this.studyLocation = studyLocation; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"locationName\" + * @return studyLocation + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"locationName\"") + public String getStudyLocation() { + return studyLocation; + } + + public void setStudyLocation(String studyLocation) { + this.studyLocation = studyLocation; + } + + public ObservationUnit studyLocationDbId(String studyLocationDbId) { + this.studyLocationDbId = studyLocationDbId; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"locationDbId\" + * @return studyLocationDbId + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"locationDbId\"") + public String getStudyLocationDbId() { + return studyLocationDbId; + } + + public void setStudyLocationDbId(String studyLocationDbId) { + this.studyLocationDbId = studyLocationDbId; + } + + public ObservationUnit studyName(String studyName) { + this.studyName = studyName; + return this; + } + + /** + * The human readable name for a study + * @return studyName + **/ + @Schema(description = "The human readable name for a study") + public String getStudyName() { + return studyName; + } + + public void setStudyName(String studyName) { + this.studyName = studyName; + } + + public ObservationUnit treatments(List treatments) { + this.treatments = treatments; + return this; + } + + public ObservationUnit addTreatmentsItem(ObservationTreatment treatmentsItem) { + if (this.treatments == null) { + this.treatments = new ArrayList(); + } + this.treatments.add(treatmentsItem); + return this; + } + + /** + * List of treatments applied to an observation unit. + * @return treatments + **/ + @Schema(description = "List of treatments applied to an observation unit.") + public List getTreatments() { + return treatments; + } + + public void setTreatments(List treatments) { + this.treatments = treatments; + } + + public ObservationUnit trialDbId(String trialDbId) { + this.trialDbId = trialDbId; + return this; + } + + /** + * The ID which uniquely identifies a trial + * @return trialDbId + **/ + @Schema(description = "The ID which uniquely identifies a trial") + public String getTrialDbId() { + return trialDbId; + } + + public void setTrialDbId(String trialDbId) { + this.trialDbId = trialDbId; + } + + public ObservationUnit trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * The human readable name of a trial + * @return trialName + **/ + @Schema(description = "The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnit observationUnit = (ObservationUnit) o; + return Objects.equals(this.X, observationUnit.X) && + Objects.equals(this.Y, observationUnit.Y) && + Objects.equals(this.blockNumber, observationUnit.blockNumber) && + Objects.equals(this.entryNumber, observationUnit.entryNumber) && + Objects.equals(this.entryType, observationUnit.entryType) && + Objects.equals(this.germplasmDbId, observationUnit.germplasmDbId) && + Objects.equals(this.germplasmName, observationUnit.germplasmName) && + Objects.equals(this.locationDbId, observationUnit.locationDbId) && + Objects.equals(this.locationName, observationUnit.locationName) && + Objects.equals(this.observationLevel, observationUnit.observationLevel) && + Objects.equals(this.observationLevels, observationUnit.observationLevels) && + Objects.equals(this.observationUnitDbId, observationUnit.observationUnitDbId) && + Objects.equals(this.observationUnitName, observationUnit.observationUnitName) && + Objects.equals(this.observationUnitXref, observationUnit.observationUnitXref) && + Objects.equals(this.observations, observationUnit.observations) && + Objects.equals(this.pedigree, observationUnit.pedigree) && + Objects.equals(this.plantNumber, observationUnit.plantNumber) && + Objects.equals(this.plotNumber, observationUnit.plotNumber) && + Objects.equals(this.positionCoordinateX, observationUnit.positionCoordinateX) && + Objects.equals(this.positionCoordinateXType, observationUnit.positionCoordinateXType) && + Objects.equals(this.positionCoordinateY, observationUnit.positionCoordinateY) && + Objects.equals(this.positionCoordinateYType, observationUnit.positionCoordinateYType) && + Objects.equals(this.programDbId, observationUnit.programDbId) && + Objects.equals(this.programName, observationUnit.programName) && + Objects.equals(this.replicate, observationUnit.replicate) && + Objects.equals(this.studyDbId, observationUnit.studyDbId) && + Objects.equals(this.studyLocation, observationUnit.studyLocation) && + Objects.equals(this.studyLocationDbId, observationUnit.studyLocationDbId) && + Objects.equals(this.studyName, observationUnit.studyName) && + Objects.equals(this.treatments, observationUnit.treatments) && + Objects.equals(this.trialDbId, observationUnit.trialDbId) && + Objects.equals(this.trialName, observationUnit.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, blockNumber, entryNumber, entryType, germplasmDbId, germplasmName, locationDbId, locationName, observationLevel, observationLevels, observationUnitDbId, observationUnitName, observationUnitXref, observations, pedigree, plantNumber, plotNumber, positionCoordinateX, positionCoordinateXType, positionCoordinateY, positionCoordinateYType, programDbId, programName, replicate, studyDbId, studyLocation, studyLocationDbId, studyName, treatments, trialDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnit {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" entryNumber: ").append(toIndentedString(entryNumber)).append("\n"); + sb.append(" entryType: ").append(toIndentedString(entryType)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" locationDbId: ").append(toIndentedString(locationDbId)).append("\n"); + sb.append(" locationName: ").append(toIndentedString(locationName)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationLevels: ").append(toIndentedString(observationLevels)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationUnitName: ").append(toIndentedString(observationUnitName)).append("\n"); + sb.append(" observationUnitXref: ").append(toIndentedString(observationUnitXref)).append("\n"); + sb.append(" observations: ").append(toIndentedString(observations)).append("\n"); + sb.append(" pedigree: ").append(toIndentedString(pedigree)).append("\n"); + sb.append(" plantNumber: ").append(toIndentedString(plantNumber)).append("\n"); + sb.append(" plotNumber: ").append(toIndentedString(plotNumber)).append("\n"); + sb.append(" positionCoordinateX: ").append(toIndentedString(positionCoordinateX)).append("\n"); + sb.append(" positionCoordinateXType: ").append(toIndentedString(positionCoordinateXType)).append("\n"); + sb.append(" positionCoordinateY: ").append(toIndentedString(positionCoordinateY)).append("\n"); + sb.append(" positionCoordinateYType: ").append(toIndentedString(positionCoordinateYType)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).append("\n"); + sb.append(" replicate: ").append(toIndentedString(replicate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" studyLocation: ").append(toIndentedString(studyLocation)).append("\n"); + sb.append(" studyLocationDbId: ").append(toIndentedString(studyLocationDbId)).append("\n"); + sb.append(" studyName: ").append(toIndentedString(studyName)).append("\n"); + sb.append(" treatments: ").append(toIndentedString(treatments)).append("\n"); + sb.append(" trialDbId: ").append(toIndentedString(trialDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPhenotype.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPhenotype.java new file mode 100755 index 00000000..badfdb9a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPhenotype.java @@ -0,0 +1,789 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.ObservationSummaryPhenotype; +import io.swagger.client.model.ObservationTreatment; +import io.swagger.client.model.ObservationUnitXref; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitPhenotype + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPhenotype { + @SerializedName("X") + private String X = null; + + @SerializedName("Y") + private String Y = null; + + @SerializedName("blockNumber") + private String blockNumber = null; + + @SerializedName("entryNumber") + private String entryNumber = null; + + @SerializedName("entryType") + private String entryType = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationLevels") + private String observationLevels = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationUnitName") + private String observationUnitName = null; + + @SerializedName("observationUnitXref") + private List observationUnitXref = null; + + @SerializedName("observations") + private List observations = null; + + @SerializedName("plantNumber") + private String plantNumber = null; + + @SerializedName("plotNumber") + private String plotNumber = null; + + @SerializedName("positionCoordinateX") + private String positionCoordinateX = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateXTypeEnum.Adapter.class) + public enum PositionCoordinateXTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateXTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateXTypeEnum fromValue(String text) { + for (PositionCoordinateXTypeEnum b : PositionCoordinateXTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateXTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateXTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateXTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateXType") + private PositionCoordinateXTypeEnum positionCoordinateXType = null; + + @SerializedName("positionCoordinateY") + private String positionCoordinateY = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateYTypeEnum.Adapter.class) + public enum PositionCoordinateYTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateYTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateYTypeEnum fromValue(String text) { + for (PositionCoordinateYTypeEnum b : PositionCoordinateYTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateYTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateYTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateYTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateYType") + private PositionCoordinateYTypeEnum positionCoordinateYType = null; + + @SerializedName("programName") + private String programName = null; + + @SerializedName("replicate") + private String replicate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("studyLocation") + private String studyLocation = null; + + @SerializedName("studyLocationDbId") + private String studyLocationDbId = null; + + @SerializedName("studyName") + private String studyName = null; + + @SerializedName("treatments") + private List treatments = null; + + public ObservationUnitPhenotype X(String X) { + this.X = X; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateX\" + * @return X + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateX\"") + public String getX() { + return X; + } + + public void setX(String X) { + this.X = X; + } + + public ObservationUnitPhenotype Y(String Y) { + this.Y = Y; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateY\" + * @return Y + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateY\"") + public String getY() { + return Y; + } + + public void setY(String Y) { + this.Y = Y; + } + + public ObservationUnitPhenotype blockNumber(String blockNumber) { + this.blockNumber = blockNumber; + return this; + } + + /** + * The block number for an observation unit. Different systems may use different block designs. + * @return blockNumber + **/ + @Schema(description = "The block number for an observation unit. Different systems may use different block designs.") + public String getBlockNumber() { + return blockNumber; + } + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + public ObservationUnitPhenotype entryNumber(String entryNumber) { + this.entryNumber = entryNumber; + return this; + } + + /** + * The entry number for an observation unit. Different systems may use different entry systems. + * @return entryNumber + **/ + @Schema(description = "The entry number for an observation unit. Different systems may use different entry systems.") + public String getEntryNumber() { + return entryNumber; + } + + public void setEntryNumber(String entryNumber) { + this.entryNumber = entryNumber; + } + + public ObservationUnitPhenotype entryType(String entryType) { + this.entryType = entryType; + return this; + } + + /** + * The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\" + * @return entryType + **/ + @Schema(description = "The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\"") + public String getEntryType() { + return entryType; + } + + public void setEntryType(String entryType) { + this.entryType = entryType; + } + + public ObservationUnitPhenotype germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public ObservationUnitPhenotype germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public ObservationUnitPhenotype observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The level of an observation unit. ex. \"plot\", \"plant\" + * @return observationLevel + **/ + @Schema(description = "The level of an observation unit. ex. \"plot\", \"plant\"") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public ObservationUnitPhenotype observationLevels(String observationLevels) { + this.observationLevels = observationLevels; + return this; + } + + /** + * Concatenation of the levels of this observationUnit. Used to handle non canonical level structures. Format levelType:levelID,levelType:levelID + * @return observationLevels + **/ + @Schema(description = "Concatenation of the levels of this observationUnit. Used to handle non canonical level structures. Format levelType:levelID,levelType:levelID") + public String getObservationLevels() { + return observationLevels; + } + + public void setObservationLevels(String observationLevels) { + this.observationLevels = observationLevels; + } + + public ObservationUnitPhenotype observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public ObservationUnitPhenotype observationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + return this; + } + + /** + * A human readable name for an observation unit + * @return observationUnitName + **/ + @Schema(description = "A human readable name for an observation unit") + public String getObservationUnitName() { + return observationUnitName; + } + + public void setObservationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + } + + public ObservationUnitPhenotype observationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + return this; + } + + public ObservationUnitPhenotype addObservationUnitXrefItem(ObservationUnitXref observationUnitXrefItem) { + if (this.observationUnitXref == null) { + this.observationUnitXref = new ArrayList(); + } + this.observationUnitXref.add(observationUnitXrefItem); + return this; + } + + /** + * A list of external references to this observation unit + * @return observationUnitXref + **/ + @Schema(description = "A list of external references to this observation unit") + public List getObservationUnitXref() { + return observationUnitXref; + } + + public void setObservationUnitXref(List observationUnitXref) { + this.observationUnitXref = observationUnitXref; + } + + public ObservationUnitPhenotype observations(List observations) { + this.observations = observations; + return this; + } + + public ObservationUnitPhenotype addObservationsItem(ObservationSummaryPhenotype observationsItem) { + if (this.observations == null) { + this.observations = new ArrayList(); + } + this.observations.add(observationsItem); + return this; + } + + /** + * List of observations associated with this observation unit + * @return observations + **/ + @Schema(description = "List of observations associated with this observation unit") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + public ObservationUnitPhenotype plantNumber(String plantNumber) { + this.plantNumber = plantNumber; + return this; + } + + /** + * The plant number in a field. Applicable for observationLevel: \"plant\" + * @return plantNumber + **/ + @Schema(description = "The plant number in a field. Applicable for observationLevel: \"plant\"") + public String getPlantNumber() { + return plantNumber; + } + + public void setPlantNumber(String plantNumber) { + this.plantNumber = plantNumber; + } + + public ObservationUnitPhenotype plotNumber(String plotNumber) { + this.plotNumber = plotNumber; + return this; + } + + /** + * The plot number in a field. Applicable for observationLevel: \"plot\" + * @return plotNumber + **/ + @Schema(description = "The plot number in a field. Applicable for observationLevel: \"plot\"") + public String getPlotNumber() { + return plotNumber; + } + + public void setPlotNumber(String plotNumber) { + this.plotNumber = plotNumber; + } + + public ObservationUnitPhenotype positionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + return this; + } + + /** + * The X position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateX + **/ + @Schema(description = "The X position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateX() { + return positionCoordinateX; + } + + public void setPositionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + } + + public ObservationUnitPhenotype positionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateXType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateXTypeEnum getPositionCoordinateXType() { + return positionCoordinateXType; + } + + public void setPositionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + } + + public ObservationUnitPhenotype positionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + return this; + } + + /** + * The Y position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateY + **/ + @Schema(description = "The Y position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateY() { + return positionCoordinateY; + } + + public void setPositionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + } + + public ObservationUnitPhenotype positionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateYType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateYTypeEnum getPositionCoordinateYType() { + return positionCoordinateYType; + } + + public void setPositionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + } + + public ObservationUnitPhenotype programName(String programName) { + this.programName = programName; + return this; + } + + /** + * The human readable name of a program + * @return programName + **/ + @Schema(description = "The human readable name of a program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + public ObservationUnitPhenotype replicate(String replicate) { + this.replicate = replicate; + return this; + } + + /** + * The replicate number of an observation unit. May be the same as blockNumber. + * @return replicate + **/ + @Schema(description = "The replicate number of an observation unit. May be the same as blockNumber.") + public String getReplicate() { + return replicate; + } + + public void setReplicate(String replicate) { + this.replicate = replicate; + } + + public ObservationUnitPhenotype studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public ObservationUnitPhenotype studyLocation(String studyLocation) { + this.studyLocation = studyLocation; + return this; + } + + /** + * The human readable name of a location associated with this study + * @return studyLocation + **/ + @Schema(description = "The human readable name of a location associated with this study") + public String getStudyLocation() { + return studyLocation; + } + + public void setStudyLocation(String studyLocation) { + this.studyLocation = studyLocation; + } + + public ObservationUnitPhenotype studyLocationDbId(String studyLocationDbId) { + this.studyLocationDbId = studyLocationDbId; + return this; + } + + /** + * The ID which uniquely identifies a location, associated with this study + * @return studyLocationDbId + **/ + @Schema(description = "The ID which uniquely identifies a location, associated with this study") + public String getStudyLocationDbId() { + return studyLocationDbId; + } + + public void setStudyLocationDbId(String studyLocationDbId) { + this.studyLocationDbId = studyLocationDbId; + } + + public ObservationUnitPhenotype studyName(String studyName) { + this.studyName = studyName; + return this; + } + + /** + * The human readable name for a study + * @return studyName + **/ + @Schema(description = "The human readable name for a study") + public String getStudyName() { + return studyName; + } + + public void setStudyName(String studyName) { + this.studyName = studyName; + } + + public ObservationUnitPhenotype treatments(List treatments) { + this.treatments = treatments; + return this; + } + + public ObservationUnitPhenotype addTreatmentsItem(ObservationTreatment treatmentsItem) { + if (this.treatments == null) { + this.treatments = new ArrayList(); + } + this.treatments.add(treatmentsItem); + return this; + } + + /** + * List of treatments applied to an observation unit. + * @return treatments + **/ + @Schema(description = "List of treatments applied to an observation unit.") + public List getTreatments() { + return treatments; + } + + public void setTreatments(List treatments) { + this.treatments = treatments; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPhenotype observationUnitPhenotype = (ObservationUnitPhenotype) o; + return Objects.equals(this.X, observationUnitPhenotype.X) && + Objects.equals(this.Y, observationUnitPhenotype.Y) && + Objects.equals(this.blockNumber, observationUnitPhenotype.blockNumber) && + Objects.equals(this.entryNumber, observationUnitPhenotype.entryNumber) && + Objects.equals(this.entryType, observationUnitPhenotype.entryType) && + Objects.equals(this.germplasmDbId, observationUnitPhenotype.germplasmDbId) && + Objects.equals(this.germplasmName, observationUnitPhenotype.germplasmName) && + Objects.equals(this.observationLevel, observationUnitPhenotype.observationLevel) && + Objects.equals(this.observationLevels, observationUnitPhenotype.observationLevels) && + Objects.equals(this.observationUnitDbId, observationUnitPhenotype.observationUnitDbId) && + Objects.equals(this.observationUnitName, observationUnitPhenotype.observationUnitName) && + Objects.equals(this.observationUnitXref, observationUnitPhenotype.observationUnitXref) && + Objects.equals(this.observations, observationUnitPhenotype.observations) && + Objects.equals(this.plantNumber, observationUnitPhenotype.plantNumber) && + Objects.equals(this.plotNumber, observationUnitPhenotype.plotNumber) && + Objects.equals(this.positionCoordinateX, observationUnitPhenotype.positionCoordinateX) && + Objects.equals(this.positionCoordinateXType, observationUnitPhenotype.positionCoordinateXType) && + Objects.equals(this.positionCoordinateY, observationUnitPhenotype.positionCoordinateY) && + Objects.equals(this.positionCoordinateYType, observationUnitPhenotype.positionCoordinateYType) && + Objects.equals(this.programName, observationUnitPhenotype.programName) && + Objects.equals(this.replicate, observationUnitPhenotype.replicate) && + Objects.equals(this.studyDbId, observationUnitPhenotype.studyDbId) && + Objects.equals(this.studyLocation, observationUnitPhenotype.studyLocation) && + Objects.equals(this.studyLocationDbId, observationUnitPhenotype.studyLocationDbId) && + Objects.equals(this.studyName, observationUnitPhenotype.studyName) && + Objects.equals(this.treatments, observationUnitPhenotype.treatments); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, blockNumber, entryNumber, entryType, germplasmDbId, germplasmName, observationLevel, observationLevels, observationUnitDbId, observationUnitName, observationUnitXref, observations, plantNumber, plotNumber, positionCoordinateX, positionCoordinateXType, positionCoordinateY, positionCoordinateYType, programName, replicate, studyDbId, studyLocation, studyLocationDbId, studyName, treatments); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPhenotype {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" entryNumber: ").append(toIndentedString(entryNumber)).append("\n"); + sb.append(" entryType: ").append(toIndentedString(entryType)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationLevels: ").append(toIndentedString(observationLevels)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationUnitName: ").append(toIndentedString(observationUnitName)).append("\n"); + sb.append(" observationUnitXref: ").append(toIndentedString(observationUnitXref)).append("\n"); + sb.append(" observations: ").append(toIndentedString(observations)).append("\n"); + sb.append(" plantNumber: ").append(toIndentedString(plantNumber)).append("\n"); + sb.append(" plotNumber: ").append(toIndentedString(plotNumber)).append("\n"); + sb.append(" positionCoordinateX: ").append(toIndentedString(positionCoordinateX)).append("\n"); + sb.append(" positionCoordinateXType: ").append(toIndentedString(positionCoordinateXType)).append("\n"); + sb.append(" positionCoordinateY: ").append(toIndentedString(positionCoordinateY)).append("\n"); + sb.append(" positionCoordinateYType: ").append(toIndentedString(positionCoordinateYType)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).append("\n"); + sb.append(" replicate: ").append(toIndentedString(replicate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" studyLocation: ").append(toIndentedString(studyLocation)).append("\n"); + sb.append(" studyLocationDbId: ").append(toIndentedString(studyLocationDbId)).append("\n"); + sb.append(" studyName: ").append(toIndentedString(studyName)).append("\n"); + sb.append(" treatments: ").append(toIndentedString(treatments)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPosition.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPosition.java new file mode 100755 index 00000000..701594df --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPosition.java @@ -0,0 +1,582 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +/** + * ObservationUnitPosition + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPosition { + @SerializedName("X") + private String X = null; + + @SerializedName("Y") + private String Y = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("blockNumber") + private String blockNumber = null; + + /** + * The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\" + */ + @JsonAdapter(EntryTypeEnum.Adapter.class) + public enum EntryTypeEnum { + CHECK("CHECK"), + TEST("TEST"), + FILLER("FILLER"); + + private String value; + + EntryTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static EntryTypeEnum fromValue(String text) { + for (EntryTypeEnum b : EntryTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntryTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntryTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntryTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("entryType") + private EntryTypeEnum entryType = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("germplasmName") + private String germplasmName = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("observationUnitName") + private String observationUnitName = null; + + @SerializedName("positionCoordinateX") + private String positionCoordinateX = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateXTypeEnum.Adapter.class) + public enum PositionCoordinateXTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateXTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateXTypeEnum fromValue(String text) { + for (PositionCoordinateXTypeEnum b : PositionCoordinateXTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateXTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateXTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateXTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateXType") + private PositionCoordinateXTypeEnum positionCoordinateXType = null; + + @SerializedName("positionCoordinateY") + private String positionCoordinateY = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateYTypeEnum.Adapter.class) + public enum PositionCoordinateYTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateYTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateYTypeEnum fromValue(String text) { + for (PositionCoordinateYTypeEnum b : PositionCoordinateYTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateYTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateYTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateYTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateYType") + private PositionCoordinateYTypeEnum positionCoordinateYType = null; + + @SerializedName("replicate") + private String replicate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + public ObservationUnitPosition X(String X) { + this.X = X; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateX\" + * @return X + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateX\"") + public String getX() { + return X; + } + + public void setX(String X) { + this.X = X; + } + + public ObservationUnitPosition Y(String Y) { + this.Y = Y; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateY\" + * @return Y + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateY\"") + public String getY() { + return Y; + } + + public void setY(String Y) { + this.Y = Y; + } + + public ObservationUnitPosition additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public ObservationUnitPosition putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public ObservationUnitPosition blockNumber(String blockNumber) { + this.blockNumber = blockNumber; + return this; + } + + /** + * The block number for an observation unit. Different systems may use different block designs. + * @return blockNumber + **/ + @Schema(description = "The block number for an observation unit. Different systems may use different block designs.") + public String getBlockNumber() { + return blockNumber; + } + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + public ObservationUnitPosition entryType(EntryTypeEnum entryType) { + this.entryType = entryType; + return this; + } + + /** + * The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\" + * @return entryType + **/ + @Schema(description = "The type of entry for this observation unit. ex. \"check\", \"test\", \"filler\"") + public EntryTypeEnum getEntryType() { + return entryType; + } + + public void setEntryType(EntryTypeEnum entryType) { + this.entryType = entryType; + } + + public ObservationUnitPosition germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public ObservationUnitPosition germplasmName(String germplasmName) { + this.germplasmName = germplasmName; + return this; + } + + /** + * Name of the germplasm. It can be the prefered name and does not have to be unique. + * @return germplasmName + **/ + @Schema(description = "Name of the germplasm. It can be the prefered name and does not have to be unique.") + public String getGermplasmName() { + return germplasmName; + } + + public void setGermplasmName(String germplasmName) { + this.germplasmName = germplasmName; + } + + public ObservationUnitPosition observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The level of an observation unit. ex. \"plot\", \"plant\" + * @return observationLevel + **/ + @Schema(description = "The level of an observation unit. ex. \"plot\", \"plant\"") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public ObservationUnitPosition observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public ObservationUnitPosition observationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + return this; + } + + /** + * A human readable name for an observation unit + * @return observationUnitName + **/ + @Schema(description = "A human readable name for an observation unit") + public String getObservationUnitName() { + return observationUnitName; + } + + public void setObservationUnitName(String observationUnitName) { + this.observationUnitName = observationUnitName; + } + + public ObservationUnitPosition positionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + return this; + } + + /** + * The X position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateX + **/ + @Schema(description = "The X position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateX() { + return positionCoordinateX; + } + + public void setPositionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + } + + public ObservationUnitPosition positionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateXType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateXTypeEnum getPositionCoordinateXType() { + return positionCoordinateXType; + } + + public void setPositionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + } + + public ObservationUnitPosition positionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + return this; + } + + /** + * The Y position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateY + **/ + @Schema(description = "The Y position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateY() { + return positionCoordinateY; + } + + public void setPositionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + } + + public ObservationUnitPosition positionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateYType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateYTypeEnum getPositionCoordinateYType() { + return positionCoordinateYType; + } + + public void setPositionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + } + + public ObservationUnitPosition replicate(String replicate) { + this.replicate = replicate; + return this; + } + + /** + * The replicate number of an observation unit. May be the same as blockNumber. + * @return replicate + **/ + @Schema(description = "The replicate number of an observation unit. May be the same as blockNumber.") + public String getReplicate() { + return replicate; + } + + public void setReplicate(String replicate) { + this.replicate = replicate; + } + + public ObservationUnitPosition studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPosition observationUnitPosition = (ObservationUnitPosition) o; + return Objects.equals(this.X, observationUnitPosition.X) && + Objects.equals(this.Y, observationUnitPosition.Y) && + Objects.equals(this.additionalInfo, observationUnitPosition.additionalInfo) && + Objects.equals(this.blockNumber, observationUnitPosition.blockNumber) && + Objects.equals(this.entryType, observationUnitPosition.entryType) && + Objects.equals(this.germplasmDbId, observationUnitPosition.germplasmDbId) && + Objects.equals(this.germplasmName, observationUnitPosition.germplasmName) && + Objects.equals(this.observationLevel, observationUnitPosition.observationLevel) && + Objects.equals(this.observationUnitDbId, observationUnitPosition.observationUnitDbId) && + Objects.equals(this.observationUnitName, observationUnitPosition.observationUnitName) && + Objects.equals(this.positionCoordinateX, observationUnitPosition.positionCoordinateX) && + Objects.equals(this.positionCoordinateXType, observationUnitPosition.positionCoordinateXType) && + Objects.equals(this.positionCoordinateY, observationUnitPosition.positionCoordinateY) && + Objects.equals(this.positionCoordinateYType, observationUnitPosition.positionCoordinateYType) && + Objects.equals(this.replicate, observationUnitPosition.replicate) && + Objects.equals(this.studyDbId, observationUnitPosition.studyDbId); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, additionalInfo, blockNumber, entryType, germplasmDbId, germplasmName, observationLevel, observationUnitDbId, observationUnitName, positionCoordinateX, positionCoordinateXType, positionCoordinateY, positionCoordinateYType, replicate, studyDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPosition {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" entryType: ").append(toIndentedString(entryType)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" germplasmName: ").append(toIndentedString(germplasmName)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" observationUnitName: ").append(toIndentedString(observationUnitName)).append("\n"); + sb.append(" positionCoordinateX: ").append(toIndentedString(positionCoordinateX)).append("\n"); + sb.append(" positionCoordinateXType: ").append(toIndentedString(positionCoordinateXType)).append("\n"); + sb.append(" positionCoordinateY: ").append(toIndentedString(positionCoordinateY)).append("\n"); + sb.append(" positionCoordinateYType: ").append(toIndentedString(positionCoordinateYType)).append("\n"); + sb.append(" replicate: ").append(toIndentedString(replicate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse.java new file mode 100755 index 00000000..80f80c6c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitPositionsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitPositionsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPositionsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitPositionsResponseResult result = null; + + public ObservationUnitPositionsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitPositionsResponse result(ObservationUnitPositionsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public ObservationUnitPositionsResponseResult getResult() { + return result; + } + + public void setResult(ObservationUnitPositionsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPositionsResponse observationUnitPositionsResponse = (ObservationUnitPositionsResponse) o; + return Objects.equals(this.metadata, observationUnitPositionsResponse.metadata) && + Objects.equals(this.result, observationUnitPositionsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPositionsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1.java new file mode 100755 index 00000000..85af7964 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitPositionsResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitPositionsResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPositionsResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitPositionsResponse1Result result = null; + + public ObservationUnitPositionsResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitPositionsResponse1 result(ObservationUnitPositionsResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationUnitPositionsResponse1Result getResult() { + return result; + } + + public void setResult(ObservationUnitPositionsResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPositionsResponse1 observationUnitPositionsResponse1 = (ObservationUnitPositionsResponse1) o; + return Objects.equals(this.metadata, observationUnitPositionsResponse1.metadata) && + Objects.equals(this.result, observationUnitPositionsResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPositionsResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1Result.java new file mode 100755 index 00000000..f269339a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponse1Result.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationUnitPosition; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitPositionsResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPositionsResponse1Result { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationUnitPositionsResponse1Result data(List data) { + this.data = data; + return this; + } + + public ObservationUnitPositionsResponse1Result addDataItem(ObservationUnitPosition dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPositionsResponse1Result observationUnitPositionsResponse1Result = (ObservationUnitPositionsResponse1Result) o; + return Objects.equals(this.data, observationUnitPositionsResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPositionsResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponseResult.java new file mode 100755 index 00000000..09920eea --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitPositionsResponseResult.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationUnitPosition; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitPositionsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitPositionsResponseResult { + @SerializedName("data") + private List data = null; + + public ObservationUnitPositionsResponseResult data(List data) { + this.data = data; + return this; + } + + public ObservationUnitPositionsResponseResult addDataItem(ObservationUnitPosition dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitPositionsResponseResult observationUnitPositionsResponseResult = (ObservationUnitPositionsResponseResult) o; + return Objects.equals(this.data, observationUnitPositionsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitPositionsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitXref.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitXref.java new file mode 100755 index 00000000..5e8adc68 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitXref.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitXref + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitXref { + @SerializedName("id") + private String id = null; + + @SerializedName("source") + private String source = null; + + public ObservationUnitXref id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID in the external reference 'source' system + * @return id + **/ + @Schema(description = "The unique ID in the external reference 'source' system") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ObservationUnitXref source(String source) { + this.source = source; + return this; + } + + /** + * The system identifier (name, URL, etc) which has an external reference to the observation unit + * @return source + **/ + @Schema(description = "The system identifier (name, URL, etc) which has an external reference to the observation unit") + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitXref observationUnitXref = (ObservationUnitXref) o; + return Objects.equals(this.id, observationUnitXref.id) && + Objects.equals(this.source, observationUnitXref.source); + } + + @Override + public int hashCode() { + return Objects.hash(id, source); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitXref {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse.java new file mode 100755 index 00000000..acb2865f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitsResponseResult result = null; + + public ObservationUnitsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitsResponse result(ObservationUnitsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationUnitsResponseResult getResult() { + return result; + } + + public void setResult(ObservationUnitsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponse observationUnitsResponse = (ObservationUnitsResponse) o; + return Objects.equals(this.metadata, observationUnitsResponse.metadata) && + Objects.equals(this.result, observationUnitsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1.java new file mode 100755 index 00000000..bf7b563b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitsResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitsResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitsResponse1Result result = null; + + public ObservationUnitsResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitsResponse1 result(ObservationUnitsResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public ObservationUnitsResponse1Result getResult() { + return result; + } + + public void setResult(ObservationUnitsResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponse1 observationUnitsResponse1 = (ObservationUnitsResponse1) o; + return Objects.equals(this.metadata, observationUnitsResponse1.metadata) && + Objects.equals(this.result, observationUnitsResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1Result.java new file mode 100755 index 00000000..bfb67282 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationUnitPhenotype; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitsResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponse1Result { + @SerializedName("data") + private List data = null; + + public ObservationUnitsResponse1Result data(List data) { + this.data = data; + return this; + } + + public ObservationUnitsResponse1Result addDataItem(ObservationUnitPhenotype dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponse1Result observationUnitsResponse1Result = (ObservationUnitsResponse1Result) o; + return Objects.equals(this.data, observationUnitsResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2.java new file mode 100755 index 00000000..19bfd85d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitsResponse2Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitsResponse2 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponse2 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitsResponse2Result result = null; + + public ObservationUnitsResponse2 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitsResponse2 result(ObservationUnitsResponse2Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationUnitsResponse2Result getResult() { + return result; + } + + public void setResult(ObservationUnitsResponse2Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponse2 observationUnitsResponse2 = (ObservationUnitsResponse2) o; + return Objects.equals(this.metadata, observationUnitsResponse2.metadata) && + Objects.equals(this.result, observationUnitsResponse2.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponse2 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2Result.java new file mode 100755 index 00000000..344e1611 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponse2Result.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationUnit; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitsResponse2Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponse2Result { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationUnitsResponse2Result data(List data) { + this.data = data; + return this; + } + + public ObservationUnitsResponse2Result addDataItem(ObservationUnit dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponse2Result observationUnitsResponse2Result = (ObservationUnitsResponse2Result) o; + return Objects.equals(this.data, observationUnitsResponse2Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponse2Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponseResult.java new file mode 100755 index 00000000..402d0091 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationUnitPhenotype; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationUnitsResponseResult data(List data) { + this.data = data; + return this; + } + + public ObservationUnitsResponseResult addDataItem(ObservationUnitPhenotype dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsResponseResult observationUnitsResponseResult = (ObservationUnitsResponseResult) o; + return Objects.equals(this.data, observationUnitsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse.java new file mode 100755 index 00000000..f8f703ad --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse.java @@ -0,0 +1,190 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationUnitsTableResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsTableResponse { + @SerializedName("data") + private List> data = null; + + @SerializedName("headerRow") + private List headerRow = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("observationVariableNames") + private List observationVariableNames = null; + + public ObservationUnitsTableResponse data(List> data) { + this.data = data; + return this; + } + + public ObservationUnitsTableResponse addDataItem(List dataItem) { + if (this.data == null) { + this.data = new ArrayList>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Matrix of observation meta-data and recorded values. Each inner array represents 1 row of data. + * @return data + **/ + @Schema(description = "Matrix of observation meta-data and recorded values. Each inner array represents 1 row of data.") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + public ObservationUnitsTableResponse headerRow(List headerRow) { + this.headerRow = headerRow; + return this; + } + + public ObservationUnitsTableResponse addHeaderRowItem(String headerRowItem) { + if (this.headerRow == null) { + this.headerRow = new ArrayList(); + } + this.headerRow.add(headerRowItem); + return this; + } + + /** + * Names of the columns included in the data matrix. Any or All of [ \"year\",\"studyDbId\",\"studyName\",\"locationDbId\",\"locationName\",\"germplasmDbId\",\"germplasmName\",\"observationUnitDbId\",\"plotNumber\",\"replicate\",\"blockNumber\", \"entryType\", \"X\", \"Y\"] + * @return headerRow + **/ + @Schema(description = "Names of the columns included in the data matrix. Any or All of [ \"year\",\"studyDbId\",\"studyName\",\"locationDbId\",\"locationName\",\"germplasmDbId\",\"germplasmName\",\"observationUnitDbId\",\"plotNumber\",\"replicate\",\"blockNumber\", \"entryType\", \"X\", \"Y\"]") + public List getHeaderRow() { + return headerRow; + } + + public void setHeaderRow(List headerRow) { + this.headerRow = headerRow; + } + + public ObservationUnitsTableResponse observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public ObservationUnitsTableResponse addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * Array of observation variable DbIds for the collected data. This array is appended to the \"headerRow\" to get the complete header of the data matrix + * @return observationVariableDbIds + **/ + @Schema(description = "Array of observation variable DbIds for the collected data. This array is appended to the \"headerRow\" to get the complete header of the data matrix") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public ObservationUnitsTableResponse observationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + return this; + } + + public ObservationUnitsTableResponse addObservationVariableNamesItem(String observationVariableNamesItem) { + if (this.observationVariableNames == null) { + this.observationVariableNames = new ArrayList(); + } + this.observationVariableNames.add(observationVariableNamesItem); + return this; + } + + /** + * Human readable names of the observation variables for the collected data. This array should match 1 to 1 with the \"observationVariableDbIds\" array. + * @return observationVariableNames + **/ + @Schema(description = "Human readable names of the observation variables for the collected data. This array should match 1 to 1 with the \"observationVariableDbIds\" array.") + public List getObservationVariableNames() { + return observationVariableNames; + } + + public void setObservationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsTableResponse observationUnitsTableResponse = (ObservationUnitsTableResponse) o; + return Objects.equals(this.data, observationUnitsTableResponse.data) && + Objects.equals(this.headerRow, observationUnitsTableResponse.headerRow) && + Objects.equals(this.observationVariableDbIds, observationUnitsTableResponse.observationVariableDbIds) && + Objects.equals(this.observationVariableNames, observationUnitsTableResponse.observationVariableNames); + } + + @Override + public int hashCode() { + return Objects.hash(data, headerRow, observationVariableDbIds, observationVariableNames); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsTableResponse {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" headerRow: ").append(toIndentedString(headerRow)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" observationVariableNames: ").append(toIndentedString(observationVariableNames)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse1.java new file mode 100755 index 00000000..e1ae01ff --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitsTableResponse; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitsTableResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsTableResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitsTableResponse result = null; + + public ObservationUnitsTableResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitsTableResponse1 result(ObservationUnitsTableResponse result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public ObservationUnitsTableResponse getResult() { + return result; + } + + public void setResult(ObservationUnitsTableResponse result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsTableResponse1 observationUnitsTableResponse1 = (ObservationUnitsTableResponse1) o; + return Objects.equals(this.metadata, observationUnitsTableResponse1.metadata) && + Objects.equals(this.result, observationUnitsTableResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsTableResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse2.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse2.java new file mode 100755 index 00000000..01f19cf2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationUnitsTableResponse2.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationUnitsTableResponse; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationUnitsTableResponse2 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationUnitsTableResponse2 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationUnitsTableResponse result = null; + + public ObservationUnitsTableResponse2 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationUnitsTableResponse2 result(ObservationUnitsTableResponse result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationUnitsTableResponse getResult() { + return result; + } + + public void setResult(ObservationUnitsTableResponse result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationUnitsTableResponse2 observationUnitsTableResponse2 = (ObservationUnitsTableResponse2) o; + return Objects.equals(this.metadata, observationUnitsTableResponse2.metadata) && + Objects.equals(this.result, observationUnitsTableResponse2.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationUnitsTableResponse2 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariable.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariable.java new file mode 100755 index 00000000..7da5e5cb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariable.java @@ -0,0 +1,162 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Method; +import io.swagger.client.model.OntologyReference; +import io.swagger.client.model.Scale; +import io.swagger.client.model.Trait; +import io.swagger.client.model.VariableBaseClass; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * ObservationVariable + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariable extends VariableBaseClass { + @SerializedName("date") + private String date = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("observationVariableName") + private String observationVariableName = null; + + public ObservationVariable date(String date) { + this.date = date; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"submissionTimestamp\" + * @return date + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"submissionTimestamp\"") + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public ObservationVariable name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"observationVariableName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"observationVariableName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ObservationVariable observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * Variable unique identifier + * @return observationVariableDbId + **/ + @Schema(required = true, description = "Variable unique identifier") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public ObservationVariable observationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + return this; + } + + /** + * Variable name (usually a short name) + * @return observationVariableName + **/ + @Schema(required = true, description = "Variable name (usually a short name)") + public String getObservationVariableName() { + return observationVariableName; + } + + public void setObservationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariable observationVariable = (ObservationVariable) o; + return Objects.equals(this.date, observationVariable.date) && + Objects.equals(this.name, observationVariable.name) && + Objects.equals(this.observationVariableDbId, observationVariable.observationVariableDbId) && + Objects.equals(this.observationVariableName, observationVariable.observationVariableName) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(date, name, observationVariableDbId, observationVariableName, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" observationVariableName: ").append(toIndentedString(observationVariableName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableResponse.java new file mode 100755 index 00000000..d092e38a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationVariable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationVariableResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariableResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationVariable result = null; + + public ObservationVariableResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationVariableResponse result(ObservationVariable result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationVariable getResult() { + return result; + } + + public void setResult(ObservationVariable result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariableResponse observationVariableResponse = (ObservationVariableResponse) o; + return Objects.equals(this.metadata, observationVariableResponse.metadata) && + Objects.equals(this.result, observationVariableResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariableResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequest.java new file mode 100755 index 00000000..75bd6a5b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequest.java @@ -0,0 +1,454 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.TraitDataType; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationVariableSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariableSearchRequest { + @SerializedName("dataTypes") + private List dataTypes = null; + + @SerializedName("methodDbIds") + private List methodDbIds = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("observationVariableNames") + private List observationVariableNames = null; + + @SerializedName("observationVariableXrefs") + private List observationVariableXrefs = null; + + @SerializedName("ontologyDbIds") + private List ontologyDbIds = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("scaleDbIds") + private List scaleDbIds = null; + + @SerializedName("scaleXrefs") + private List scaleXrefs = null; + + @SerializedName("traitClasses") + private List traitClasses = null; + + @SerializedName("traitDbIds") + private List traitDbIds = null; + + @SerializedName("traitXrefs") + private List traitXrefs = null; + + public ObservationVariableSearchRequest dataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + public ObservationVariableSearchRequest addDataTypesItem(TraitDataType dataTypesItem) { + if (this.dataTypes == null) { + this.dataTypes = new ArrayList(); + } + this.dataTypes.add(dataTypesItem); + return this; + } + + /** + * List of scale data types to filter search results + * @return dataTypes + **/ + @Schema(description = "List of scale data types to filter search results") + public List getDataTypes() { + return dataTypes; + } + + public void setDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + } + + public ObservationVariableSearchRequest methodDbIds(List methodDbIds) { + this.methodDbIds = methodDbIds; + return this; + } + + public ObservationVariableSearchRequest addMethodDbIdsItem(String methodDbIdsItem) { + if (this.methodDbIds == null) { + this.methodDbIds = new ArrayList(); + } + this.methodDbIds.add(methodDbIdsItem); + return this; + } + + /** + * List of methods to filter search results + * @return methodDbIds + **/ + @Schema(description = "List of methods to filter search results") + public List getMethodDbIds() { + return methodDbIds; + } + + public void setMethodDbIds(List methodDbIds) { + this.methodDbIds = methodDbIds; + } + + public ObservationVariableSearchRequest observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public ObservationVariableSearchRequest addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * List of observation variable IDs to search for + * @return observationVariableDbIds + **/ + @Schema(description = "List of observation variable IDs to search for") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public ObservationVariableSearchRequest observationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + return this; + } + + public ObservationVariableSearchRequest addObservationVariableNamesItem(String observationVariableNamesItem) { + if (this.observationVariableNames == null) { + this.observationVariableNames = new ArrayList(); + } + this.observationVariableNames.add(observationVariableNamesItem); + return this; + } + + /** + * List of human readable observation variable names to search for + * @return observationVariableNames + **/ + @Schema(description = "List of human readable observation variable names to search for") + public List getObservationVariableNames() { + return observationVariableNames; + } + + public void setObservationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + } + + public ObservationVariableSearchRequest observationVariableXrefs(List observationVariableXrefs) { + this.observationVariableXrefs = observationVariableXrefs; + return this; + } + + public ObservationVariableSearchRequest addObservationVariableXrefsItem(String observationVariableXrefsItem) { + if (this.observationVariableXrefs == null) { + this.observationVariableXrefs = new ArrayList(); + } + this.observationVariableXrefs.add(observationVariableXrefsItem); + return this; + } + + /** + * List of cross references for the observation variable to search for + * @return observationVariableXrefs + **/ + @Schema(description = "List of cross references for the observation variable to search for") + public List getObservationVariableXrefs() { + return observationVariableXrefs; + } + + public void setObservationVariableXrefs(List observationVariableXrefs) { + this.observationVariableXrefs = observationVariableXrefs; + } + + public ObservationVariableSearchRequest ontologyDbIds(List ontologyDbIds) { + this.ontologyDbIds = ontologyDbIds; + return this; + } + + public ObservationVariableSearchRequest addOntologyDbIdsItem(String ontologyDbIdsItem) { + if (this.ontologyDbIds == null) { + this.ontologyDbIds = new ArrayList(); + } + this.ontologyDbIds.add(ontologyDbIdsItem); + return this; + } + + /** + * List of ontology IDs to search for + * @return ontologyDbIds + **/ + @Schema(description = "List of ontology IDs to search for") + public List getOntologyDbIds() { + return ontologyDbIds; + } + + public void setOntologyDbIds(List ontologyDbIds) { + this.ontologyDbIds = ontologyDbIds; + } + + public ObservationVariableSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public ObservationVariableSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public ObservationVariableSearchRequest scaleDbIds(List scaleDbIds) { + this.scaleDbIds = scaleDbIds; + return this; + } + + public ObservationVariableSearchRequest addScaleDbIdsItem(String scaleDbIdsItem) { + if (this.scaleDbIds == null) { + this.scaleDbIds = new ArrayList(); + } + this.scaleDbIds.add(scaleDbIdsItem); + return this; + } + + /** + * List of scales to filter search results + * @return scaleDbIds + **/ + @Schema(description = "List of scales to filter search results") + public List getScaleDbIds() { + return scaleDbIds; + } + + public void setScaleDbIds(List scaleDbIds) { + this.scaleDbIds = scaleDbIds; + } + + public ObservationVariableSearchRequest scaleXrefs(List scaleXrefs) { + this.scaleXrefs = scaleXrefs; + return this; + } + + public ObservationVariableSearchRequest addScaleXrefsItem(String scaleXrefsItem) { + if (this.scaleXrefs == null) { + this.scaleXrefs = new ArrayList(); + } + this.scaleXrefs.add(scaleXrefsItem); + return this; + } + + /** + * List of cross references for the scale to search for + * @return scaleXrefs + **/ + @Schema(description = "List of cross references for the scale to search for") + public List getScaleXrefs() { + return scaleXrefs; + } + + public void setScaleXrefs(List scaleXrefs) { + this.scaleXrefs = scaleXrefs; + } + + public ObservationVariableSearchRequest traitClasses(List traitClasses) { + this.traitClasses = traitClasses; + return this; + } + + public ObservationVariableSearchRequest addTraitClassesItem(String traitClassesItem) { + if (this.traitClasses == null) { + this.traitClasses = new ArrayList(); + } + this.traitClasses.add(traitClassesItem); + return this; + } + + /** + * List of trait classes to filter search results + * @return traitClasses + **/ + @Schema(description = "List of trait classes to filter search results") + public List getTraitClasses() { + return traitClasses; + } + + public void setTraitClasses(List traitClasses) { + this.traitClasses = traitClasses; + } + + public ObservationVariableSearchRequest traitDbIds(List traitDbIds) { + this.traitDbIds = traitDbIds; + return this; + } + + public ObservationVariableSearchRequest addTraitDbIdsItem(String traitDbIdsItem) { + if (this.traitDbIds == null) { + this.traitDbIds = new ArrayList(); + } + this.traitDbIds.add(traitDbIdsItem); + return this; + } + + /** + * List of trait unique ID to filter search results + * @return traitDbIds + **/ + @Schema(description = "List of trait unique ID to filter search results") + public List getTraitDbIds() { + return traitDbIds; + } + + public void setTraitDbIds(List traitDbIds) { + this.traitDbIds = traitDbIds; + } + + public ObservationVariableSearchRequest traitXrefs(List traitXrefs) { + this.traitXrefs = traitXrefs; + return this; + } + + public ObservationVariableSearchRequest addTraitXrefsItem(String traitXrefsItem) { + if (this.traitXrefs == null) { + this.traitXrefs = new ArrayList(); + } + this.traitXrefs.add(traitXrefsItem); + return this; + } + + /** + * List of cross references for the trait to search for + * @return traitXrefs + **/ + @Schema(description = "List of cross references for the trait to search for") + public List getTraitXrefs() { + return traitXrefs; + } + + public void setTraitXrefs(List traitXrefs) { + this.traitXrefs = traitXrefs; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariableSearchRequest observationVariableSearchRequest = (ObservationVariableSearchRequest) o; + return Objects.equals(this.dataTypes, observationVariableSearchRequest.dataTypes) && + Objects.equals(this.methodDbIds, observationVariableSearchRequest.methodDbIds) && + Objects.equals(this.observationVariableDbIds, observationVariableSearchRequest.observationVariableDbIds) && + Objects.equals(this.observationVariableNames, observationVariableSearchRequest.observationVariableNames) && + Objects.equals(this.observationVariableXrefs, observationVariableSearchRequest.observationVariableXrefs) && + Objects.equals(this.ontologyDbIds, observationVariableSearchRequest.ontologyDbIds) && + Objects.equals(this.page, observationVariableSearchRequest.page) && + Objects.equals(this.pageSize, observationVariableSearchRequest.pageSize) && + Objects.equals(this.scaleDbIds, observationVariableSearchRequest.scaleDbIds) && + Objects.equals(this.scaleXrefs, observationVariableSearchRequest.scaleXrefs) && + Objects.equals(this.traitClasses, observationVariableSearchRequest.traitClasses) && + Objects.equals(this.traitDbIds, observationVariableSearchRequest.traitDbIds) && + Objects.equals(this.traitXrefs, observationVariableSearchRequest.traitXrefs); + } + + @Override + public int hashCode() { + return Objects.hash(dataTypes, methodDbIds, observationVariableDbIds, observationVariableNames, observationVariableXrefs, ontologyDbIds, page, pageSize, scaleDbIds, scaleXrefs, traitClasses, traitDbIds, traitXrefs); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariableSearchRequest {\n"); + + sb.append(" dataTypes: ").append(toIndentedString(dataTypes)).append("\n"); + sb.append(" methodDbIds: ").append(toIndentedString(methodDbIds)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" observationVariableNames: ").append(toIndentedString(observationVariableNames)).append("\n"); + sb.append(" observationVariableXrefs: ").append(toIndentedString(observationVariableXrefs)).append("\n"); + sb.append(" ontologyDbIds: ").append(toIndentedString(ontologyDbIds)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" scaleDbIds: ").append(toIndentedString(scaleDbIds)).append("\n"); + sb.append(" scaleXrefs: ").append(toIndentedString(scaleXrefs)).append("\n"); + sb.append(" traitClasses: ").append(toIndentedString(traitClasses)).append("\n"); + sb.append(" traitDbIds: ").append(toIndentedString(traitDbIds)).append("\n"); + sb.append(" traitXrefs: ").append(toIndentedString(traitXrefs)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequestDep.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequestDep.java new file mode 100755 index 00000000..3b3d446d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariableSearchRequestDep.java @@ -0,0 +1,361 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.TraitDataType; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationVariableSearchRequestDep + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariableSearchRequestDep { + @SerializedName("datatypes") + private List datatypes = null; + + @SerializedName("methodDbIds") + private List methodDbIds = null; + + @SerializedName("names") + private List names = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("ontologyDbIds") + private List ontologyDbIds = null; + + @SerializedName("ontologyXrefs") + private List ontologyXrefs = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("scaleDbIds") + private List scaleDbIds = null; + + @SerializedName("traitClasses") + private List traitClasses = null; + + public ObservationVariableSearchRequestDep datatypes(List datatypes) { + this.datatypes = datatypes; + return this; + } + + public ObservationVariableSearchRequestDep addDatatypesItem(TraitDataType datatypesItem) { + if (this.datatypes == null) { + this.datatypes = new ArrayList(); + } + this.datatypes.add(datatypesItem); + return this; + } + + /** + * List of scale data types to filter search results + * @return datatypes + **/ + @Schema(description = "List of scale data types to filter search results") + public List getDatatypes() { + return datatypes; + } + + public void setDatatypes(List datatypes) { + this.datatypes = datatypes; + } + + public ObservationVariableSearchRequestDep methodDbIds(List methodDbIds) { + this.methodDbIds = methodDbIds; + return this; + } + + public ObservationVariableSearchRequestDep addMethodDbIdsItem(String methodDbIdsItem) { + if (this.methodDbIds == null) { + this.methodDbIds = new ArrayList(); + } + this.methodDbIds.add(methodDbIdsItem); + return this; + } + + /** + * List of methods to filter search results + * @return methodDbIds + **/ + @Schema(description = "List of methods to filter search results") + public List getMethodDbIds() { + return methodDbIds; + } + + public void setMethodDbIds(List methodDbIds) { + this.methodDbIds = methodDbIds; + } + + public ObservationVariableSearchRequestDep names(List names) { + this.names = names; + return this; + } + + public ObservationVariableSearchRequestDep addNamesItem(String namesItem) { + if (this.names == null) { + this.names = new ArrayList(); + } + this.names.add(namesItem); + return this; + } + + /** + * List of human readable observation variable names to search for + * @return names + **/ + @Schema(description = "List of human readable observation variable names to search for") + public List getNames() { + return names; + } + + public void setNames(List names) { + this.names = names; + } + + public ObservationVariableSearchRequestDep observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public ObservationVariableSearchRequestDep addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * List of observation variable IDs to search for + * @return observationVariableDbIds + **/ + @Schema(description = "List of observation variable IDs to search for") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public ObservationVariableSearchRequestDep ontologyDbIds(List ontologyDbIds) { + this.ontologyDbIds = ontologyDbIds; + return this; + } + + public ObservationVariableSearchRequestDep addOntologyDbIdsItem(String ontologyDbIdsItem) { + if (this.ontologyDbIds == null) { + this.ontologyDbIds = new ArrayList(); + } + this.ontologyDbIds.add(ontologyDbIdsItem); + return this; + } + + /** + * List of ontology IDs to search for + * @return ontologyDbIds + **/ + @Schema(description = "List of ontology IDs to search for") + public List getOntologyDbIds() { + return ontologyDbIds; + } + + public void setOntologyDbIds(List ontologyDbIds) { + this.ontologyDbIds = ontologyDbIds; + } + + public ObservationVariableSearchRequestDep ontologyXrefs(List ontologyXrefs) { + this.ontologyXrefs = ontologyXrefs; + return this; + } + + public ObservationVariableSearchRequestDep addOntologyXrefsItem(String ontologyXrefsItem) { + if (this.ontologyXrefs == null) { + this.ontologyXrefs = new ArrayList(); + } + this.ontologyXrefs.add(ontologyXrefsItem); + return this; + } + + /** + * List of cross reference values to search for + * @return ontologyXrefs + **/ + @Schema(description = "List of cross reference values to search for") + public List getOntologyXrefs() { + return ontologyXrefs; + } + + public void setOntologyXrefs(List ontologyXrefs) { + this.ontologyXrefs = ontologyXrefs; + } + + public ObservationVariableSearchRequestDep page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public ObservationVariableSearchRequestDep pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public ObservationVariableSearchRequestDep scaleDbIds(List scaleDbIds) { + this.scaleDbIds = scaleDbIds; + return this; + } + + public ObservationVariableSearchRequestDep addScaleDbIdsItem(String scaleDbIdsItem) { + if (this.scaleDbIds == null) { + this.scaleDbIds = new ArrayList(); + } + this.scaleDbIds.add(scaleDbIdsItem); + return this; + } + + /** + * List of scales to filter search results + * @return scaleDbIds + **/ + @Schema(description = "List of scales to filter search results") + public List getScaleDbIds() { + return scaleDbIds; + } + + public void setScaleDbIds(List scaleDbIds) { + this.scaleDbIds = scaleDbIds; + } + + public ObservationVariableSearchRequestDep traitClasses(List traitClasses) { + this.traitClasses = traitClasses; + return this; + } + + public ObservationVariableSearchRequestDep addTraitClassesItem(String traitClassesItem) { + if (this.traitClasses == null) { + this.traitClasses = new ArrayList(); + } + this.traitClasses.add(traitClassesItem); + return this; + } + + /** + * List of trait classes to filter search results + * @return traitClasses + **/ + @Schema(description = "List of trait classes to filter search results") + public List getTraitClasses() { + return traitClasses; + } + + public void setTraitClasses(List traitClasses) { + this.traitClasses = traitClasses; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariableSearchRequestDep observationVariableSearchRequestDep = (ObservationVariableSearchRequestDep) o; + return Objects.equals(this.datatypes, observationVariableSearchRequestDep.datatypes) && + Objects.equals(this.methodDbIds, observationVariableSearchRequestDep.methodDbIds) && + Objects.equals(this.names, observationVariableSearchRequestDep.names) && + Objects.equals(this.observationVariableDbIds, observationVariableSearchRequestDep.observationVariableDbIds) && + Objects.equals(this.ontologyDbIds, observationVariableSearchRequestDep.ontologyDbIds) && + Objects.equals(this.ontologyXrefs, observationVariableSearchRequestDep.ontologyXrefs) && + Objects.equals(this.page, observationVariableSearchRequestDep.page) && + Objects.equals(this.pageSize, observationVariableSearchRequestDep.pageSize) && + Objects.equals(this.scaleDbIds, observationVariableSearchRequestDep.scaleDbIds) && + Objects.equals(this.traitClasses, observationVariableSearchRequestDep.traitClasses); + } + + @Override + public int hashCode() { + return Objects.hash(datatypes, methodDbIds, names, observationVariableDbIds, ontologyDbIds, ontologyXrefs, page, pageSize, scaleDbIds, traitClasses); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariableSearchRequestDep {\n"); + + sb.append(" datatypes: ").append(toIndentedString(datatypes)).append("\n"); + sb.append(" methodDbIds: ").append(toIndentedString(methodDbIds)).append("\n"); + sb.append(" names: ").append(toIndentedString(names)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" ontologyDbIds: ").append(toIndentedString(ontologyDbIds)).append("\n"); + sb.append(" ontologyXrefs: ").append(toIndentedString(ontologyXrefs)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" scaleDbIds: ").append(toIndentedString(scaleDbIds)).append("\n"); + sb.append(" traitClasses: ").append(toIndentedString(traitClasses)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse.java new file mode 100755 index 00000000..82f22781 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationVariablesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationVariablesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariablesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationVariablesResponseResult result = null; + + public ObservationVariablesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationVariablesResponse result(ObservationVariablesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationVariablesResponseResult getResult() { + return result; + } + + public void setResult(ObservationVariablesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariablesResponse observationVariablesResponse = (ObservationVariablesResponse) o; + return Objects.equals(this.metadata, observationVariablesResponse.metadata) && + Objects.equals(this.result, observationVariablesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariablesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1.java new file mode 100755 index 00000000..a5933d87 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationVariablesResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationVariablesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariablesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationVariablesResponse1Result result = null; + + public ObservationVariablesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationVariablesResponse1 result(ObservationVariablesResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationVariablesResponse1Result getResult() { + return result; + } + + public void setResult(ObservationVariablesResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariablesResponse1 observationVariablesResponse1 = (ObservationVariablesResponse1) o; + return Objects.equals(this.metadata, observationVariablesResponse1.metadata) && + Objects.equals(this.result, observationVariablesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariablesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1Result.java new file mode 100755 index 00000000..a60c32c6 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationVariable; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationVariablesResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariablesResponse1Result { + @SerializedName("data") + private List data = null; + + public ObservationVariablesResponse1Result data(List data) { + this.data = data; + return this; + } + + public ObservationVariablesResponse1Result addDataItem(ObservationVariable dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariablesResponse1Result observationVariablesResponse1Result = (ObservationVariablesResponse1Result) o; + return Objects.equals(this.data, observationVariablesResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariablesResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponseResult.java new file mode 100755 index 00000000..55275a06 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationVariablesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationVariable; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationVariablesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationVariablesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationVariablesResponseResult data(List data) { + this.data = data; + return this; + } + + public ObservationVariablesResponseResult addDataItem(ObservationVariable dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationVariablesResponseResult observationVariablesResponseResult = (ObservationVariablesResponseResult) o; + return Objects.equals(this.data, observationVariablesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationVariablesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponse.java new file mode 100755 index 00000000..26629ff9 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ObservationsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationsResponseResult result = null; + + public ObservationsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ObservationsResponse result(ObservationsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationsResponseResult getResult() { + return result; + } + + public void setResult(ObservationsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationsResponse observationsResponse = (ObservationsResponse) o; + return Objects.equals(this.metadata, observationsResponse.metadata) && + Objects.equals(this.result, observationsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponseResult.java new file mode 100755 index 00000000..5bfce455 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Observation; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ObservationsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ObservationsResponseResult data(List data) { + this.data = data; + return this; + } + + public ObservationsResponseResult addDataItem(Observation dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationsResponseResult observationsResponseResult = (ObservationsResponseResult) o; + return Objects.equals(this.data, observationsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsTable.java b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsTable.java new file mode 100755 index 00000000..a4b4045e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ObservationsTable.java @@ -0,0 +1,248 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * ObservationsTable + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ObservationsTable { + @SerializedName("data") + private List> data = null; + + /** + * valid header fields + */ + @JsonAdapter(HeaderRowEnum.Adapter.class) + public enum HeaderRowEnum { + YEAR("year"), + STUDYDBID("studyDbId"), + STUDYNAME("studyName"), + LOCATIONDBID("locationDbId"), + LOCATIONNAME("locationName"), + GERMPLASMDBID("germplasmDbId"), + GERMPLASMNAME("germplasmName"), + OBSERVATIONUNITDBID("observationUnitDbId"), + PLOTNUMBER("plotNumber"), + REPLICATE("replicate"), + BLOCKNUMBER("blockNumber"), + OBSERVATIONTIMESTAMP("observationTimestamp"), + ENTRYTYPE("entryType"), + X("X"), + Y("Y"); + + private String value; + + HeaderRowEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static HeaderRowEnum fromValue(String text) { + for (HeaderRowEnum b : HeaderRowEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HeaderRowEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HeaderRowEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HeaderRowEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("headerRow") + private List headerRow = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("observationVariableNames") + private List observationVariableNames = null; + + public ObservationsTable data(List> data) { + this.data = data; + return this; + } + + public ObservationsTable addDataItem(List dataItem) { + if (this.data == null) { + this.data = new ArrayList>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Matrix of observation data recorded for different observation variables across different observation units + * @return data + **/ + @Schema(description = "Matrix of observation data recorded for different observation variables across different observation units") + public List> getData() { + return data; + } + + public void setData(List> data) { + this.data = data; + } + + public ObservationsTable headerRow(List headerRow) { + this.headerRow = headerRow; + return this; + } + + public ObservationsTable addHeaderRowItem(HeaderRowEnum headerRowItem) { + if (this.headerRow == null) { + this.headerRow = new ArrayList(); + } + this.headerRow.add(headerRowItem); + return this; + } + + /** + * The header row describing observation unit fields. Append 'observationVariableDbIds' for complete header row of the table. This array should contain any or all of the following strings; year, studyDbId, studyName, locationDbId, locationName, germplasmDbId, germplasmName, observationUnitDbId, plotNumber, replicate, blockNumber, observationTimestamp (DEPRECATED in V1.3), entryType, X, Y + * @return headerRow + **/ + @Schema(description = "The header row describing observation unit fields. Append 'observationVariableDbIds' for complete header row of the table. This array should contain any or all of the following strings; year, studyDbId, studyName, locationDbId, locationName, germplasmDbId, germplasmName, observationUnitDbId, plotNumber, replicate, blockNumber, observationTimestamp (DEPRECATED in V1.3), entryType, X, Y") + public List getHeaderRow() { + return headerRow; + } + + public void setHeaderRow(List headerRow) { + this.headerRow = headerRow; + } + + public ObservationsTable observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public ObservationsTable addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * The list of observation variables which have values recorded for them in the data matrix. Append to the 'headerRow' for comlete header row. + * @return observationVariableDbIds + **/ + @Schema(description = "The list of observation variables which have values recorded for them in the data matrix. Append to the 'headerRow' for comlete header row.") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public ObservationsTable observationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + return this; + } + + public ObservationsTable addObservationVariableNamesItem(String observationVariableNamesItem) { + if (this.observationVariableNames == null) { + this.observationVariableNames = new ArrayList(); + } + this.observationVariableNames.add(observationVariableNamesItem); + return this; + } + + /** + * The list of observation variable names which have values recorded for them in the data matrix. Order should match 'observationVariableDbIds'. + * @return observationVariableNames + **/ + @Schema(description = "The list of observation variable names which have values recorded for them in the data matrix. Order should match 'observationVariableDbIds'.") + public List getObservationVariableNames() { + return observationVariableNames; + } + + public void setObservationVariableNames(List observationVariableNames) { + this.observationVariableNames = observationVariableNames; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservationsTable observationsTable = (ObservationsTable) o; + return Objects.equals(this.data, observationsTable.data) && + Objects.equals(this.headerRow, observationsTable.headerRow) && + Objects.equals(this.observationVariableDbIds, observationsTable.observationVariableDbIds) && + Objects.equals(this.observationVariableNames, observationsTable.observationVariableNames); + } + + @Override + public int hashCode() { + return Objects.hash(data, headerRow, observationVariableDbIds, observationVariableNames); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservationsTable {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" headerRow: ").append(toIndentedString(headerRow)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" observationVariableNames: ").append(toIndentedString(observationVariableNames)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/OneOfGeoJSONGeometry.java b/brapi-client/src/main/resources/swagger-generated-client/model/OneOfGeoJSONGeometry.java new file mode 100755 index 00000000..773c8b1e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/OneOfGeoJSONGeometry.java @@ -0,0 +1,20 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +/** +* OneOfGeoJSONGeometry +*/ +public interface OneOfGeoJSONGeometry { + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponse.java new file mode 100755 index 00000000..d8abd6cb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.OntologiesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * OntologiesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class OntologiesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private OntologiesResponseResult result = null; + + public OntologiesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public OntologiesResponse result(OntologiesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public OntologiesResponseResult getResult() { + return result; + } + + public void setResult(OntologiesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OntologiesResponse ontologiesResponse = (OntologiesResponse) o; + return Objects.equals(this.metadata, ontologiesResponse.metadata) && + Objects.equals(this.result, ontologiesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OntologiesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponseResult.java new file mode 100755 index 00000000..41487a82 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/OntologiesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Ontology; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * OntologiesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class OntologiesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public OntologiesResponseResult data(List data) { + this.data = data; + return this; + } + + public OntologiesResponseResult addDataItem(Ontology dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OntologiesResponseResult ontologiesResponseResult = (OntologiesResponseResult) o; + return Objects.equals(this.data, ontologiesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OntologiesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Ontology.java b/brapi-client/src/main/resources/swagger-generated-client/model/Ontology.java new file mode 100755 index 00000000..e3b9b174 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Ontology.java @@ -0,0 +1,248 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Ontology + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Ontology { + @SerializedName("authors") + private String authors = null; + + @SerializedName("copyright") + private String copyright = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("licence") + private String licence = null; + + @SerializedName("ontologyDbId") + private String ontologyDbId = null; + + @SerializedName("ontologyName") + private String ontologyName = null; + + @SerializedName("version") + private String version = null; + + public Ontology authors(String authors) { + this.authors = authors; + return this; + } + + /** + * Ontology's list of authors (no specific format) + * @return authors + **/ + @Schema(description = "Ontology's list of authors (no specific format)") + public String getAuthors() { + return authors; + } + + public void setAuthors(String authors) { + this.authors = authors; + } + + public Ontology copyright(String copyright) { + this.copyright = copyright; + return this; + } + + /** + * Ontology copyright + * @return copyright + **/ + @Schema(description = "Ontology copyright") + public String getCopyright() { + return copyright; + } + + public void setCopyright(String copyright) { + this.copyright = copyright; + } + + public Ontology description(String description) { + this.description = description; + return this; + } + + /** + * Human readable description of Ontology + * @return description + **/ + @Schema(description = "Human readable description of Ontology") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Ontology documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Ontology licence(String licence) { + this.licence = licence; + return this; + } + + /** + * Ontology licence + * @return licence + **/ + @Schema(description = "Ontology licence") + public String getLicence() { + return licence; + } + + public void setLicence(String licence) { + this.licence = licence; + } + + public Ontology ontologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + return this; + } + + /** + * Ontology database unique identifier + * @return ontologyDbId + **/ + @Schema(required = true, description = "Ontology database unique identifier") + public String getOntologyDbId() { + return ontologyDbId; + } + + public void setOntologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + } + + public Ontology ontologyName(String ontologyName) { + this.ontologyName = ontologyName; + return this; + } + + /** + * Ontology name + * @return ontologyName + **/ + @Schema(required = true, description = "Ontology name") + public String getOntologyName() { + return ontologyName; + } + + public void setOntologyName(String ontologyName) { + this.ontologyName = ontologyName; + } + + public Ontology version(String version) { + this.version = version; + return this; + } + + /** + * Ontology version (no specific format) + * @return version + **/ + @Schema(description = "Ontology version (no specific format)") + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ontology ontology = (Ontology) o; + return Objects.equals(this.authors, ontology.authors) && + Objects.equals(this.copyright, ontology.copyright) && + Objects.equals(this.description, ontology.description) && + Objects.equals(this.documentationURL, ontology.documentationURL) && + Objects.equals(this.licence, ontology.licence) && + Objects.equals(this.ontologyDbId, ontology.ontologyDbId) && + Objects.equals(this.ontologyName, ontology.ontologyName) && + Objects.equals(this.version, ontology.version); + } + + @Override + public int hashCode() { + return Objects.hash(authors, copyright, description, documentationURL, licence, ontologyDbId, ontologyName, version); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Ontology {\n"); + + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" copyright: ").append(toIndentedString(copyright)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" licence: ").append(toIndentedString(licence)).append("\n"); + sb.append(" ontologyDbId: ").append(toIndentedString(ontologyDbId)).append("\n"); + sb.append(" ontologyName: ").append(toIndentedString(ontologyName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReference.java b/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReference.java new file mode 100755 index 00000000..bff32fd0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReference.java @@ -0,0 +1,167 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReferenceDocumentationLinks; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * OntologyReference + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class OntologyReference { + @SerializedName("documentationLinks") + private List documentationLinks = null; + + @SerializedName("ontologyDbId") + private String ontologyDbId = null; + + @SerializedName("ontologyName") + private String ontologyName = null; + + @SerializedName("version") + private String version = null; + + public OntologyReference documentationLinks(List documentationLinks) { + this.documentationLinks = documentationLinks; + return this; + } + + public OntologyReference addDocumentationLinksItem(OntologyReferenceDocumentationLinks documentationLinksItem) { + if (this.documentationLinks == null) { + this.documentationLinks = new ArrayList(); + } + this.documentationLinks.add(documentationLinksItem); + return this; + } + + /** + * links to various ontology documentation + * @return documentationLinks + **/ + @Schema(description = "links to various ontology documentation") + public List getDocumentationLinks() { + return documentationLinks; + } + + public void setDocumentationLinks(List documentationLinks) { + this.documentationLinks = documentationLinks; + } + + public OntologyReference ontologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + return this; + } + + /** + * Ontology database unique identifier + * @return ontologyDbId + **/ + @Schema(description = "Ontology database unique identifier") + public String getOntologyDbId() { + return ontologyDbId; + } + + public void setOntologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + } + + public OntologyReference ontologyName(String ontologyName) { + this.ontologyName = ontologyName; + return this; + } + + /** + * Ontology name + * @return ontologyName + **/ + @Schema(required = true, description = "Ontology name") + public String getOntologyName() { + return ontologyName; + } + + public void setOntologyName(String ontologyName) { + this.ontologyName = ontologyName; + } + + public OntologyReference version(String version) { + this.version = version; + return this; + } + + /** + * Ontology version (no specific format) + * @return version + **/ + @Schema(description = "Ontology version (no specific format)") + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OntologyReference ontologyReference = (OntologyReference) o; + return Objects.equals(this.documentationLinks, ontologyReference.documentationLinks) && + Objects.equals(this.ontologyDbId, ontologyReference.ontologyDbId) && + Objects.equals(this.ontologyName, ontologyReference.ontologyName) && + Objects.equals(this.version, ontologyReference.version); + } + + @Override + public int hashCode() { + return Objects.hash(documentationLinks, ontologyDbId, ontologyName, version); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OntologyReference {\n"); + + sb.append(" documentationLinks: ").append(toIndentedString(documentationLinks)).append("\n"); + sb.append(" ontologyDbId: ").append(toIndentedString(ontologyDbId)).append("\n"); + sb.append(" ontologyName: ").append(toIndentedString(ontologyName)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReferenceDocumentationLinks.java b/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReferenceDocumentationLinks.java new file mode 100755 index 00000000..f1b57b0a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/OntologyReferenceDocumentationLinks.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * OntologyReferenceDocumentationLinks + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class OntologyReferenceDocumentationLinks { + @SerializedName("URL") + private String URL = null; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + OBO("OBO"), + RDF("RDF"), + WEBPAGE("WEBPAGE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("type") + private TypeEnum type = null; + + public OntologyReferenceDocumentationLinks URL(String URL) { + this.URL = URL; + return this; + } + + /** + * Get URL + * @return URL + **/ + @Schema(description = "") + public String getURL() { + return URL; + } + + public void setURL(String URL) { + this.URL = URL; + } + + public OntologyReferenceDocumentationLinks type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OntologyReferenceDocumentationLinks ontologyReferenceDocumentationLinks = (OntologyReferenceDocumentationLinks) o; + return Objects.equals(this.URL, ontologyReferenceDocumentationLinks.URL) && + Objects.equals(this.type, ontologyReferenceDocumentationLinks.type); + } + + @Override + public int hashCode() { + return Objects.hash(URL, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OntologyReferenceDocumentationLinks {\n"); + + sb.append(" URL: ").append(toIndentedString(URL)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Pedigree.java b/brapi-client/src/main/resources/swagger-generated-client/model/Pedigree.java new file mode 100755 index 00000000..56f0c62f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Pedigree.java @@ -0,0 +1,510 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.PedigreeSiblings; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * Pedigree + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Pedigree { + @SerializedName("crossingPlan") + private String crossingPlan = null; + + @SerializedName("crossingYear") + private String crossingYear = null; + + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("familyCode") + private String familyCode = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("parent1DbId") + private String parent1DbId = null; + + @SerializedName("parent1Id") + private String parent1Id = null; + + @SerializedName("parent1Name") + private String parent1Name = null; + + /** + * The type of parent the first parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc. + */ + @JsonAdapter(Parent1TypeEnum.Adapter.class) + public enum Parent1TypeEnum { + MALE("MALE"), + FEMALE("FEMALE"), + SELF("SELF"), + POPULATION("POPULATION"); + + private String value; + + Parent1TypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static Parent1TypeEnum fromValue(String text) { + for (Parent1TypeEnum b : Parent1TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Parent1TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Parent1TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Parent1TypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("parent1Type") + private Parent1TypeEnum parent1Type = null; + + @SerializedName("parent2DbId") + private String parent2DbId = null; + + @SerializedName("parent2Id") + private String parent2Id = null; + + @SerializedName("parent2Name") + private String parent2Name = null; + + /** + * The type of parent the second parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc. + */ + @JsonAdapter(Parent2TypeEnum.Adapter.class) + public enum Parent2TypeEnum { + MALE("MALE"), + FEMALE("FEMALE"), + SELF("SELF"), + POPULATION("POPULATION"); + + private String value; + + Parent2TypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static Parent2TypeEnum fromValue(String text) { + for (Parent2TypeEnum b : Parent2TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Parent2TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Parent2TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Parent2TypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("parent2Type") + private Parent2TypeEnum parent2Type = null; + + @SerializedName("pedigree") + private String pedigree = null; + + @SerializedName("siblings") + private List siblings = null; + + public Pedigree crossingPlan(String crossingPlan) { + this.crossingPlan = crossingPlan; + return this; + } + + /** + * The crossing strategy used to generate this germplasm + * @return crossingPlan + **/ + @Schema(description = "The crossing strategy used to generate this germplasm") + public String getCrossingPlan() { + return crossingPlan; + } + + public void setCrossingPlan(String crossingPlan) { + this.crossingPlan = crossingPlan; + } + + public Pedigree crossingYear(String crossingYear) { + this.crossingYear = crossingYear; + return this; + } + + /** + * The year the parents were originally crossed + * @return crossingYear + **/ + @Schema(description = "The year the parents were originally crossed") + public String getCrossingYear() { + return crossingYear; + } + + public void setCrossingYear(String crossingYear) { + this.crossingYear = crossingYear; + } + + public Pedigree defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * A human readable name for a germplasm + * @return defaultDisplayName + **/ + @Schema(description = "A human readable name for a germplasm") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public Pedigree familyCode(String familyCode) { + this.familyCode = familyCode; + return this; + } + + /** + * The code representing the family + * @return familyCode + **/ + @Schema(description = "The code representing the family") + public String getFamilyCode() { + return familyCode; + } + + public void setFamilyCode(String familyCode) { + this.familyCode = familyCode; + } + + public Pedigree germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public Pedigree parent1DbId(String parent1DbId) { + this.parent1DbId = parent1DbId; + return this; + } + + /** + * The germplasm DbId of the first parent of this germplasm + * @return parent1DbId + **/ + @Schema(description = "The germplasm DbId of the first parent of this germplasm") + public String getParent1DbId() { + return parent1DbId; + } + + public void setParent1DbId(String parent1DbId) { + this.parent1DbId = parent1DbId; + } + + public Pedigree parent1Id(String parent1Id) { + this.parent1Id = parent1Id; + return this; + } + + /** + * **Deprecated** use parent1DbId + * @return parent1Id + **/ + @Schema(description = "**Deprecated** use parent1DbId") + public String getParent1Id() { + return parent1Id; + } + + public void setParent1Id(String parent1Id) { + this.parent1Id = parent1Id; + } + + public Pedigree parent1Name(String parent1Name) { + this.parent1Name = parent1Name; + return this; + } + + /** + * the human readable name of the first parent of this germplasm + * @return parent1Name + **/ + @Schema(description = "the human readable name of the first parent of this germplasm") + public String getParent1Name() { + return parent1Name; + } + + public void setParent1Name(String parent1Name) { + this.parent1Name = parent1Name; + } + + public Pedigree parent1Type(Parent1TypeEnum parent1Type) { + this.parent1Type = parent1Type; + return this; + } + + /** + * The type of parent the first parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc. + * @return parent1Type + **/ + @Schema(description = "The type of parent the first parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc.") + public Parent1TypeEnum getParent1Type() { + return parent1Type; + } + + public void setParent1Type(Parent1TypeEnum parent1Type) { + this.parent1Type = parent1Type; + } + + public Pedigree parent2DbId(String parent2DbId) { + this.parent2DbId = parent2DbId; + return this; + } + + /** + * The germplasm DbId of the second parent of this germplasm + * @return parent2DbId + **/ + @Schema(description = "The germplasm DbId of the second parent of this germplasm") + public String getParent2DbId() { + return parent2DbId; + } + + public void setParent2DbId(String parent2DbId) { + this.parent2DbId = parent2DbId; + } + + public Pedigree parent2Id(String parent2Id) { + this.parent2Id = parent2Id; + return this; + } + + /** + * **Deprecated** use parent2DbId + * @return parent2Id + **/ + @Schema(description = "**Deprecated** use parent2DbId") + public String getParent2Id() { + return parent2Id; + } + + public void setParent2Id(String parent2Id) { + this.parent2Id = parent2Id; + } + + public Pedigree parent2Name(String parent2Name) { + this.parent2Name = parent2Name; + return this; + } + + /** + * The human readable name of the second parent of this germplasm + * @return parent2Name + **/ + @Schema(description = "The human readable name of the second parent of this germplasm") + public String getParent2Name() { + return parent2Name; + } + + public void setParent2Name(String parent2Name) { + this.parent2Name = parent2Name; + } + + public Pedigree parent2Type(Parent2TypeEnum parent2Type) { + this.parent2Type = parent2Type; + return this; + } + + /** + * The type of parent the second parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc. + * @return parent2Type + **/ + @Schema(description = "The type of parent the second parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc.") + public Parent2TypeEnum getParent2Type() { + return parent2Type; + } + + public void setParent2Type(Parent2TypeEnum parent2Type) { + this.parent2Type = parent2Type; + } + + public Pedigree pedigree(String pedigree) { + this.pedigree = pedigree; + return this; + } + + /** + * The string representation of the pedigree. + * @return pedigree + **/ + @Schema(description = "The string representation of the pedigree.") + public String getPedigree() { + return pedigree; + } + + public void setPedigree(String pedigree) { + this.pedigree = pedigree; + } + + public Pedigree siblings(List siblings) { + this.siblings = siblings; + return this; + } + + public Pedigree addSiblingsItem(PedigreeSiblings siblingsItem) { + if (this.siblings == null) { + this.siblings = new ArrayList(); + } + this.siblings.add(siblingsItem); + return this; + } + + /** + * List of sibling germplasm + * @return siblings + **/ + @Schema(description = "List of sibling germplasm ") + public List getSiblings() { + return siblings; + } + + public void setSiblings(List siblings) { + this.siblings = siblings; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pedigree pedigree = (Pedigree) o; + return Objects.equals(this.crossingPlan, pedigree.crossingPlan) && + Objects.equals(this.crossingYear, pedigree.crossingYear) && + Objects.equals(this.defaultDisplayName, pedigree.defaultDisplayName) && + Objects.equals(this.familyCode, pedigree.familyCode) && + Objects.equals(this.germplasmDbId, pedigree.germplasmDbId) && + Objects.equals(this.parent1DbId, pedigree.parent1DbId) && + Objects.equals(this.parent1Id, pedigree.parent1Id) && + Objects.equals(this.parent1Name, pedigree.parent1Name) && + Objects.equals(this.parent1Type, pedigree.parent1Type) && + Objects.equals(this.parent2DbId, pedigree.parent2DbId) && + Objects.equals(this.parent2Id, pedigree.parent2Id) && + Objects.equals(this.parent2Name, pedigree.parent2Name) && + Objects.equals(this.parent2Type, pedigree.parent2Type) && + Objects.equals(this.pedigree, pedigree.pedigree) && + Objects.equals(this.siblings, pedigree.siblings); + } + + @Override + public int hashCode() { + return Objects.hash(crossingPlan, crossingYear, defaultDisplayName, familyCode, germplasmDbId, parent1DbId, parent1Id, parent1Name, parent1Type, parent2DbId, parent2Id, parent2Name, parent2Type, pedigree, siblings); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pedigree {\n"); + + sb.append(" crossingPlan: ").append(toIndentedString(crossingPlan)).append("\n"); + sb.append(" crossingYear: ").append(toIndentedString(crossingYear)).append("\n"); + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" familyCode: ").append(toIndentedString(familyCode)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" parent1DbId: ").append(toIndentedString(parent1DbId)).append("\n"); + sb.append(" parent1Id: ").append(toIndentedString(parent1Id)).append("\n"); + sb.append(" parent1Name: ").append(toIndentedString(parent1Name)).append("\n"); + sb.append(" parent1Type: ").append(toIndentedString(parent1Type)).append("\n"); + sb.append(" parent2DbId: ").append(toIndentedString(parent2DbId)).append("\n"); + sb.append(" parent2Id: ").append(toIndentedString(parent2Id)).append("\n"); + sb.append(" parent2Name: ").append(toIndentedString(parent2Name)).append("\n"); + sb.append(" parent2Type: ").append(toIndentedString(parent2Type)).append("\n"); + sb.append(" pedigree: ").append(toIndentedString(pedigree)).append("\n"); + sb.append(" siblings: ").append(toIndentedString(siblings)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeResponse.java new file mode 100755 index 00000000..ecc911eb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Pedigree; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * PedigreeResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PedigreeResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Pedigree result = null; + + public PedigreeResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public PedigreeResponse result(Pedigree result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Pedigree getResult() { + return result; + } + + public void setResult(Pedigree result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PedigreeResponse pedigreeResponse = (PedigreeResponse) o; + return Objects.equals(this.metadata, pedigreeResponse.metadata) && + Objects.equals(this.result, pedigreeResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PedigreeResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeSiblings.java b/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeSiblings.java new file mode 100755 index 00000000..aabe85f3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PedigreeSiblings.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * PedigreeSiblings + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PedigreeSiblings { + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + public PedigreeSiblings defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * Get defaultDisplayName + * @return defaultDisplayName + **/ + @Schema(description = "") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public PedigreeSiblings germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * Get germplasmDbId + * @return germplasmDbId + **/ + @Schema(description = "") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PedigreeSiblings pedigreeSiblings = (PedigreeSiblings) o; + return Objects.equals(this.defaultDisplayName, pedigreeSiblings.defaultDisplayName) && + Objects.equals(this.germplasmDbId, pedigreeSiblings.germplasmDbId); + } + + @Override + public int hashCode() { + return Objects.hash(defaultDisplayName, germplasmDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PedigreeSiblings {\n"); + + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Person.java b/brapi-client/src/main/resources/swagger-generated-client/model/Person.java new file mode 100755 index 00000000..ef9af70d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Person.java @@ -0,0 +1,271 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Person + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Person { + @SerializedName("description") + private String description = null; + + @SerializedName("emailAddress") + private String emailAddress = null; + + @SerializedName("firstName") + private String firstName = null; + + @SerializedName("lastName") + private String lastName = null; + + @SerializedName("mailingAddress") + private String mailingAddress = null; + + @SerializedName("middleName") + private String middleName = null; + + @SerializedName("personDbId") + private String personDbId = null; + + @SerializedName("phoneNumber") + private String phoneNumber = null; + + @SerializedName("userID") + private String userID = null; + + public Person description(String description) { + this.description = description; + return this; + } + + /** + * description of this person + * @return description + **/ + @Schema(description = "description of this person") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Person emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * email address for this person + * @return emailAddress + **/ + @Schema(description = "email address for this person") + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public Person firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Persons first name + * @return firstName + **/ + @Schema(description = "Persons first name") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public Person lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Persons last name + * @return lastName + **/ + @Schema(description = "Persons last name") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Person mailingAddress(String mailingAddress) { + this.mailingAddress = mailingAddress; + return this; + } + + /** + * physical address of this person + * @return mailingAddress + **/ + @Schema(description = "physical address of this person") + public String getMailingAddress() { + return mailingAddress; + } + + public void setMailingAddress(String mailingAddress) { + this.mailingAddress = mailingAddress; + } + + public Person middleName(String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Persons middle name + * @return middleName + **/ + @Schema(description = "Persons middle name") + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public Person personDbId(String personDbId) { + this.personDbId = personDbId; + return this; + } + + /** + * Unique ID for this person + * @return personDbId + **/ + @Schema(required = true, description = "Unique ID for this person") + public String getPersonDbId() { + return personDbId; + } + + public void setPersonDbId(String personDbId) { + this.personDbId = personDbId; + } + + public Person phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * phone number of this person + * @return phoneNumber + **/ + @Schema(description = "phone number of this person") + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public Person userID(String userID) { + this.userID = userID; + return this; + } + + /** + * A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system. + * @return userID + **/ + @Schema(description = "A systems user ID ascociated with this person. Different from personDbId because you could have a person who is not a user of the system.") + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Person person = (Person) o; + return Objects.equals(this.description, person.description) && + Objects.equals(this.emailAddress, person.emailAddress) && + Objects.equals(this.firstName, person.firstName) && + Objects.equals(this.lastName, person.lastName) && + Objects.equals(this.mailingAddress, person.mailingAddress) && + Objects.equals(this.middleName, person.middleName) && + Objects.equals(this.personDbId, person.personDbId) && + Objects.equals(this.phoneNumber, person.phoneNumber) && + Objects.equals(this.userID, person.userID); + } + + @Override + public int hashCode() { + return Objects.hash(description, emailAddress, firstName, lastName, mailingAddress, middleName, personDbId, phoneNumber, userID); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Person {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" mailingAddress: ").append(toIndentedString(mailingAddress)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" personDbId: ").append(toIndentedString(personDbId)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PersonResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/PersonResponse.java new file mode 100755 index 00000000..510f44cb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PersonResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Person; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * PersonResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PersonResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Person result = null; + + public PersonResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public PersonResponse result(Person result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Person getResult() { + return result; + } + + public void setResult(Person result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonResponse personResponse = (PersonResponse) o; + return Objects.equals(this.metadata, personResponse.metadata) && + Objects.equals(this.result, personResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponse.java new file mode 100755 index 00000000..2953ca3f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.PersonsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * PersonsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PersonsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private PersonsResponseResult result = null; + + public PersonsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public PersonsResponse result(PersonsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public PersonsResponseResult getResult() { + return result; + } + + public void setResult(PersonsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonsResponse personsResponse = (PersonsResponse) o; + return Objects.equals(this.metadata, personsResponse.metadata) && + Objects.equals(this.result, personsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponseResult.java new file mode 100755 index 00000000..d3dd8103 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PersonsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Person; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * PersonsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PersonsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public PersonsResponseResult data(List data) { + this.data = data; + return this; + } + + public PersonsResponseResult addDataItem(Person dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Array of people + * @return data + **/ + @Schema(required = true, description = "Array of people") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonsResponseResult personsResponseResult = (PersonsResponseResult) o; + return Objects.equals(this.data, personsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequest.java new file mode 100755 index 00000000..ead65c30 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequest.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.PhenotypesRequestData; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * PhenotypesRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PhenotypesRequest { + @SerializedName("data") + private List data = null; + + public PhenotypesRequest data(List data) { + this.data = data; + return this; + } + + public PhenotypesRequest addDataItem(PhenotypesRequestData dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Matrix of observation data recorded for different observation variables across different observation units + * @return data + **/ + @Schema(description = "Matrix of observation data recorded for different observation variables across different observation units") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhenotypesRequest phenotypesRequest = (PhenotypesRequest) o; + return Objects.equals(this.data, phenotypesRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhenotypesRequest {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestData.java b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestData.java new file mode 100755 index 00000000..430040e4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestData.java @@ -0,0 +1,141 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.PhenotypesRequestObservation; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * new phenotypes + */ +@Schema(description = "new phenotypes") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PhenotypesRequestData { + @SerializedName("observatioUnitDbId") + private String observatioUnitDbId = null; + + @SerializedName("observations") + private List observations = new ArrayList(); + + @SerializedName("studyDbId") + private String studyDbId = null; + + public PhenotypesRequestData observatioUnitDbId(String observatioUnitDbId) { + this.observatioUnitDbId = observatioUnitDbId; + return this; + } + + /** + * Get observatioUnitDbId + * @return observatioUnitDbId + **/ + @Schema(required = true, description = "") + public String getObservatioUnitDbId() { + return observatioUnitDbId; + } + + public void setObservatioUnitDbId(String observatioUnitDbId) { + this.observatioUnitDbId = observatioUnitDbId; + } + + public PhenotypesRequestData observations(List observations) { + this.observations = observations; + return this; + } + + public PhenotypesRequestData addObservationsItem(PhenotypesRequestObservation observationsItem) { + this.observations.add(observationsItem); + return this; + } + + /** + * Get observations + * @return observations + **/ + @Schema(required = true, description = "") + public List getObservations() { + return observations; + } + + public void setObservations(List observations) { + this.observations = observations; + } + + public PhenotypesRequestData studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Get studyDbId + * @return studyDbId + **/ + @Schema(required = true, description = "") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhenotypesRequestData phenotypesRequestData = (PhenotypesRequestData) o; + return Objects.equals(this.observatioUnitDbId, phenotypesRequestData.observatioUnitDbId) && + Objects.equals(this.observations, phenotypesRequestData.observations) && + Objects.equals(this.studyDbId, phenotypesRequestData.studyDbId); + } + + @Override + public int hashCode() { + return Objects.hash(observatioUnitDbId, observations, studyDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhenotypesRequestData {\n"); + + sb.append(" observatioUnitDbId: ").append(toIndentedString(observatioUnitDbId)).append("\n"); + sb.append(" observations: ").append(toIndentedString(observations)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestObservation.java b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestObservation.java new file mode 100755 index 00000000..77b127c0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesRequestObservation.java @@ -0,0 +1,225 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * PhenotypesRequestObservation + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PhenotypesRequestObservation { + @SerializedName("collector") + private String collector = null; + + @SerializedName("observationDbId") + private String observationDbId = null; + + @SerializedName("observationTimeStamp") + private OffsetDateTime observationTimeStamp = null; + + @SerializedName("observationVariableDbId") + private String observationVariableDbId = null; + + @SerializedName("observationVariableName") + private String observationVariableName = null; + + @SerializedName("season") + private String season = null; + + @SerializedName("value") + private String value = null; + + public PhenotypesRequestObservation collector(String collector) { + this.collector = collector; + return this; + } + + /** + * The name or identifier of the entity which collected the observation + * @return collector + **/ + @Schema(required = true, description = "The name or identifier of the entity which collected the observation") + public String getCollector() { + return collector; + } + + public void setCollector(String collector) { + this.collector = collector; + } + + public PhenotypesRequestObservation observationDbId(String observationDbId) { + this.observationDbId = observationDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation + * @return observationDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation") + public String getObservationDbId() { + return observationDbId; + } + + public void setObservationDbId(String observationDbId) { + this.observationDbId = observationDbId; + } + + public PhenotypesRequestObservation observationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + return this; + } + + /** + * The date and time when this observation was made + * @return observationTimeStamp + **/ + @Schema(required = true, description = "The date and time when this observation was made ") + public OffsetDateTime getObservationTimeStamp() { + return observationTimeStamp; + } + + public void setObservationTimeStamp(OffsetDateTime observationTimeStamp) { + this.observationTimeStamp = observationTimeStamp; + } + + public PhenotypesRequestObservation observationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + return this; + } + + /** + * Variable unique identifier + * @return observationVariableDbId + **/ + @Schema(required = true, description = "Variable unique identifier") + public String getObservationVariableDbId() { + return observationVariableDbId; + } + + public void setObservationVariableDbId(String observationVariableDbId) { + this.observationVariableDbId = observationVariableDbId; + } + + public PhenotypesRequestObservation observationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + return this; + } + + /** + * A human readable name for an observation variable + * @return observationVariableName + **/ + @Schema(required = true, description = "A human readable name for an observation variable") + public String getObservationVariableName() { + return observationVariableName; + } + + public void setObservationVariableName(String observationVariableName) { + this.observationVariableName = observationVariableName; + } + + public PhenotypesRequestObservation season(String season) { + this.season = season; + return this; + } + + /** + * The season when the observation data was collected + * @return season + **/ + @Schema(description = "The season when the observation data was collected") + public String getSeason() { + return season; + } + + public void setSeason(String season) { + this.season = season; + } + + public PhenotypesRequestObservation value(String value) { + this.value = value; + return this; + } + + /** + * The value of the data collected as an observation + * @return value + **/ + @Schema(required = true, description = "The value of the data collected as an observation") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhenotypesRequestObservation phenotypesRequestObservation = (PhenotypesRequestObservation) o; + return Objects.equals(this.collector, phenotypesRequestObservation.collector) && + Objects.equals(this.observationDbId, phenotypesRequestObservation.observationDbId) && + Objects.equals(this.observationTimeStamp, phenotypesRequestObservation.observationTimeStamp) && + Objects.equals(this.observationVariableDbId, phenotypesRequestObservation.observationVariableDbId) && + Objects.equals(this.observationVariableName, phenotypesRequestObservation.observationVariableName) && + Objects.equals(this.season, phenotypesRequestObservation.season) && + Objects.equals(this.value, phenotypesRequestObservation.value); + } + + @Override + public int hashCode() { + return Objects.hash(collector, observationDbId, observationTimeStamp, observationVariableDbId, observationVariableName, season, value); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhenotypesRequestObservation {\n"); + + sb.append(" collector: ").append(toIndentedString(collector)).append("\n"); + sb.append(" observationDbId: ").append(toIndentedString(observationDbId)).append("\n"); + sb.append(" observationTimeStamp: ").append(toIndentedString(observationTimeStamp)).append("\n"); + sb.append(" observationVariableDbId: ").append(toIndentedString(observationVariableDbId)).append("\n"); + sb.append(" observationVariableName: ").append(toIndentedString(observationVariableName)).append("\n"); + sb.append(" season: ").append(toIndentedString(season)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesSearchRequest.java new file mode 100755 index 00000000..67a06df6 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PhenotypesSearchRequest.java @@ -0,0 +1,399 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.OffsetDateTime; +/** + * PhenotypesSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class PhenotypesSearchRequest { + @SerializedName("germplasmDbIds") + private List germplasmDbIds = null; + + @SerializedName("locationDbIds") + private List locationDbIds = null; + + @SerializedName("observationLevel") + private String observationLevel = null; + + @SerializedName("observationTimeStampRangeEnd") + private OffsetDateTime observationTimeStampRangeEnd = null; + + @SerializedName("observationTimeStampRangeStart") + private OffsetDateTime observationTimeStampRangeStart = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("programDbIds") + private List programDbIds = null; + + @SerializedName("seasonDbIds") + private List seasonDbIds = null; + + @SerializedName("studyDbIds") + private List studyDbIds = null; + + @SerializedName("trialDbIds") + private List trialDbIds = null; + + public PhenotypesSearchRequest germplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + return this; + } + + public PhenotypesSearchRequest addGermplasmDbIdsItem(String germplasmDbIdsItem) { + if (this.germplasmDbIds == null) { + this.germplasmDbIds = new ArrayList(); + } + this.germplasmDbIds.add(germplasmDbIdsItem); + return this; + } + + /** + * The name or synonym of external genebank accession identifiers + * @return germplasmDbIds + **/ + @Schema(description = "The name or synonym of external genebank accession identifiers") + public List getGermplasmDbIds() { + return germplasmDbIds; + } + + public void setGermplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + } + + public PhenotypesSearchRequest locationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + return this; + } + + public PhenotypesSearchRequest addLocationDbIdsItem(String locationDbIdsItem) { + if (this.locationDbIds == null) { + this.locationDbIds = new ArrayList(); + } + this.locationDbIds.add(locationDbIdsItem); + return this; + } + + /** + * locations these traits were collected + * @return locationDbIds + **/ + @Schema(description = "locations these traits were collected") + public List getLocationDbIds() { + return locationDbIds; + } + + public void setLocationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + } + + public PhenotypesSearchRequest observationLevel(String observationLevel) { + this.observationLevel = observationLevel; + return this; + } + + /** + * The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnit Structure. + * @return observationLevel + **/ + @Schema(description = "The type of the observationUnit. Returns only the observation unit of the specified type; the parent levels ID can be accessed through observationUnit Structure.") + public String getObservationLevel() { + return observationLevel; + } + + public void setObservationLevel(String observationLevel) { + this.observationLevel = observationLevel; + } + + public PhenotypesSearchRequest observationTimeStampRangeEnd(OffsetDateTime observationTimeStampRangeEnd) { + this.observationTimeStampRangeEnd = observationTimeStampRangeEnd; + return this; + } + + /** + * Timestamp range end + * @return observationTimeStampRangeEnd + **/ + @Schema(description = "Timestamp range end") + public OffsetDateTime getObservationTimeStampRangeEnd() { + return observationTimeStampRangeEnd; + } + + public void setObservationTimeStampRangeEnd(OffsetDateTime observationTimeStampRangeEnd) { + this.observationTimeStampRangeEnd = observationTimeStampRangeEnd; + } + + public PhenotypesSearchRequest observationTimeStampRangeStart(OffsetDateTime observationTimeStampRangeStart) { + this.observationTimeStampRangeStart = observationTimeStampRangeStart; + return this; + } + + /** + * Timestamp range start + * @return observationTimeStampRangeStart + **/ + @Schema(description = "Timestamp range start") + public OffsetDateTime getObservationTimeStampRangeStart() { + return observationTimeStampRangeStart; + } + + public void setObservationTimeStampRangeStart(OffsetDateTime observationTimeStampRangeStart) { + this.observationTimeStampRangeStart = observationTimeStampRangeStart; + } + + public PhenotypesSearchRequest observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public PhenotypesSearchRequest addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * The IDs of traits, could be ontology ID, database ID or PUI + * @return observationVariableDbIds + **/ + @Schema(description = "The IDs of traits, could be ontology ID, database ID or PUI") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public PhenotypesSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public PhenotypesSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public PhenotypesSearchRequest programDbIds(List programDbIds) { + this.programDbIds = programDbIds; + return this; + } + + public PhenotypesSearchRequest addProgramDbIdsItem(String programDbIdsItem) { + if (this.programDbIds == null) { + this.programDbIds = new ArrayList(); + } + this.programDbIds.add(programDbIdsItem); + return this; + } + + /** + * list of programs to search across + * @return programDbIds + **/ + @Schema(description = "list of programs to search across") + public List getProgramDbIds() { + return programDbIds; + } + + public void setProgramDbIds(List programDbIds) { + this.programDbIds = programDbIds; + } + + public PhenotypesSearchRequest seasonDbIds(List seasonDbIds) { + this.seasonDbIds = seasonDbIds; + return this; + } + + public PhenotypesSearchRequest addSeasonDbIdsItem(String seasonDbIdsItem) { + if (this.seasonDbIds == null) { + this.seasonDbIds = new ArrayList(); + } + this.seasonDbIds.add(seasonDbIdsItem); + return this; + } + + /** + * The year or Phenotyping campaign of a multi-annual study (trees, grape, ...) + * @return seasonDbIds + **/ + @Schema(description = "The year or Phenotyping campaign of a multi-annual study (trees, grape, ...)") + public List getSeasonDbIds() { + return seasonDbIds; + } + + public void setSeasonDbIds(List seasonDbIds) { + this.seasonDbIds = seasonDbIds; + } + + public PhenotypesSearchRequest studyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + return this; + } + + public PhenotypesSearchRequest addStudyDbIdsItem(String studyDbIdsItem) { + if (this.studyDbIds == null) { + this.studyDbIds = new ArrayList(); + } + this.studyDbIds.add(studyDbIdsItem); + return this; + } + + /** + * The database ID / PK of the studies search parameter + * @return studyDbIds + **/ + @Schema(description = "The database ID / PK of the studies search parameter") + public List getStudyDbIds() { + return studyDbIds; + } + + public void setStudyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + } + + public PhenotypesSearchRequest trialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + return this; + } + + public PhenotypesSearchRequest addTrialDbIdsItem(String trialDbIdsItem) { + if (this.trialDbIds == null) { + this.trialDbIds = new ArrayList(); + } + this.trialDbIds.add(trialDbIdsItem); + return this; + } + + /** + * list of trials to search across + * @return trialDbIds + **/ + @Schema(description = "list of trials to search across") + public List getTrialDbIds() { + return trialDbIds; + } + + public void setTrialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhenotypesSearchRequest phenotypesSearchRequest = (PhenotypesSearchRequest) o; + return Objects.equals(this.germplasmDbIds, phenotypesSearchRequest.germplasmDbIds) && + Objects.equals(this.locationDbIds, phenotypesSearchRequest.locationDbIds) && + Objects.equals(this.observationLevel, phenotypesSearchRequest.observationLevel) && + Objects.equals(this.observationTimeStampRangeEnd, phenotypesSearchRequest.observationTimeStampRangeEnd) && + Objects.equals(this.observationTimeStampRangeStart, phenotypesSearchRequest.observationTimeStampRangeStart) && + Objects.equals(this.observationVariableDbIds, phenotypesSearchRequest.observationVariableDbIds) && + Objects.equals(this.page, phenotypesSearchRequest.page) && + Objects.equals(this.pageSize, phenotypesSearchRequest.pageSize) && + Objects.equals(this.programDbIds, phenotypesSearchRequest.programDbIds) && + Objects.equals(this.seasonDbIds, phenotypesSearchRequest.seasonDbIds) && + Objects.equals(this.studyDbIds, phenotypesSearchRequest.studyDbIds) && + Objects.equals(this.trialDbIds, phenotypesSearchRequest.trialDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbIds, locationDbIds, observationLevel, observationTimeStampRangeEnd, observationTimeStampRangeStart, observationVariableDbIds, page, pageSize, programDbIds, seasonDbIds, studyDbIds, trialDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhenotypesSearchRequest {\n"); + + sb.append(" germplasmDbIds: ").append(toIndentedString(germplasmDbIds)).append("\n"); + sb.append(" locationDbIds: ").append(toIndentedString(locationDbIds)).append("\n"); + sb.append(" observationLevel: ").append(toIndentedString(observationLevel)).append("\n"); + sb.append(" observationTimeStampRangeEnd: ").append(toIndentedString(observationTimeStampRangeEnd)).append("\n"); + sb.append(" observationTimeStampRangeStart: ").append(toIndentedString(observationTimeStampRangeStart)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" programDbIds: ").append(toIndentedString(programDbIds)).append("\n"); + sb.append(" seasonDbIds: ").append(toIndentedString(seasonDbIds)).append("\n"); + sb.append(" studyDbIds: ").append(toIndentedString(studyDbIds)).append("\n"); + sb.append(" trialDbIds: ").append(toIndentedString(trialDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/PlateFormat.java b/brapi-client/src/main/resources/swagger-generated-client/model/PlateFormat.java new file mode 100755 index 00000000..99509e27 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/PlateFormat.java @@ -0,0 +1,67 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enum for plate formats, usually \"PLATE_96\" for a 96 well plate or \"TUBES\" for plateless format + */ +@JsonAdapter(PlateFormat.Adapter.class) +public enum PlateFormat { + PLATE_96("PLATE_96"), + TUBES("TUBES"); + + private String value; + + PlateFormat(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlateFormat fromValue(String text) { + for (PlateFormat b : PlateFormat.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlateFormat enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlateFormat read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlateFormat.fromValue(String.valueOf(value)); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Polygon.java b/brapi-client/src/main/resources/swagger-generated-client/model/Polygon.java new file mode 100755 index 00000000..e38e4e44 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Polygon.java @@ -0,0 +1,65 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import io.swagger.client.model.LinearRing; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; + +/** + * An array of linear rings + */ +@Schema(description = "An array of linear rings") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Polygon extends ArrayList { + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Polygon {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Position.java b/brapi-client/src/main/resources/swagger-generated-client/model/Position.java new file mode 100755 index 00000000..8a2176a9 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Position.java @@ -0,0 +1,65 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +/** + * A single position + */ +@Schema(description = "A single position") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Position extends ArrayList { + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Position {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Progeny.java b/brapi-client/src/main/resources/swagger-generated-client/model/Progeny.java new file mode 100755 index 00000000..57bb9156 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Progeny.java @@ -0,0 +1,144 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ProgenyProgeny; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Progeny + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Progeny { + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("progeny") + private List progeny = null; + + public Progeny defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * A human readable name for a germplasm + * @return defaultDisplayName + **/ + @Schema(description = "A human readable name for a germplasm") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public Progeny germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = "The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public Progeny progeny(List progeny) { + this.progeny = progeny; + return this; + } + + public Progeny addProgenyItem(ProgenyProgeny progenyItem) { + if (this.progeny == null) { + this.progeny = new ArrayList(); + } + this.progeny.add(progenyItem); + return this; + } + + /** + * List of germplasm entities which are direct children of this germplasm + * @return progeny + **/ + @Schema(description = "List of germplasm entities which are direct children of this germplasm") + public List getProgeny() { + return progeny; + } + + public void setProgeny(List progeny) { + this.progeny = progeny; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Progeny progeny = (Progeny) o; + return Objects.equals(this.defaultDisplayName, progeny.defaultDisplayName) && + Objects.equals(this.germplasmDbId, progeny.germplasmDbId) && + Objects.equals(this.progeny, progeny.progeny); + } + + @Override + public int hashCode() { + return Objects.hash(defaultDisplayName, germplasmDbId, progeny); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Progeny {\n"); + + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" progeny: ").append(toIndentedString(progeny)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyProgeny.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyProgeny.java new file mode 100755 index 00000000..19554d1f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyProgeny.java @@ -0,0 +1,180 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * ProgenyProgeny + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgenyProgeny { + @SerializedName("defaultDisplayName") + private String defaultDisplayName = null; + + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + /** + * Given a germplasm A having a progeny B and C, 'parentType' for progeny B item refers to the 'parentType' of A toward B. + */ + @JsonAdapter(ParentTypeEnum.Adapter.class) + public enum ParentTypeEnum { + MALE("MALE"), + FEMALE("FEMALE"), + SELF("SELF"), + POPULATION("POPULATION"); + + private String value; + + ParentTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static ParentTypeEnum fromValue(String text) { + for (ParentTypeEnum b : ParentTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ParentTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ParentTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ParentTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("parentType") + private ParentTypeEnum parentType = null; + + public ProgenyProgeny defaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + return this; + } + + /** + * The human readable name of a progeny germplasm + * @return defaultDisplayName + **/ + @Schema(description = "The human readable name of a progeny germplasm") + public String getDefaultDisplayName() { + return defaultDisplayName; + } + + public void setDefaultDisplayName(String defaultDisplayName) { + this.defaultDisplayName = defaultDisplayName; + } + + public ProgenyProgeny germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The unique identifier of a progeny germplasm + * @return germplasmDbId + **/ + @Schema(description = "The unique identifier of a progeny germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public ProgenyProgeny parentType(ParentTypeEnum parentType) { + this.parentType = parentType; + return this; + } + + /** + * Given a germplasm A having a progeny B and C, 'parentType' for progeny B item refers to the 'parentType' of A toward B. + * @return parentType + **/ + @Schema(description = "Given a germplasm A having a progeny B and C, 'parentType' for progeny B item refers to the 'parentType' of A toward B.") + public ParentTypeEnum getParentType() { + return parentType; + } + + public void setParentType(ParentTypeEnum parentType) { + this.parentType = parentType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgenyProgeny progenyProgeny = (ProgenyProgeny) o; + return Objects.equals(this.defaultDisplayName, progenyProgeny.defaultDisplayName) && + Objects.equals(this.germplasmDbId, progenyProgeny.germplasmDbId) && + Objects.equals(this.parentType, progenyProgeny.parentType); + } + + @Override + public int hashCode() { + return Objects.hash(defaultDisplayName, germplasmDbId, parentType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgenyProgeny {\n"); + + sb.append(" defaultDisplayName: ").append(toIndentedString(defaultDisplayName)).append("\n"); + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" parentType: ").append(toIndentedString(parentType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyResponse.java new file mode 100755 index 00000000..b67f2c0d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgenyResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Progeny; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ProgenyResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgenyResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Progeny result = null; + + public ProgenyResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ProgenyResponse result(Progeny result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Progeny getResult() { + return result; + } + + public void setResult(Progeny result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgenyResponse progenyResponse = (ProgenyResponse) o; + return Objects.equals(this.metadata, progenyResponse.metadata) && + Objects.equals(this.result, progenyResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgenyResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Program.java b/brapi-client/src/main/resources/swagger-generated-client/model/Program.java new file mode 100755 index 00000000..49b6c4c3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Program.java @@ -0,0 +1,294 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Program + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Program { + @SerializedName("abbreviation") + private String abbreviation = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("leadPerson") + private String leadPerson = null; + + @SerializedName("leadPersonDbId") + private String leadPersonDbId = null; + + @SerializedName("leadPersonName") + private String leadPersonName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("objective") + private String objective = null; + + @SerializedName("programDbId") + private String programDbId = null; + + @SerializedName("programName") + private String programName = null; + + public Program abbreviation(String abbreviation) { + this.abbreviation = abbreviation; + return this; + } + + /** + * An abbreviation which represnts this program + * @return abbreviation + **/ + @Schema(description = "An abbreviation which represnts this program") + public String getAbbreviation() { + return abbreviation; + } + + public void setAbbreviation(String abbreviation) { + this.abbreviation = abbreviation; + } + + public Program commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop which this program is for + * @return commonCropName + **/ + @Schema(description = "Common name for the crop which this program is for") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public Program documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Program leadPerson(String leadPerson) { + this.leadPerson = leadPerson; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"leadPersonName\" or \"leadPersonDbId\" + * @return leadPerson + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"leadPersonName\" or \"leadPersonDbId\"") + public String getLeadPerson() { + return leadPerson; + } + + public void setLeadPerson(String leadPerson) { + this.leadPerson = leadPerson; + } + + public Program leadPersonDbId(String leadPersonDbId) { + this.leadPersonDbId = leadPersonDbId; + return this; + } + + /** + * The unique identifier of the program leader + * @return leadPersonDbId + **/ + @Schema(description = "The unique identifier of the program leader") + public String getLeadPersonDbId() { + return leadPersonDbId; + } + + public void setLeadPersonDbId(String leadPersonDbId) { + this.leadPersonDbId = leadPersonDbId; + } + + public Program leadPersonName(String leadPersonName) { + this.leadPersonName = leadPersonName; + return this; + } + + /** + * The name of the program leader + * @return leadPersonName + **/ + @Schema(description = "The name of the program leader") + public String getLeadPersonName() { + return leadPersonName; + } + + public void setLeadPersonName(String leadPersonName) { + this.leadPersonName = leadPersonName; + } + + public Program name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"programName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"programName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Program objective(String objective) { + this.objective = objective; + return this; + } + + /** + * The primary objective of the program + * @return objective + **/ + @Schema(description = "The primary objective of the program") + public String getObjective() { + return objective; + } + + public void setObjective(String objective) { + this.objective = objective; + } + + public Program programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * The ID which uniquely identifies the program + * @return programDbId + **/ + @Schema(description = "The ID which uniquely identifies the program") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + public Program programName(String programName) { + this.programName = programName; + return this; + } + + /** + * Human readable name of the program + * @return programName + **/ + @Schema(description = "Human readable name of the program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Program program = (Program) o; + return Objects.equals(this.abbreviation, program.abbreviation) && + Objects.equals(this.commonCropName, program.commonCropName) && + Objects.equals(this.documentationURL, program.documentationURL) && + Objects.equals(this.leadPerson, program.leadPerson) && + Objects.equals(this.leadPersonDbId, program.leadPersonDbId) && + Objects.equals(this.leadPersonName, program.leadPersonName) && + Objects.equals(this.name, program.name) && + Objects.equals(this.objective, program.objective) && + Objects.equals(this.programDbId, program.programDbId) && + Objects.equals(this.programName, program.programName); + } + + @Override + public int hashCode() { + return Objects.hash(abbreviation, commonCropName, documentationURL, leadPerson, leadPersonDbId, leadPersonName, name, objective, programDbId, programName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Program {\n"); + + sb.append(" abbreviation: ").append(toIndentedString(abbreviation)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" leadPerson: ").append(toIndentedString(leadPerson)).append("\n"); + sb.append(" leadPersonDbId: ").append(toIndentedString(leadPersonDbId)).append("\n"); + sb.append(" leadPersonName: ").append(toIndentedString(leadPersonName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" objective: ").append(toIndentedString(objective)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse.java new file mode 100755 index 00000000..a85dd416 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ProgramsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ProgramsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ProgramsResponseResult result = null; + + public ProgramsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ProgramsResponse result(ProgramsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ProgramsResponseResult getResult() { + return result; + } + + public void setResult(ProgramsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsResponse programsResponse = (ProgramsResponse) o; + return Objects.equals(this.metadata, programsResponse.metadata) && + Objects.equals(this.result, programsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1.java new file mode 100755 index 00000000..67127177 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ProgramsResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ProgramsResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ProgramsResponse1Result result = null; + + public ProgramsResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ProgramsResponse1 result(ProgramsResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public ProgramsResponse1Result getResult() { + return result; + } + + public void setResult(ProgramsResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsResponse1 programsResponse1 = (ProgramsResponse1) o; + return Objects.equals(this.metadata, programsResponse1.metadata) && + Objects.equals(this.result, programsResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1Result.java new file mode 100755 index 00000000..3da1e198 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Program; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ProgramsResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsResponse1Result { + @SerializedName("data") + private List data = null; + + public ProgramsResponse1Result data(List data) { + this.data = data; + return this; + } + + public ProgramsResponse1Result addDataItem(Program dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsResponse1Result programsResponse1Result = (ProgramsResponse1Result) o; + return Objects.equals(this.data, programsResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponseResult.java new file mode 100755 index 00000000..d5a5d1c1 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Program; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ProgramsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ProgramsResponseResult data(List data) { + this.data = data; + return this; + } + + public ProgramsResponseResult addDataItem(Program dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsResponseResult programsResponseResult = (ProgramsResponseResult) o; + return Objects.equals(this.data, programsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequest.java new file mode 100755 index 00000000..a918339c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequest.java @@ -0,0 +1,329 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ProgramsSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsSearchRequest { + @SerializedName("abbreviations") + private List abbreviations = null; + + @SerializedName("commonCropNames") + private List commonCropNames = null; + + @SerializedName("leadPersonDbIds") + private List leadPersonDbIds = null; + + @SerializedName("leadPersonNames") + private List leadPersonNames = null; + + @SerializedName("objectives") + private List objectives = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("programDbIds") + private List programDbIds = null; + + @SerializedName("programNames") + private List programNames = null; + + public ProgramsSearchRequest abbreviations(List abbreviations) { + this.abbreviations = abbreviations; + return this; + } + + public ProgramsSearchRequest addAbbreviationsItem(String abbreviationsItem) { + if (this.abbreviations == null) { + this.abbreviations = new ArrayList(); + } + this.abbreviations.add(abbreviationsItem); + return this; + } + + /** + * An abbreviation of a program to search for + * @return abbreviations + **/ + @Schema(description = "An abbreviation of a program to search for") + public List getAbbreviations() { + return abbreviations; + } + + public void setAbbreviations(List abbreviations) { + this.abbreviations = abbreviations; + } + + public ProgramsSearchRequest commonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + return this; + } + + public ProgramsSearchRequest addCommonCropNamesItem(String commonCropNamesItem) { + if (this.commonCropNames == null) { + this.commonCropNames = new ArrayList(); + } + this.commonCropNames.add(commonCropNamesItem); + return this; + } + + /** + * Common name for the crop which this program is for + * @return commonCropNames + **/ + @Schema(description = "Common name for the crop which this program is for") + public List getCommonCropNames() { + return commonCropNames; + } + + public void setCommonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + } + + public ProgramsSearchRequest leadPersonDbIds(List leadPersonDbIds) { + this.leadPersonDbIds = leadPersonDbIds; + return this; + } + + public ProgramsSearchRequest addLeadPersonDbIdsItem(String leadPersonDbIdsItem) { + if (this.leadPersonDbIds == null) { + this.leadPersonDbIds = new ArrayList(); + } + this.leadPersonDbIds.add(leadPersonDbIdsItem); + return this; + } + + /** + * The person DbIds of the program leader to search for + * @return leadPersonDbIds + **/ + @Schema(description = "The person DbIds of the program leader to search for") + public List getLeadPersonDbIds() { + return leadPersonDbIds; + } + + public void setLeadPersonDbIds(List leadPersonDbIds) { + this.leadPersonDbIds = leadPersonDbIds; + } + + public ProgramsSearchRequest leadPersonNames(List leadPersonNames) { + this.leadPersonNames = leadPersonNames; + return this; + } + + public ProgramsSearchRequest addLeadPersonNamesItem(String leadPersonNamesItem) { + if (this.leadPersonNames == null) { + this.leadPersonNames = new ArrayList(); + } + this.leadPersonNames.add(leadPersonNamesItem); + return this; + } + + /** + * The names of the program leader to search for + * @return leadPersonNames + **/ + @Schema(description = "The names of the program leader to search for") + public List getLeadPersonNames() { + return leadPersonNames; + } + + public void setLeadPersonNames(List leadPersonNames) { + this.leadPersonNames = leadPersonNames; + } + + public ProgramsSearchRequest objectives(List objectives) { + this.objectives = objectives; + return this; + } + + public ProgramsSearchRequest addObjectivesItem(String objectivesItem) { + if (this.objectives == null) { + this.objectives = new ArrayList(); + } + this.objectives.add(objectivesItem); + return this; + } + + /** + * A program objective to search for + * @return objectives + **/ + @Schema(description = "A program objective to search for") + public List getObjectives() { + return objectives; + } + + public void setObjectives(List objectives) { + this.objectives = objectives; + } + + public ProgramsSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public ProgramsSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public ProgramsSearchRequest programDbIds(List programDbIds) { + this.programDbIds = programDbIds; + return this; + } + + public ProgramsSearchRequest addProgramDbIdsItem(String programDbIdsItem) { + if (this.programDbIds == null) { + this.programDbIds = new ArrayList(); + } + this.programDbIds.add(programDbIdsItem); + return this; + } + + /** + * A program identifier to search for + * @return programDbIds + **/ + @Schema(description = "A program identifier to search for") + public List getProgramDbIds() { + return programDbIds; + } + + public void setProgramDbIds(List programDbIds) { + this.programDbIds = programDbIds; + } + + public ProgramsSearchRequest programNames(List programNames) { + this.programNames = programNames; + return this; + } + + public ProgramsSearchRequest addProgramNamesItem(String programNamesItem) { + if (this.programNames == null) { + this.programNames = new ArrayList(); + } + this.programNames.add(programNamesItem); + return this; + } + + /** + * A name of a program to search for + * @return programNames + **/ + @Schema(description = "A name of a program to search for") + public List getProgramNames() { + return programNames; + } + + public void setProgramNames(List programNames) { + this.programNames = programNames; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsSearchRequest programsSearchRequest = (ProgramsSearchRequest) o; + return Objects.equals(this.abbreviations, programsSearchRequest.abbreviations) && + Objects.equals(this.commonCropNames, programsSearchRequest.commonCropNames) && + Objects.equals(this.leadPersonDbIds, programsSearchRequest.leadPersonDbIds) && + Objects.equals(this.leadPersonNames, programsSearchRequest.leadPersonNames) && + Objects.equals(this.objectives, programsSearchRequest.objectives) && + Objects.equals(this.page, programsSearchRequest.page) && + Objects.equals(this.pageSize, programsSearchRequest.pageSize) && + Objects.equals(this.programDbIds, programsSearchRequest.programDbIds) && + Objects.equals(this.programNames, programsSearchRequest.programNames); + } + + @Override + public int hashCode() { + return Objects.hash(abbreviations, commonCropNames, leadPersonDbIds, leadPersonNames, objectives, page, pageSize, programDbIds, programNames); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsSearchRequest {\n"); + + sb.append(" abbreviations: ").append(toIndentedString(abbreviations)).append("\n"); + sb.append(" commonCropNames: ").append(toIndentedString(commonCropNames)).append("\n"); + sb.append(" leadPersonDbIds: ").append(toIndentedString(leadPersonDbIds)).append("\n"); + sb.append(" leadPersonNames: ").append(toIndentedString(leadPersonNames)).append("\n"); + sb.append(" objectives: ").append(toIndentedString(objectives)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" programDbIds: ").append(toIndentedString(programDbIds)).append("\n"); + sb.append(" programNames: ").append(toIndentedString(programNames)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequestDeprecated.java b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequestDeprecated.java new file mode 100755 index 00000000..effc9ffb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ProgramsSearchRequestDeprecated.java @@ -0,0 +1,225 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ProgramsSearchRequestDeprecated + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ProgramsSearchRequestDeprecated { + @SerializedName("abbreviation") + private String abbreviation = null; + + @SerializedName("leadPerson") + private String leadPerson = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("objective") + private String objective = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("programDbId") + private String programDbId = null; + + public ProgramsSearchRequestDeprecated abbreviation(String abbreviation) { + this.abbreviation = abbreviation; + return this; + } + + /** + * An abbreviation of a program to search for + * @return abbreviation + **/ + @Schema(description = "An abbreviation of a program to search for") + public String getAbbreviation() { + return abbreviation; + } + + public void setAbbreviation(String abbreviation) { + this.abbreviation = abbreviation; + } + + public ProgramsSearchRequestDeprecated leadPerson(String leadPerson) { + this.leadPerson = leadPerson; + return this; + } + + /** + * The name or identifier of the program leader to search for + * @return leadPerson + **/ + @Schema(description = "The name or identifier of the program leader to search for") + public String getLeadPerson() { + return leadPerson; + } + + public void setLeadPerson(String leadPerson) { + this.leadPerson = leadPerson; + } + + public ProgramsSearchRequestDeprecated name(String name) { + this.name = name; + return this; + } + + /** + * A name of a program to search for + * @return name + **/ + @Schema(description = "A name of a program to search for") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProgramsSearchRequestDeprecated objective(String objective) { + this.objective = objective; + return this; + } + + /** + * A program objective to search for + * @return objective + **/ + @Schema(description = "A program objective to search for") + public String getObjective() { + return objective; + } + + public void setObjective(String objective) { + this.objective = objective; + } + + public ProgramsSearchRequestDeprecated page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public ProgramsSearchRequestDeprecated pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public ProgramsSearchRequestDeprecated programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * A program identifier to search for + * @return programDbId + **/ + @Schema(description = "A program identifier to search for") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProgramsSearchRequestDeprecated programsSearchRequestDeprecated = (ProgramsSearchRequestDeprecated) o; + return Objects.equals(this.abbreviation, programsSearchRequestDeprecated.abbreviation) && + Objects.equals(this.leadPerson, programsSearchRequestDeprecated.leadPerson) && + Objects.equals(this.name, programsSearchRequestDeprecated.name) && + Objects.equals(this.objective, programsSearchRequestDeprecated.objective) && + Objects.equals(this.page, programsSearchRequestDeprecated.page) && + Objects.equals(this.pageSize, programsSearchRequestDeprecated.pageSize) && + Objects.equals(this.programDbId, programsSearchRequestDeprecated.programDbId); + } + + @Override + public int hashCode() { + return Objects.hash(abbreviation, leadPerson, name, objective, page, pageSize, programDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProgramsSearchRequestDeprecated {\n"); + + sb.append(" abbreviation: ").append(toIndentedString(abbreviation)).append("\n"); + sb.append(" leadPerson: ").append(toIndentedString(leadPerson)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" objective: ").append(toIndentedString(objective)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Sample.java b/brapi-client/src/main/resources/swagger-generated-client/model/Sample.java new file mode 100755 index 00000000..ad2f3db8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Sample.java @@ -0,0 +1,363 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * Sample + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Sample { + @SerializedName("germplasmDbId") + private String germplasmDbId = null; + + @SerializedName("notes") + private String notes = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("plantDbId") + private String plantDbId = null; + + @SerializedName("plateDbId") + private String plateDbId = null; + + @SerializedName("plateIndex") + private Integer plateIndex = null; + + @SerializedName("plotDbId") + private String plotDbId = null; + + @SerializedName("sampleDbId") + private String sampleDbId = null; + + @SerializedName("sampleTimestamp") + private OffsetDateTime sampleTimestamp = null; + + @SerializedName("sampleType") + private String sampleType = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("takenBy") + private String takenBy = null; + + @SerializedName("tissueType") + private String tissueType = null; + + public Sample germplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public String getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(String germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public Sample notes(String notes) { + this.notes = notes; + return this; + } + + /** + * Additional notes about a samle + * @return notes + **/ + @Schema(description = "Additional notes about a samle") + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public Sample observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public Sample plantDbId(String plantDbId) { + this.plantDbId = plantDbId; + return this; + } + + /** + * The ID which uniquely identifies a plant. Usually 'plantNumber' + * @return plantDbId + **/ + @Schema(description = "The ID which uniquely identifies a plant. Usually 'plantNumber'") + public String getPlantDbId() { + return plantDbId; + } + + public void setPlantDbId(String plantDbId) { + this.plantDbId = plantDbId; + } + + public Sample plateDbId(String plateDbId) { + this.plateDbId = plateDbId; + return this; + } + + /** + * The ID which uniquely identifies a plate of samples + * @return plateDbId + **/ + @Schema(description = "The ID which uniquely identifies a plate of samples") + public String getPlateDbId() { + return plateDbId; + } + + public void setPlateDbId(String plateDbId) { + this.plateDbId = plateDbId; + } + + public Sample plateIndex(Integer plateIndex) { + this.plateIndex = plateIndex; + return this; + } + + /** + * The index number of this sample on a plate + * @return plateIndex + **/ + @Schema(description = "The index number of this sample on a plate") + public Integer getPlateIndex() { + return plateIndex; + } + + public void setPlateIndex(Integer plateIndex) { + this.plateIndex = plateIndex; + } + + public Sample plotDbId(String plotDbId) { + this.plotDbId = plotDbId; + return this; + } + + /** + * The ID which uniquely identifies a plot. Usually 'plotNumber' + * @return plotDbId + **/ + @Schema(description = " The ID which uniquely identifies a plot. Usually 'plotNumber'") + public String getPlotDbId() { + return plotDbId; + } + + public void setPlotDbId(String plotDbId) { + this.plotDbId = plotDbId; + } + + public Sample sampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + return this; + } + + /** + * The ID which uniquely identifies a sample + * @return sampleDbId + **/ + @Schema(description = "The ID which uniquely identifies a sample") + public String getSampleDbId() { + return sampleDbId; + } + + public void setSampleDbId(String sampleDbId) { + this.sampleDbId = sampleDbId; + } + + public Sample sampleTimestamp(OffsetDateTime sampleTimestamp) { + this.sampleTimestamp = sampleTimestamp; + return this; + } + + /** + * The date and time a sample was collected from the field + * @return sampleTimestamp + **/ + @Schema(description = "The date and time a sample was collected from the field") + public OffsetDateTime getSampleTimestamp() { + return sampleTimestamp; + } + + public void setSampleTimestamp(OffsetDateTime sampleTimestamp) { + this.sampleTimestamp = sampleTimestamp; + } + + public Sample sampleType(String sampleType) { + this.sampleType = sampleType; + return this; + } + + /** + * The type of sample taken. ex. 'DNA', 'RNA', 'Tissue', etc + * @return sampleType + **/ + @Schema(description = "The type of sample taken. ex. 'DNA', 'RNA', 'Tissue', etc ") + public String getSampleType() { + return sampleType; + } + + public void setSampleType(String sampleType) { + this.sampleType = sampleType; + } + + public Sample studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public Sample takenBy(String takenBy) { + this.takenBy = takenBy; + return this; + } + + /** + * The name or identifier of the entity which took the sample from the field + * @return takenBy + **/ + @Schema(description = "The name or identifier of the entity which took the sample from the field") + public String getTakenBy() { + return takenBy; + } + + public void setTakenBy(String takenBy) { + this.takenBy = takenBy; + } + + public Sample tissueType(String tissueType) { + this.tissueType = tissueType; + return this; + } + + /** + * The type of tissue sampled. ex. 'Leaf', 'Root', etc. + * @return tissueType + **/ + @Schema(description = "The type of tissue sampled. ex. 'Leaf', 'Root', etc.") + public String getTissueType() { + return tissueType; + } + + public void setTissueType(String tissueType) { + this.tissueType = tissueType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Sample sample = (Sample) o; + return Objects.equals(this.germplasmDbId, sample.germplasmDbId) && + Objects.equals(this.notes, sample.notes) && + Objects.equals(this.observationUnitDbId, sample.observationUnitDbId) && + Objects.equals(this.plantDbId, sample.plantDbId) && + Objects.equals(this.plateDbId, sample.plateDbId) && + Objects.equals(this.plateIndex, sample.plateIndex) && + Objects.equals(this.plotDbId, sample.plotDbId) && + Objects.equals(this.sampleDbId, sample.sampleDbId) && + Objects.equals(this.sampleTimestamp, sample.sampleTimestamp) && + Objects.equals(this.sampleType, sample.sampleType) && + Objects.equals(this.studyDbId, sample.studyDbId) && + Objects.equals(this.takenBy, sample.takenBy) && + Objects.equals(this.tissueType, sample.tissueType); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbId, notes, observationUnitDbId, plantDbId, plateDbId, plateIndex, plotDbId, sampleDbId, sampleTimestamp, sampleType, studyDbId, takenBy, tissueType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Sample {\n"); + + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" plantDbId: ").append(toIndentedString(plantDbId)).append("\n"); + sb.append(" plateDbId: ").append(toIndentedString(plateDbId)).append("\n"); + sb.append(" plateIndex: ").append(toIndentedString(plateIndex)).append("\n"); + sb.append(" plotDbId: ").append(toIndentedString(plotDbId)).append("\n"); + sb.append(" sampleDbId: ").append(toIndentedString(sampleDbId)).append("\n"); + sb.append(" sampleTimestamp: ").append(toIndentedString(sampleTimestamp)).append("\n"); + sb.append(" sampleType: ").append(toIndentedString(sampleType)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" takenBy: ").append(toIndentedString(takenBy)).append("\n"); + sb.append(" tissueType: ").append(toIndentedString(tissueType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SampleResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/SampleResponse.java new file mode 100755 index 00000000..c52a6e36 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SampleResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Sample; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SampleResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SampleResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Sample result = null; + + public SampleResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public SampleResponse result(Sample result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Sample getResult() { + return result; + } + + public void setResult(Sample result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SampleResponse sampleResponse = (SampleResponse) o; + return Objects.equals(this.metadata, sampleResponse.metadata) && + Objects.equals(this.result, sampleResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SampleResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequest.java new file mode 100755 index 00000000..8ac1ecb0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequest.java @@ -0,0 +1,236 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * SampleSearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SampleSearchRequest { + @SerializedName("germplasmDbIds") + private List germplasmDbIds = null; + + @SerializedName("observationUnitDbIds") + private List observationUnitDbIds = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("plateDbIds") + private List plateDbIds = null; + + @SerializedName("sampleDbIds") + private List sampleDbIds = null; + + public SampleSearchRequest germplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + return this; + } + + public SampleSearchRequest addGermplasmDbIdsItem(String germplasmDbIdsItem) { + if (this.germplasmDbIds == null) { + this.germplasmDbIds = new ArrayList(); + } + this.germplasmDbIds.add(germplasmDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbIds + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public List getGermplasmDbIds() { + return germplasmDbIds; + } + + public void setGermplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + } + + public SampleSearchRequest observationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + return this; + } + + public SampleSearchRequest addObservationUnitDbIdsItem(String observationUnitDbIdsItem) { + if (this.observationUnitDbIds == null) { + this.observationUnitDbIds = new ArrayList(); + } + this.observationUnitDbIds.add(observationUnitDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbIds + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public List getObservationUnitDbIds() { + return observationUnitDbIds; + } + + public void setObservationUnitDbIds(List observationUnitDbIds) { + this.observationUnitDbIds = observationUnitDbIds; + } + + public SampleSearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is 0. + * @return page + **/ + @Schema(description = "Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public SampleSearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The size of the pages to be returned. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The size of the pages to be returned. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public SampleSearchRequest plateDbIds(List plateDbIds) { + this.plateDbIds = plateDbIds; + return this; + } + + public SampleSearchRequest addPlateDbIdsItem(String plateDbIdsItem) { + if (this.plateDbIds == null) { + this.plateDbIds = new ArrayList(); + } + this.plateDbIds.add(plateDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies a plate of samples + * @return plateDbIds + **/ + @Schema(description = "The ID which uniquely identifies a plate of samples") + public List getPlateDbIds() { + return plateDbIds; + } + + public void setPlateDbIds(List plateDbIds) { + this.plateDbIds = plateDbIds; + } + + public SampleSearchRequest sampleDbIds(List sampleDbIds) { + this.sampleDbIds = sampleDbIds; + return this; + } + + public SampleSearchRequest addSampleDbIdsItem(String sampleDbIdsItem) { + if (this.sampleDbIds == null) { + this.sampleDbIds = new ArrayList(); + } + this.sampleDbIds.add(sampleDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies a sample + * @return sampleDbIds + **/ + @Schema(description = "The ID which uniquely identifies a sample") + public List getSampleDbIds() { + return sampleDbIds; + } + + public void setSampleDbIds(List sampleDbIds) { + this.sampleDbIds = sampleDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SampleSearchRequest sampleSearchRequest = (SampleSearchRequest) o; + return Objects.equals(this.germplasmDbIds, sampleSearchRequest.germplasmDbIds) && + Objects.equals(this.observationUnitDbIds, sampleSearchRequest.observationUnitDbIds) && + Objects.equals(this.page, sampleSearchRequest.page) && + Objects.equals(this.pageSize, sampleSearchRequest.pageSize) && + Objects.equals(this.plateDbIds, sampleSearchRequest.plateDbIds) && + Objects.equals(this.sampleDbIds, sampleSearchRequest.sampleDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbIds, observationUnitDbIds, page, pageSize, plateDbIds, sampleDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SampleSearchRequest {\n"); + + sb.append(" germplasmDbIds: ").append(toIndentedString(germplasmDbIds)).append("\n"); + sb.append(" observationUnitDbIds: ").append(toIndentedString(observationUnitDbIds)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" plateDbIds: ").append(toIndentedString(plateDbIds)).append("\n"); + sb.append(" sampleDbIds: ").append(toIndentedString(sampleDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequestDep.java b/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequestDep.java new file mode 100755 index 00000000..283256cc --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SampleSearchRequestDep.java @@ -0,0 +1,236 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * SampleSearchRequestDep + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SampleSearchRequestDep { + @SerializedName("germplasmDbId") + private List germplasmDbId = null; + + @SerializedName("observationUnitDbId") + private List observationUnitDbId = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("plateDbId") + private List plateDbId = null; + + @SerializedName("sampleDbId") + private List sampleDbId = null; + + public SampleSearchRequestDep germplasmDbId(List germplasmDbId) { + this.germplasmDbId = germplasmDbId; + return this; + } + + public SampleSearchRequestDep addGermplasmDbIdItem(String germplasmDbIdItem) { + if (this.germplasmDbId == null) { + this.germplasmDbId = new ArrayList(); + } + this.germplasmDbId.add(germplasmDbIdItem); + return this; + } + + /** + * The ID which uniquely identifies a germplasm + * @return germplasmDbId + **/ + @Schema(description = " The ID which uniquely identifies a germplasm") + public List getGermplasmDbId() { + return germplasmDbId; + } + + public void setGermplasmDbId(List germplasmDbId) { + this.germplasmDbId = germplasmDbId; + } + + public SampleSearchRequestDep observationUnitDbId(List observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + public SampleSearchRequestDep addObservationUnitDbIdItem(String observationUnitDbIdItem) { + if (this.observationUnitDbId == null) { + this.observationUnitDbId = new ArrayList(); + } + this.observationUnitDbId.add(observationUnitDbIdItem); + return this; + } + + /** + * The ID which uniquely identifies an observation unit + * @return observationUnitDbId + **/ + @Schema(description = "The ID which uniquely identifies an observation unit") + public List getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(List observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public SampleSearchRequestDep page(Integer page) { + this.page = page; + return this; + } + + /** + * Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is 0. + * @return page + **/ + @Schema(description = "Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public SampleSearchRequestDep pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The size of the pages to be returned. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The size of the pages to be returned. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public SampleSearchRequestDep plateDbId(List plateDbId) { + this.plateDbId = plateDbId; + return this; + } + + public SampleSearchRequestDep addPlateDbIdItem(String plateDbIdItem) { + if (this.plateDbId == null) { + this.plateDbId = new ArrayList(); + } + this.plateDbId.add(plateDbIdItem); + return this; + } + + /** + * The ID which uniquely identifies a plate of samples + * @return plateDbId + **/ + @Schema(description = "The ID which uniquely identifies a plate of samples") + public List getPlateDbId() { + return plateDbId; + } + + public void setPlateDbId(List plateDbId) { + this.plateDbId = plateDbId; + } + + public SampleSearchRequestDep sampleDbId(List sampleDbId) { + this.sampleDbId = sampleDbId; + return this; + } + + public SampleSearchRequestDep addSampleDbIdItem(String sampleDbIdItem) { + if (this.sampleDbId == null) { + this.sampleDbId = new ArrayList(); + } + this.sampleDbId.add(sampleDbIdItem); + return this; + } + + /** + * The ID which uniquely identifies a sample + * @return sampleDbId + **/ + @Schema(description = "The ID which uniquely identifies a sample") + public List getSampleDbId() { + return sampleDbId; + } + + public void setSampleDbId(List sampleDbId) { + this.sampleDbId = sampleDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SampleSearchRequestDep sampleSearchRequestDep = (SampleSearchRequestDep) o; + return Objects.equals(this.germplasmDbId, sampleSearchRequestDep.germplasmDbId) && + Objects.equals(this.observationUnitDbId, sampleSearchRequestDep.observationUnitDbId) && + Objects.equals(this.page, sampleSearchRequestDep.page) && + Objects.equals(this.pageSize, sampleSearchRequestDep.pageSize) && + Objects.equals(this.plateDbId, sampleSearchRequestDep.plateDbId) && + Objects.equals(this.sampleDbId, sampleSearchRequestDep.sampleDbId); + } + + @Override + public int hashCode() { + return Objects.hash(germplasmDbId, observationUnitDbId, page, pageSize, plateDbId, sampleDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SampleSearchRequestDep {\n"); + + sb.append(" germplasmDbId: ").append(toIndentedString(germplasmDbId)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" plateDbId: ").append(toIndentedString(plateDbId)).append("\n"); + sb.append(" sampleDbId: ").append(toIndentedString(sampleDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse.java new file mode 100755 index 00000000..bbd04e6c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.SamplesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SamplesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SamplesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private SamplesResponseResult result = null; + + public SamplesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public SamplesResponse result(SamplesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public SamplesResponseResult getResult() { + return result; + } + + public void setResult(SamplesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamplesResponse samplesResponse = (SamplesResponse) o; + return Objects.equals(this.metadata, samplesResponse.metadata) && + Objects.equals(this.result, samplesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamplesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1.java new file mode 100755 index 00000000..d7b12e5f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.SamplesResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SamplesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SamplesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private SamplesResponse1Result result = null; + + public SamplesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public SamplesResponse1 result(SamplesResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public SamplesResponse1Result getResult() { + return result; + } + + public void setResult(SamplesResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamplesResponse1 samplesResponse1 = (SamplesResponse1) o; + return Objects.equals(this.metadata, samplesResponse1.metadata) && + Objects.equals(this.result, samplesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamplesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1Result.java new file mode 100755 index 00000000..87a2ddcb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Sample; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * SamplesResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SamplesResponse1Result { + @SerializedName("data") + private List data = null; + + public SamplesResponse1Result data(List data) { + this.data = data; + return this; + } + + public SamplesResponse1Result addDataItem(Sample dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamplesResponse1Result samplesResponse1Result = (SamplesResponse1Result) o; + return Objects.equals(this.data, samplesResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamplesResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponseResult.java new file mode 100755 index 00000000..9b153545 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SamplesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Sample; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * SamplesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SamplesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public SamplesResponseResult data(List data) { + this.data = data; + return this; + } + + public SamplesResponseResult addDataItem(Sample dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamplesResponseResult samplesResponseResult = (SamplesResponseResult) o; + return Objects.equals(this.data, samplesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamplesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Scale.java b/brapi-client/src/main/resources/swagger-generated-client/model/Scale.java new file mode 100755 index 00000000..f43ec5c4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Scale.java @@ -0,0 +1,251 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.client.model.TraitDataType; +import io.swagger.client.model.ValidValues; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Scale metadata + */ +@Schema(description = "Scale metadata") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Scale { + @SerializedName("dataType") + private TraitDataType dataType = null; + + @SerializedName("decimalPlaces") + private Integer decimalPlaces = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("scaleDbId") + private String scaleDbId = null; + + @SerializedName("scaleName") + private String scaleName = null; + + @SerializedName("validValues") + private ValidValues validValues = null; + + @SerializedName("xref") + private String xref = null; + + public Scale dataType(TraitDataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get dataType + * @return dataType + **/ + @Schema(description = "") + public TraitDataType getDataType() { + return dataType; + } + + public void setDataType(TraitDataType dataType) { + this.dataType = dataType; + } + + public Scale decimalPlaces(Integer decimalPlaces) { + this.decimalPlaces = decimalPlaces; + return this; + } + + /** + * For numerical, number of decimal places to be reported + * @return decimalPlaces + **/ + @Schema(description = "For numerical, number of decimal places to be reported") + public Integer getDecimalPlaces() { + return decimalPlaces; + } + + public void setDecimalPlaces(Integer decimalPlaces) { + this.decimalPlaces = decimalPlaces; + } + + public Scale name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"scaleName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"scaleName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Scale ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public Scale scaleDbId(String scaleDbId) { + this.scaleDbId = scaleDbId; + return this; + } + + /** + * Unique identifier of the scale. If left blank, the upload system will automatically generate a scale ID. + * @return scaleDbId + **/ + @Schema(description = "Unique identifier of the scale. If left blank, the upload system will automatically generate a scale ID.") + public String getScaleDbId() { + return scaleDbId; + } + + public void setScaleDbId(String scaleDbId) { + this.scaleDbId = scaleDbId; + } + + public Scale scaleName(String scaleName) { + this.scaleName = scaleName; + return this; + } + + /** + * Name of the scale + * @return scaleName + **/ + @Schema(description = "Name of the scale") + public String getScaleName() { + return scaleName; + } + + public void setScaleName(String scaleName) { + this.scaleName = scaleName; + } + + public Scale validValues(ValidValues validValues) { + this.validValues = validValues; + return this; + } + + /** + * Get validValues + * @return validValues + **/ + @Schema(description = "") + public ValidValues getValidValues() { + return validValues; + } + + public void setValidValues(ValidValues validValues) { + this.validValues = validValues; + } + + public Scale xref(String xref) { + this.xref = xref; + return this; + } + + /** + * Cross reference to the scale, for example to a unit ontology such as UO or to a unit of an external major database + * @return xref + **/ + @Schema(description = "Cross reference to the scale, for example to a unit ontology such as UO or to a unit of an external major database") + public String getXref() { + return xref; + } + + public void setXref(String xref) { + this.xref = xref; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Scale scale = (Scale) o; + return Objects.equals(this.dataType, scale.dataType) && + Objects.equals(this.decimalPlaces, scale.decimalPlaces) && + Objects.equals(this.name, scale.name) && + Objects.equals(this.ontologyReference, scale.ontologyReference) && + Objects.equals(this.scaleDbId, scale.scaleDbId) && + Objects.equals(this.scaleName, scale.scaleName) && + Objects.equals(this.validValues, scale.validValues) && + Objects.equals(this.xref, scale.xref); + } + + @Override + public int hashCode() { + return Objects.hash(dataType, decimalPlaces, name, ontologyReference, scaleDbId, scaleName, validValues, xref); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Scale {\n"); + + sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); + sb.append(" decimalPlaces: ").append(toIndentedString(decimalPlaces)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" scaleDbId: ").append(toIndentedString(scaleDbId)).append("\n"); + sb.append(" scaleName: ").append(toIndentedString(scaleName)).append("\n"); + sb.append(" validValues: ").append(toIndentedString(validValues)).append("\n"); + sb.append(" xref: ").append(toIndentedString(xref)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ScaleResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ScaleResponse.java new file mode 100755 index 00000000..2afe1b56 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ScaleResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Scale; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ScaleResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ScaleResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Scale result = null; + + public ScaleResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ScaleResponse result(Scale result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Scale getResult() { + return result; + } + + public void setResult(Scale result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScaleResponse scaleResponse = (ScaleResponse) o; + return Objects.equals(this.metadata, scaleResponse.metadata) && + Objects.equals(this.result, scaleResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScaleResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponse.java new file mode 100755 index 00000000..5be89e4d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ScalesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * ScalesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ScalesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ScalesResponseResult result = null; + + public ScalesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public ScalesResponse result(ScalesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ScalesResponseResult getResult() { + return result; + } + + public void setResult(ScalesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScalesResponse scalesResponse = (ScalesResponse) o; + return Objects.equals(this.metadata, scalesResponse.metadata) && + Objects.equals(this.result, scalesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScalesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponseResult.java new file mode 100755 index 00000000..9993287a --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ScalesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Scale; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ScalesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ScalesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public ScalesResponseResult data(List data) { + this.data = data; + return this; + } + + public ScalesResponseResult addDataItem(Scale dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScalesResponseResult scalesResponseResult = (ScalesResponseResult) o; + return Objects.equals(this.data, scalesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScalesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Season.java b/brapi-client/src/main/resources/swagger-generated-client/model/Season.java new file mode 100755 index 00000000..83ae2101 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Season.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Season + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Season { + @SerializedName("season") + private String season = null; + + @SerializedName("seasonDbId") + private String seasonDbId = null; + + @SerializedName("year") + private String year = null; + + public Season season(String season) { + this.season = season; + return this; + } + + /** + * Name of the season. ex. 'Spring', 'Q2', 'Season A', etc. + * @return season + **/ + @Schema(description = "Name of the season. ex. 'Spring', 'Q2', 'Season A', etc.") + public String getSeason() { + return season; + } + + public void setSeason(String season) { + this.season = season; + } + + public Season seasonDbId(String seasonDbId) { + this.seasonDbId = seasonDbId; + return this; + } + + /** + * The ID which uniquely identifies a season + * @return seasonDbId + **/ + @Schema(description = "The ID which uniquely identifies a season") + public String getSeasonDbId() { + return seasonDbId; + } + + public void setSeasonDbId(String seasonDbId) { + this.seasonDbId = seasonDbId; + } + + public Season year(String year) { + this.year = year; + return this; + } + + /** + * The 4 digit year of the season. + * @return year + **/ + @Schema(description = "The 4 digit year of the season.") + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Season season = (Season) o; + return Objects.equals(this.season, season.season) && + Objects.equals(this.seasonDbId, season.seasonDbId) && + Objects.equals(this.year, season.year); + } + + @Override + public int hashCode() { + return Objects.hash(season, seasonDbId, year); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Season {\n"); + + sb.append(" season: ").append(toIndentedString(season)).append("\n"); + sb.append(" seasonDbId: ").append(toIndentedString(seasonDbId)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponse.java new file mode 100755 index 00000000..28bbb503 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.SeasonsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SeasonsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SeasonsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private SeasonsResponseResult result = null; + + public SeasonsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public SeasonsResponse result(SeasonsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public SeasonsResponseResult getResult() { + return result; + } + + public void setResult(SeasonsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeasonsResponse seasonsResponse = (SeasonsResponse) o; + return Objects.equals(this.metadata, seasonsResponse.metadata) && + Objects.equals(this.result, seasonsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeasonsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponseResult.java new file mode 100755 index 00000000..868ea77f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SeasonsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Season; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * SeasonsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SeasonsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public SeasonsResponseResult data(List data) { + this.data = data; + return this; + } + + public SeasonsResponseResult addDataItem(Season dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SeasonsResponseResult seasonsResponseResult = (SeasonsResponseResult) o; + return Objects.equals(this.data, seasonsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SeasonsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Status.java b/brapi-client/src/main/resources/swagger-generated-client/model/Status.java new file mode 100755 index 00000000..ae3990c6 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Status.java @@ -0,0 +1,180 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * Status + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Status { + @SerializedName("code") + private String code = null; + + @SerializedName("message") + private String message = null; + + /** + * The logging level for the attached message + */ + @JsonAdapter(MessageTypeEnum.Adapter.class) + public enum MessageTypeEnum { + DEBUG("DEBUG"), + ERROR("ERROR"), + WARNING("WARNING"), + INFO("INFO"); + + private String value; + + MessageTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static MessageTypeEnum fromValue(String text) { + for (MessageTypeEnum b : MessageTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MessageTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MessageTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MessageTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("messageType") + private MessageTypeEnum messageType = null; + + public Status code(String code) { + this.code = code; + return this; + } + + /** + * DEPRECATED in v1.3 - see Error Handling best practice documentation + * @return code + **/ + @Schema(description = "DEPRECATED in v1.3 - see Error Handling best practice documentation") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Status message(String message) { + this.message = message; + return this; + } + + /** + * A short message concerning the status of this request/response + * @return message + **/ + @Schema(required = true, description = "A short message concerning the status of this request/response") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Status messageType(MessageTypeEnum messageType) { + this.messageType = messageType; + return this; + } + + /** + * The logging level for the attached message + * @return messageType + **/ + @Schema(required = true, description = "The logging level for the attached message") + public MessageTypeEnum getMessageType() { + return messageType; + } + + public void setMessageType(MessageTypeEnum messageType) { + this.messageType = messageType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Status status = (Status) o; + return Objects.equals(this.code, status.code) && + Objects.equals(this.message, status.message) && + Objects.equals(this.messageType, status.messageType); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, messageType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Status {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse.java new file mode 100755 index 00000000..9c152fd0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudiesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudiesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudiesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudiesResponseResult result = null; + + public StudiesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudiesResponse result(StudiesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public StudiesResponseResult getResult() { + return result; + } + + public void setResult(StudiesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudiesResponse studiesResponse = (StudiesResponse) o; + return Objects.equals(this.metadata, studiesResponse.metadata) && + Objects.equals(this.result, studiesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudiesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1.java new file mode 100755 index 00000000..8701a807 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudiesResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudiesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudiesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudiesResponse1Result result = null; + + public StudiesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudiesResponse1 result(StudiesResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public StudiesResponse1Result getResult() { + return result; + } + + public void setResult(StudiesResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudiesResponse1 studiesResponse1 = (StudiesResponse1) o; + return Objects.equals(this.metadata, studiesResponse1.metadata) && + Objects.equals(this.result, studiesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudiesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1Result.java new file mode 100755 index 00000000..19214f1d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponse1Result.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.StudySummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudiesResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudiesResponse1Result { + @SerializedName("data") + private List data = null; + + public StudiesResponse1Result data(List data) { + this.data = data; + return this; + } + + public StudiesResponse1Result addDataItem(StudySummary dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudiesResponse1Result studiesResponse1Result = (StudiesResponse1Result) o; + return Objects.equals(this.data, studiesResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudiesResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponseResult.java new file mode 100755 index 00000000..2d8cdae1 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudiesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.StudySummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudiesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudiesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public StudiesResponseResult data(List data) { + this.data = data; + return this; + } + + public StudiesResponseResult addDataItem(StudySummary dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudiesResponseResult studiesResponseResult = (StudiesResponseResult) o; + return Objects.equals(this.data, studiesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudiesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Study.java b/brapi-client/src/main/resources/swagger-generated-client/model/Study.java new file mode 100755 index 00000000..52b23967 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Study.java @@ -0,0 +1,565 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Contact; +import io.swagger.client.model.DataLink; +import io.swagger.client.model.Location; +import io.swagger.client.model.StudyLastUpdate; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * Study + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Study { + @SerializedName("active") + private String active = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("contacts") + private List contacts = null; + + @SerializedName("dataLinks") + private List dataLinks = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("endDate") + private LocalDate endDate = null; + + @SerializedName("lastUpdate") + private StudyLastUpdate lastUpdate = null; + + @SerializedName("license") + private String license = null; + + @SerializedName("location") + private Location location = null; + + @SerializedName("seasons") + private List seasons = null; + + @SerializedName("startDate") + private LocalDate startDate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("studyDescription") + private String studyDescription = null; + + @SerializedName("studyName") + private String studyName = null; + + @SerializedName("studyType") + private String studyType = null; + + @SerializedName("studyTypeDbId") + private String studyTypeDbId = null; + + @SerializedName("studyTypeName") + private String studyTypeName = null; + + @SerializedName("trialDbId") + private String trialDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public Study active(String active) { + this.active = active; + return this; + } + + /** + * Is this study currently active + * @return active + **/ + @Schema(description = "Is this study currently active") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public Study additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public Study putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public Study commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop associated with this study + * @return commonCropName + **/ + @Schema(description = "Common name for the crop associated with this study") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public Study contacts(List contacts) { + this.contacts = contacts; + return this; + } + + public Study addContactsItem(Contact contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * List of contact entities associated with this study + * @return contacts + **/ + @Schema(description = "List of contact entities associated with this study") + public List getContacts() { + return contacts; + } + + public void setContacts(List contacts) { + this.contacts = contacts; + } + + public Study dataLinks(List dataLinks) { + this.dataLinks = dataLinks; + return this; + } + + public Study addDataLinksItem(DataLink dataLinksItem) { + if (this.dataLinks == null) { + this.dataLinks = new ArrayList(); + } + this.dataLinks.add(dataLinksItem); + return this; + } + + /** + * List of links to extra data files associated with this study. Extra data could include notes, images, and reference data. + * @return dataLinks + **/ + @Schema(description = "List of links to extra data files associated with this study. Extra data could include notes, images, and reference data.") + public List getDataLinks() { + return dataLinks; + } + + public void setDataLinks(List dataLinks) { + this.dataLinks = dataLinks; + } + + public Study documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Study endDate(LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The date the study ends + * @return endDate + **/ + @Schema(description = "The date the study ends") + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(LocalDate endDate) { + this.endDate = endDate; + } + + public Study lastUpdate(StudyLastUpdate lastUpdate) { + this.lastUpdate = lastUpdate; + return this; + } + + /** + * Get lastUpdate + * @return lastUpdate + **/ + @Schema(description = "") + public StudyLastUpdate getLastUpdate() { + return lastUpdate; + } + + public void setLastUpdate(StudyLastUpdate lastUpdate) { + this.lastUpdate = lastUpdate; + } + + public Study license(String license) { + this.license = license; + return this; + } + + /** + * The usage license associated with the study data + * @return license + **/ + @Schema(description = "The usage license associated with the study data") + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + public Study location(Location location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + **/ + @Schema(description = "") + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public Study seasons(List seasons) { + this.seasons = seasons; + return this; + } + + public Study addSeasonsItem(String seasonsItem) { + if (this.seasons == null) { + this.seasons = new ArrayList(); + } + this.seasons.add(seasonsItem); + return this; + } + + /** + * List of seasons over which this study was performed. + * @return seasons + **/ + @Schema(description = "List of seasons over which this study was performed.") + public List getSeasons() { + return seasons; + } + + public void setSeasons(List seasons) { + this.seasons = seasons; + } + + public Study startDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The date this study started + * @return startDate + **/ + @Schema(description = "The date this study started") + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public Study studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public Study studyDescription(String studyDescription) { + this.studyDescription = studyDescription; + return this; + } + + /** + * The description of this study + * @return studyDescription + **/ + @Schema(description = "The description of this study") + public String getStudyDescription() { + return studyDescription; + } + + public void setStudyDescription(String studyDescription) { + this.studyDescription = studyDescription; + } + + public Study studyName(String studyName) { + this.studyName = studyName; + return this; + } + + /** + * The human readable name for a study + * @return studyName + **/ + @Schema(description = "The human readable name for a study") + public String getStudyName() { + return studyName; + } + + public void setStudyName(String studyName) { + this.studyName = studyName; + } + + public Study studyType(String studyType) { + this.studyType = studyType; + return this; + } + + /** + * DEPRECATED in v1.3 - See \"studyTypeName\" + * @return studyType + **/ + @Schema(description = "DEPRECATED in v1.3 - See \"studyTypeName\"") + public String getStudyType() { + return studyType; + } + + public void setStudyType(String studyType) { + this.studyType = studyType; + } + + public Study studyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + return this; + } + + /** + * The unique identifier of the type of study being performed. + * @return studyTypeDbId + **/ + @Schema(description = "The unique identifier of the type of study being performed.") + public String getStudyTypeDbId() { + return studyTypeDbId; + } + + public void setStudyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + } + + public Study studyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + return this; + } + + /** + * The name of the type of study being performed. ex. \"Yield Trial\", etc + * @return studyTypeName + **/ + @Schema(description = "The name of the type of study being performed. ex. \"Yield Trial\", etc") + public String getStudyTypeName() { + return studyTypeName; + } + + public void setStudyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + } + + public Study trialDbId(String trialDbId) { + this.trialDbId = trialDbId; + return this; + } + + /** + * The ID which uniquely identifies a trial + * @return trialDbId + **/ + @Schema(description = "The ID which uniquely identifies a trial") + public String getTrialDbId() { + return trialDbId; + } + + public void setTrialDbId(String trialDbId) { + this.trialDbId = trialDbId; + } + + public Study trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * The human readable name of a trial + * @return trialName + **/ + @Schema(description = "The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Study study = (Study) o; + return Objects.equals(this.active, study.active) && + Objects.equals(this.additionalInfo, study.additionalInfo) && + Objects.equals(this.commonCropName, study.commonCropName) && + Objects.equals(this.contacts, study.contacts) && + Objects.equals(this.dataLinks, study.dataLinks) && + Objects.equals(this.documentationURL, study.documentationURL) && + Objects.equals(this.endDate, study.endDate) && + Objects.equals(this.lastUpdate, study.lastUpdate) && + Objects.equals(this.license, study.license) && + Objects.equals(this.location, study.location) && + Objects.equals(this.seasons, study.seasons) && + Objects.equals(this.startDate, study.startDate) && + Objects.equals(this.studyDbId, study.studyDbId) && + Objects.equals(this.studyDescription, study.studyDescription) && + Objects.equals(this.studyName, study.studyName) && + Objects.equals(this.studyType, study.studyType) && + Objects.equals(this.studyTypeDbId, study.studyTypeDbId) && + Objects.equals(this.studyTypeName, study.studyTypeName) && + Objects.equals(this.trialDbId, study.trialDbId) && + Objects.equals(this.trialName, study.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(active, additionalInfo, commonCropName, contacts, dataLinks, documentationURL, endDate, lastUpdate, license, location, seasons, startDate, studyDbId, studyDescription, studyName, studyType, studyTypeDbId, studyTypeName, trialDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Study {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" dataLinks: ").append(toIndentedString(dataLinks)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" lastUpdate: ").append(toIndentedString(lastUpdate)).append("\n"); + sb.append(" license: ").append(toIndentedString(license)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" seasons: ").append(toIndentedString(seasons)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" studyDescription: ").append(toIndentedString(studyDescription)).append("\n"); + sb.append(" studyName: ").append(toIndentedString(studyName)).append("\n"); + sb.append(" studyType: ").append(toIndentedString(studyType)).append("\n"); + sb.append(" studyTypeDbId: ").append(toIndentedString(studyTypeDbId)).append("\n"); + sb.append(" studyTypeName: ").append(toIndentedString(studyTypeName)).append("\n"); + sb.append(" trialDbId: ").append(toIndentedString(trialDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyLastUpdate.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLastUpdate.java new file mode 100755 index 00000000..8f7eb080 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLastUpdate.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import org.threeten.bp.OffsetDateTime; +/** + * The date and time when this study was last modified + */ +@Schema(description = "The date and time when this study was last modified") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyLastUpdate { + @SerializedName("timestamp") + private OffsetDateTime timestamp = null; + + @SerializedName("version") + private String version = null; + + public StudyLastUpdate timestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @Schema(description = "") + public OffsetDateTime getTimestamp() { + return timestamp; + } + + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + } + + public StudyLastUpdate version(String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @Schema(description = "") + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyLastUpdate studyLastUpdate = (StudyLastUpdate) o; + return Objects.equals(this.timestamp, studyLastUpdate.timestamp) && + Objects.equals(this.version, studyLastUpdate.version); + } + + @Override + public int hashCode() { + return Objects.hash(timestamp, version); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyLastUpdate {\n"); + + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequest.java new file mode 100755 index 00000000..f0097523 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequest.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.StudyLayoutRequestLayout; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudyLayoutRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyLayoutRequest { + @SerializedName("layout") + private List layout = null; + + public StudyLayoutRequest layout(List layout) { + this.layout = layout; + return this; + } + + public StudyLayoutRequest addLayoutItem(StudyLayoutRequestLayout layoutItem) { + if (this.layout == null) { + this.layout = new ArrayList(); + } + this.layout.add(layoutItem); + return this; + } + + /** + * List of observation unit position data entities which need to be updated + * @return layout + **/ + @Schema(description = "List of observation unit position data entities which need to be updated") + public List getLayout() { + return layout; + } + + public void setLayout(List layout) { + this.layout = layout; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyLayoutRequest studyLayoutRequest = (StudyLayoutRequest) o; + return Objects.equals(this.layout, studyLayoutRequest.layout); + } + + @Override + public int hashCode() { + return Objects.hash(layout); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyLayoutRequest {\n"); + + sb.append(" layout: ").append(toIndentedString(layout)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequestLayout.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequestLayout.java new file mode 100755 index 00000000..4f7bffd9 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyLayoutRequestLayout.java @@ -0,0 +1,434 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * StudyLayoutRequestLayout + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyLayoutRequestLayout { + @SerializedName("X") + private String X = null; + + @SerializedName("Y") + private String Y = null; + + @SerializedName("blockNumber") + private Integer blockNumber = null; + + /** + * Gets or Sets entryType + */ + @JsonAdapter(EntryTypeEnum.Adapter.class) + public enum EntryTypeEnum { + CHECK("CHECK"), + TEST("TEST"), + FILLER("FILLER"); + + private String value; + + EntryTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static EntryTypeEnum fromValue(String text) { + for (EntryTypeEnum b : EntryTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntryTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntryTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntryTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("entryType") + private EntryTypeEnum entryType = null; + + @SerializedName("observationUnitDbId") + private String observationUnitDbId = null; + + @SerializedName("positionCoordinateX") + private String positionCoordinateX = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateXTypeEnum.Adapter.class) + public enum PositionCoordinateXTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateXTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateXTypeEnum fromValue(String text) { + for (PositionCoordinateXTypeEnum b : PositionCoordinateXTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateXTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateXTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateXTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateXType") + private PositionCoordinateXTypeEnum positionCoordinateXType = null; + + @SerializedName("positionCoordinateY") + private String positionCoordinateY = null; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + */ + @JsonAdapter(PositionCoordinateYTypeEnum.Adapter.class) + public enum PositionCoordinateYTypeEnum { + LONGITUDE("LONGITUDE"), + LATITUDE("LATITUDE"), + PLANTED_ROW("PLANTED_ROW"), + PLANTED_INDIVIDUAL("PLANTED_INDIVIDUAl"), + GRID_ROW("GRID_ROW"), + GRID_COL("GRID_COL"), + MEASURED_ROW("MEASURED_ROW"), + MEASURED_COL("MEASURED_COL"); + + private String value; + + PositionCoordinateYTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static PositionCoordinateYTypeEnum fromValue(String text) { + for (PositionCoordinateYTypeEnum b : PositionCoordinateYTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PositionCoordinateYTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionCoordinateYTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionCoordinateYTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("positionCoordinateYType") + private PositionCoordinateYTypeEnum positionCoordinateYType = null; + + @SerializedName("replicate") + private Integer replicate = null; + + public StudyLayoutRequestLayout X(String X) { + this.X = X; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateX\" + * @return X + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateX\"") + public String getX() { + return X; + } + + public void setX(String X) { + this.X = X; + } + + public StudyLayoutRequestLayout Y(String Y) { + this.Y = Y; + return this; + } + + /** + * DEPRECATED - use \"positionCoordinateY\" + * @return Y + **/ + @Schema(description = "DEPRECATED - use \"positionCoordinateY\"") + public String getY() { + return Y; + } + + public void setY(String Y) { + this.Y = Y; + } + + public StudyLayoutRequestLayout blockNumber(Integer blockNumber) { + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @Schema(description = "") + public Integer getBlockNumber() { + return blockNumber; + } + + public void setBlockNumber(Integer blockNumber) { + this.blockNumber = blockNumber; + } + + public StudyLayoutRequestLayout entryType(EntryTypeEnum entryType) { + this.entryType = entryType; + return this; + } + + /** + * Get entryType + * @return entryType + **/ + @Schema(description = "") + public EntryTypeEnum getEntryType() { + return entryType; + } + + public void setEntryType(EntryTypeEnum entryType) { + this.entryType = entryType; + } + + public StudyLayoutRequestLayout observationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + return this; + } + + /** + * Get observationUnitDbId + * @return observationUnitDbId + **/ + @Schema(description = "") + public String getObservationUnitDbId() { + return observationUnitDbId; + } + + public void setObservationUnitDbId(String observationUnitDbId) { + this.observationUnitDbId = observationUnitDbId; + } + + public StudyLayoutRequestLayout positionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + return this; + } + + /** + * The X position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateX + **/ + @Schema(description = "The X position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateX() { + return positionCoordinateX; + } + + public void setPositionCoordinateX(String positionCoordinateX) { + this.positionCoordinateX = positionCoordinateX; + } + + public StudyLayoutRequestLayout positionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateXType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateXTypeEnum getPositionCoordinateXType() { + return positionCoordinateXType; + } + + public void setPositionCoordinateXType(PositionCoordinateXTypeEnum positionCoordinateXType) { + this.positionCoordinateXType = positionCoordinateXType; + } + + public StudyLayoutRequestLayout positionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + return this; + } + + /** + * The Y position coordinate for an observation unit. Different systems may use different coordinate systems. + * @return positionCoordinateY + **/ + @Schema(description = "The Y position coordinate for an observation unit. Different systems may use different coordinate systems.") + public String getPositionCoordinateY() { + return positionCoordinateY; + } + + public void setPositionCoordinateY(String positionCoordinateY) { + this.positionCoordinateY = positionCoordinateY; + } + + public StudyLayoutRequestLayout positionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + return this; + } + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column + * @return positionCoordinateYType + **/ + @Schema(description = "The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See \"Location Coordinate Encoding\" for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAl - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0th row MEASURED_COL - The distance in meters from a defined 0th column ") + public PositionCoordinateYTypeEnum getPositionCoordinateYType() { + return positionCoordinateYType; + } + + public void setPositionCoordinateYType(PositionCoordinateYTypeEnum positionCoordinateYType) { + this.positionCoordinateYType = positionCoordinateYType; + } + + public StudyLayoutRequestLayout replicate(Integer replicate) { + this.replicate = replicate; + return this; + } + + /** + * Get replicate + * @return replicate + **/ + @Schema(description = "") + public Integer getReplicate() { + return replicate; + } + + public void setReplicate(Integer replicate) { + this.replicate = replicate; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyLayoutRequestLayout studyLayoutRequestLayout = (StudyLayoutRequestLayout) o; + return Objects.equals(this.X, studyLayoutRequestLayout.X) && + Objects.equals(this.Y, studyLayoutRequestLayout.Y) && + Objects.equals(this.blockNumber, studyLayoutRequestLayout.blockNumber) && + Objects.equals(this.entryType, studyLayoutRequestLayout.entryType) && + Objects.equals(this.observationUnitDbId, studyLayoutRequestLayout.observationUnitDbId) && + Objects.equals(this.positionCoordinateX, studyLayoutRequestLayout.positionCoordinateX) && + Objects.equals(this.positionCoordinateXType, studyLayoutRequestLayout.positionCoordinateXType) && + Objects.equals(this.positionCoordinateY, studyLayoutRequestLayout.positionCoordinateY) && + Objects.equals(this.positionCoordinateYType, studyLayoutRequestLayout.positionCoordinateYType) && + Objects.equals(this.replicate, studyLayoutRequestLayout.replicate); + } + + @Override + public int hashCode() { + return Objects.hash(X, Y, blockNumber, entryType, observationUnitDbId, positionCoordinateX, positionCoordinateXType, positionCoordinateY, positionCoordinateYType, replicate); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyLayoutRequestLayout {\n"); + + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" entryType: ").append(toIndentedString(entryType)).append("\n"); + sb.append(" observationUnitDbId: ").append(toIndentedString(observationUnitDbId)).append("\n"); + sb.append(" positionCoordinateX: ").append(toIndentedString(positionCoordinateX)).append("\n"); + sb.append(" positionCoordinateXType: ").append(toIndentedString(positionCoordinateXType)).append("\n"); + sb.append(" positionCoordinateY: ").append(toIndentedString(positionCoordinateY)).append("\n"); + sb.append(" positionCoordinateYType: ").append(toIndentedString(positionCoordinateYType)).append("\n"); + sb.append(" replicate: ").append(toIndentedString(replicate)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse.java new file mode 100755 index 00000000..129d2c92 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudyObservationVariablesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyObservationVariablesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyObservationVariablesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudyObservationVariablesResponseResult result = null; + + public StudyObservationVariablesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyObservationVariablesResponse result(StudyObservationVariablesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public StudyObservationVariablesResponseResult getResult() { + return result; + } + + public void setResult(StudyObservationVariablesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyObservationVariablesResponse studyObservationVariablesResponse = (StudyObservationVariablesResponse) o; + return Objects.equals(this.metadata, studyObservationVariablesResponse.metadata) && + Objects.equals(this.result, studyObservationVariablesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyObservationVariablesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1.java new file mode 100755 index 00000000..070c7f93 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudyObservationVariablesResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyObservationVariablesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyObservationVariablesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudyObservationVariablesResponse1Result result = null; + + public StudyObservationVariablesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyObservationVariablesResponse1 result(StudyObservationVariablesResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public StudyObservationVariablesResponse1Result getResult() { + return result; + } + + public void setResult(StudyObservationVariablesResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyObservationVariablesResponse1 studyObservationVariablesResponse1 = (StudyObservationVariablesResponse1) o; + return Objects.equals(this.metadata, studyObservationVariablesResponse1.metadata) && + Objects.equals(this.result, studyObservationVariablesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyObservationVariablesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1Result.java new file mode 100755 index 00000000..6282e904 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponse1Result.java @@ -0,0 +1,141 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationVariable; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudyObservationVariablesResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyObservationVariablesResponse1Result { + @SerializedName("data") + private List data = new ArrayList(); + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public StudyObservationVariablesResponse1Result data(List data) { + this.data = data; + return this; + } + + public StudyObservationVariablesResponse1Result addDataItem(ObservationVariable dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public StudyObservationVariablesResponse1Result studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Get studyDbId + * @return studyDbId + **/ + @Schema(description = "") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public StudyObservationVariablesResponse1Result trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * Get trialName + * @return trialName + **/ + @Schema(description = "") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyObservationVariablesResponse1Result studyObservationVariablesResponse1Result = (StudyObservationVariablesResponse1Result) o; + return Objects.equals(this.data, studyObservationVariablesResponse1Result.data) && + Objects.equals(this.studyDbId, studyObservationVariablesResponse1Result.studyDbId) && + Objects.equals(this.trialName, studyObservationVariablesResponse1Result.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(data, studyDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyObservationVariablesResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponseResult.java new file mode 100755 index 00000000..16e73756 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyObservationVariablesResponseResult.java @@ -0,0 +1,144 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.ObservationVariable; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudyObservationVariablesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyObservationVariablesResponseResult { + @SerializedName("data") + private List data = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public StudyObservationVariablesResponseResult data(List data) { + this.data = data; + return this; + } + + public StudyObservationVariablesResponseResult addDataItem(ObservationVariable dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public StudyObservationVariablesResponseResult studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Get studyDbId + * @return studyDbId + **/ + @Schema(description = "") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public StudyObservationVariablesResponseResult trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * Get trialName + * @return trialName + **/ + @Schema(description = "") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyObservationVariablesResponseResult studyObservationVariablesResponseResult = (StudyObservationVariablesResponseResult) o; + return Objects.equals(this.data, studyObservationVariablesResponseResult.data) && + Objects.equals(this.studyDbId, studyObservationVariablesResponseResult.studyDbId) && + Objects.equals(this.trialName, studyObservationVariablesResponseResult.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(data, studyDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyObservationVariablesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyResponse.java new file mode 100755 index 00000000..d07279e7 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Study; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Study result = null; + + public StudyResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyResponse result(Study result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Study getResult() { + return result; + } + + public void setResult(Study result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyResponse studyResponse = (StudyResponse) o; + return Objects.equals(this.metadata, studyResponse.metadata) && + Objects.equals(this.result, studyResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequest.java new file mode 100755 index 00000000..8c6b0d4c --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequest.java @@ -0,0 +1,649 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * StudySearchRequest + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudySearchRequest { + @SerializedName("active") + private Boolean active = null; + + @SerializedName("commonCropNames") + private List commonCropNames = null; + + @SerializedName("germplasmDbIds") + private List germplasmDbIds = null; + + @SerializedName("locationDbIds") + private List locationDbIds = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("programDbIds") + private List programDbIds = null; + + @SerializedName("programNames") + private List programNames = null; + + @SerializedName("seasonDbIds") + private List seasonDbIds = null; + + /** + * Name of one of the fields within the study object on which results can be sorted + */ + @JsonAdapter(SortByEnum.Adapter.class) + public enum SortByEnum { + STUDYDBID("studyDbId"), + TRIALDBID("trialDbId"), + PROGRAMDBID("programDbId"), + LOCATIONDBID("locationDbId"), + SEASONDBID("seasonDbId"), + STUDYTYPENAME("studyTypeName"), + STUDYTYPEDBID("studyTypeDbId"), + STUDYNAME("studyName"), + STUDYLOCATION("studyLocation"), + PROGRAMNAME("programName"), + GERMPLASMDBID("germplasmDbId"), + OBSERVATIONVARIABLEDBID("observationVariableDbId"); + + private String value; + + SortByEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SortByEnum fromValue(String text) { + for (SortByEnum b : SortByEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SortByEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SortByEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SortByEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sortBy") + private SortByEnum sortBy = null; + + /** + * Order results should be sorted. ex. \"ASC\" or \"DESC\" + */ + @JsonAdapter(SortOrderEnum.Adapter.class) + public enum SortOrderEnum { + ASC("ASC"), + DESC("DESC"); + + private String value; + + SortOrderEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SortOrderEnum fromValue(String text) { + for (SortOrderEnum b : SortOrderEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SortOrderEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SortOrderEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SortOrderEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sortOrder") + private SortOrderEnum sortOrder = null; + + @SerializedName("studyDbIds") + private List studyDbIds = null; + + @SerializedName("studyNames") + private List studyNames = null; + + @SerializedName("studyTypeDbIds") + private List studyTypeDbIds = null; + + @SerializedName("studyTypeNames") + private List studyTypeNames = null; + + @SerializedName("trialDbIds") + private List trialDbIds = null; + + public StudySearchRequest active(Boolean active) { + this.active = active; + return this; + } + + /** + * Is this study currently active + * @return active + **/ + @Schema(description = "Is this study currently active") + public Boolean isActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public StudySearchRequest commonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + return this; + } + + public StudySearchRequest addCommonCropNamesItem(String commonCropNamesItem) { + if (this.commonCropNames == null) { + this.commonCropNames = new ArrayList(); + } + this.commonCropNames.add(commonCropNamesItem); + return this; + } + + /** + * Common names for the crop associated with this study + * @return commonCropNames + **/ + @Schema(description = "Common names for the crop associated with this study") + public List getCommonCropNames() { + return commonCropNames; + } + + public void setCommonCropNames(List commonCropNames) { + this.commonCropNames = commonCropNames; + } + + public StudySearchRequest germplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + return this; + } + + public StudySearchRequest addGermplasmDbIdsItem(String germplasmDbIdsItem) { + if (this.germplasmDbIds == null) { + this.germplasmDbIds = new ArrayList(); + } + this.germplasmDbIds.add(germplasmDbIdsItem); + return this; + } + + /** + * List of IDs which uniquely identify germplasm + * @return germplasmDbIds + **/ + @Schema(description = "List of IDs which uniquely identify germplasm") + public List getGermplasmDbIds() { + return germplasmDbIds; + } + + public void setGermplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + } + + public StudySearchRequest locationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + return this; + } + + public StudySearchRequest addLocationDbIdsItem(String locationDbIdsItem) { + if (this.locationDbIds == null) { + this.locationDbIds = new ArrayList(); + } + this.locationDbIds.add(locationDbIdsItem); + return this; + } + + /** + * List of location names to filter search results + * @return locationDbIds + **/ + @Schema(description = "List of location names to filter search results") + public List getLocationDbIds() { + return locationDbIds; + } + + public void setLocationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + } + + public StudySearchRequest observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public StudySearchRequest addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * List of observation variable IDs to search for + * @return observationVariableDbIds + **/ + @Schema(description = "List of observation variable IDs to search for") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public StudySearchRequest page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public StudySearchRequest pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public StudySearchRequest programDbIds(List programDbIds) { + this.programDbIds = programDbIds; + return this; + } + + public StudySearchRequest addProgramDbIdsItem(String programDbIdsItem) { + if (this.programDbIds == null) { + this.programDbIds = new ArrayList(); + } + this.programDbIds.add(programDbIdsItem); + return this; + } + + /** + * List of program identifiers to filter search results + * @return programDbIds + **/ + @Schema(description = "List of program identifiers to filter search results") + public List getProgramDbIds() { + return programDbIds; + } + + public void setProgramDbIds(List programDbIds) { + this.programDbIds = programDbIds; + } + + public StudySearchRequest programNames(List programNames) { + this.programNames = programNames; + return this; + } + + public StudySearchRequest addProgramNamesItem(String programNamesItem) { + if (this.programNames == null) { + this.programNames = new ArrayList(); + } + this.programNames.add(programNamesItem); + return this; + } + + /** + * List of program names to filter search results + * @return programNames + **/ + @Schema(description = "List of program names to filter search results") + public List getProgramNames() { + return programNames; + } + + public void setProgramNames(List programNames) { + this.programNames = programNames; + } + + public StudySearchRequest seasonDbIds(List seasonDbIds) { + this.seasonDbIds = seasonDbIds; + return this; + } + + public StudySearchRequest addSeasonDbIdsItem(String seasonDbIdsItem) { + if (this.seasonDbIds == null) { + this.seasonDbIds = new ArrayList(); + } + this.seasonDbIds.add(seasonDbIdsItem); + return this; + } + + /** + * The ID which uniquely identifies a season + * @return seasonDbIds + **/ + @Schema(description = "The ID which uniquely identifies a season") + public List getSeasonDbIds() { + return seasonDbIds; + } + + public void setSeasonDbIds(List seasonDbIds) { + this.seasonDbIds = seasonDbIds; + } + + public StudySearchRequest sortBy(SortByEnum sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Name of one of the fields within the study object on which results can be sorted + * @return sortBy + **/ + @Schema(description = "Name of one of the fields within the study object on which results can be sorted") + public SortByEnum getSortBy() { + return sortBy; + } + + public void setSortBy(SortByEnum sortBy) { + this.sortBy = sortBy; + } + + public StudySearchRequest sortOrder(SortOrderEnum sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Order results should be sorted. ex. \"ASC\" or \"DESC\" + * @return sortOrder + **/ + @Schema(description = "Order results should be sorted. ex. \"ASC\" or \"DESC\"") + public SortOrderEnum getSortOrder() { + return sortOrder; + } + + public void setSortOrder(SortOrderEnum sortOrder) { + this.sortOrder = sortOrder; + } + + public StudySearchRequest studyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + return this; + } + + public StudySearchRequest addStudyDbIdsItem(String studyDbIdsItem) { + if (this.studyDbIds == null) { + this.studyDbIds = new ArrayList(); + } + this.studyDbIds.add(studyDbIdsItem); + return this; + } + + /** + * List of study identifiers to search for + * @return studyDbIds + **/ + @Schema(description = "List of study identifiers to search for") + public List getStudyDbIds() { + return studyDbIds; + } + + public void setStudyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + } + + public StudySearchRequest studyNames(List studyNames) { + this.studyNames = studyNames; + return this; + } + + public StudySearchRequest addStudyNamesItem(String studyNamesItem) { + if (this.studyNames == null) { + this.studyNames = new ArrayList(); + } + this.studyNames.add(studyNamesItem); + return this; + } + + /** + * List of study names to filter search results + * @return studyNames + **/ + @Schema(description = "List of study names to filter search results") + public List getStudyNames() { + return studyNames; + } + + public void setStudyNames(List studyNames) { + this.studyNames = studyNames; + } + + public StudySearchRequest studyTypeDbIds(List studyTypeDbIds) { + this.studyTypeDbIds = studyTypeDbIds; + return this; + } + + public StudySearchRequest addStudyTypeDbIdsItem(String studyTypeDbIdsItem) { + if (this.studyTypeDbIds == null) { + this.studyTypeDbIds = new ArrayList(); + } + this.studyTypeDbIds.add(studyTypeDbIdsItem); + return this; + } + + /** + * The unique identifier of the type of study being performed. + * @return studyTypeDbIds + **/ + @Schema(description = "The unique identifier of the type of study being performed.") + public List getStudyTypeDbIds() { + return studyTypeDbIds; + } + + public void setStudyTypeDbIds(List studyTypeDbIds) { + this.studyTypeDbIds = studyTypeDbIds; + } + + public StudySearchRequest studyTypeNames(List studyTypeNames) { + this.studyTypeNames = studyTypeNames; + return this; + } + + public StudySearchRequest addStudyTypeNamesItem(String studyTypeNamesItem) { + if (this.studyTypeNames == null) { + this.studyTypeNames = new ArrayList(); + } + this.studyTypeNames.add(studyTypeNamesItem); + return this; + } + + /** + * The name of the type of study being performed. ex. \"Yield Trial\", etc + * @return studyTypeNames + **/ + @Schema(description = "The name of the type of study being performed. ex. \"Yield Trial\", etc") + public List getStudyTypeNames() { + return studyTypeNames; + } + + public void setStudyTypeNames(List studyTypeNames) { + this.studyTypeNames = studyTypeNames; + } + + public StudySearchRequest trialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + return this; + } + + public StudySearchRequest addTrialDbIdsItem(String trialDbIdsItem) { + if (this.trialDbIds == null) { + this.trialDbIds = new ArrayList(); + } + this.trialDbIds.add(trialDbIdsItem); + return this; + } + + /** + * List of trial identifiers to filter search results + * @return trialDbIds + **/ + @Schema(description = "List of trial identifiers to filter search results") + public List getTrialDbIds() { + return trialDbIds; + } + + public void setTrialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudySearchRequest studySearchRequest = (StudySearchRequest) o; + return Objects.equals(this.active, studySearchRequest.active) && + Objects.equals(this.commonCropNames, studySearchRequest.commonCropNames) && + Objects.equals(this.germplasmDbIds, studySearchRequest.germplasmDbIds) && + Objects.equals(this.locationDbIds, studySearchRequest.locationDbIds) && + Objects.equals(this.observationVariableDbIds, studySearchRequest.observationVariableDbIds) && + Objects.equals(this.page, studySearchRequest.page) && + Objects.equals(this.pageSize, studySearchRequest.pageSize) && + Objects.equals(this.programDbIds, studySearchRequest.programDbIds) && + Objects.equals(this.programNames, studySearchRequest.programNames) && + Objects.equals(this.seasonDbIds, studySearchRequest.seasonDbIds) && + Objects.equals(this.sortBy, studySearchRequest.sortBy) && + Objects.equals(this.sortOrder, studySearchRequest.sortOrder) && + Objects.equals(this.studyDbIds, studySearchRequest.studyDbIds) && + Objects.equals(this.studyNames, studySearchRequest.studyNames) && + Objects.equals(this.studyTypeDbIds, studySearchRequest.studyTypeDbIds) && + Objects.equals(this.studyTypeNames, studySearchRequest.studyTypeNames) && + Objects.equals(this.trialDbIds, studySearchRequest.trialDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(active, commonCropNames, germplasmDbIds, locationDbIds, observationVariableDbIds, page, pageSize, programDbIds, programNames, seasonDbIds, sortBy, sortOrder, studyDbIds, studyNames, studyTypeDbIds, studyTypeNames, trialDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudySearchRequest {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" commonCropNames: ").append(toIndentedString(commonCropNames)).append("\n"); + sb.append(" germplasmDbIds: ").append(toIndentedString(germplasmDbIds)).append("\n"); + sb.append(" locationDbIds: ").append(toIndentedString(locationDbIds)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" programDbIds: ").append(toIndentedString(programDbIds)).append("\n"); + sb.append(" programNames: ").append(toIndentedString(programNames)).append("\n"); + sb.append(" seasonDbIds: ").append(toIndentedString(seasonDbIds)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" studyDbIds: ").append(toIndentedString(studyDbIds)).append("\n"); + sb.append(" studyNames: ").append(toIndentedString(studyNames)).append("\n"); + sb.append(" studyTypeDbIds: ").append(toIndentedString(studyTypeDbIds)).append("\n"); + sb.append(" studyTypeNames: ").append(toIndentedString(studyTypeNames)).append("\n"); + sb.append(" trialDbIds: ").append(toIndentedString(trialDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequestDep.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequestDep.java new file mode 100755 index 00000000..cfdf19c4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudySearchRequestDep.java @@ -0,0 +1,609 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * StudySearchRequestDep + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudySearchRequestDep { + @SerializedName("active") + private Boolean active = null; + + @SerializedName("germplasmDbIds") + private List germplasmDbIds = null; + + @SerializedName("locationDbIds") + private List locationDbIds = null; + + @SerializedName("observationVariableDbIds") + private List observationVariableDbIds = null; + + @SerializedName("page") + private Integer page = null; + + @SerializedName("pageSize") + private Integer pageSize = null; + + @SerializedName("programDbIds") + private List programDbIds = null; + + @SerializedName("programNames") + private List programNames = null; + + @SerializedName("seasonDbId") + private List seasonDbId = null; + + /** + * Name of one of the fields within the study object on which results can be sorted + */ + @JsonAdapter(SortByEnum.Adapter.class) + public enum SortByEnum { + STUDYDBID("studyDbId"), + TRIALDBID("trialDbId"), + PROGRAMDBID("programDbId"), + LOCATIONDBID("locationDbId"), + SEASONDBID("seasonDbId"), + STUDYTYPE("studyType"), + STUDYNAME("studyName"), + STUDYLOCATION("studyLocation"), + PROGRAMNAME("programName"), + GERMPLASMDBID("germplasmDbId"), + OBSERVATIONVARIABLEDBID("observationVariableDbId"); + + private String value; + + SortByEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SortByEnum fromValue(String text) { + for (SortByEnum b : SortByEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SortByEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SortByEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SortByEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sortBy") + private SortByEnum sortBy = null; + + /** + * Order results should be sorted. ex. \"ASC\" or \"DESC\" + */ + @JsonAdapter(SortOrderEnum.Adapter.class) + public enum SortOrderEnum { + ASC("asc"), + DESC("desc"); + + private String value; + + SortOrderEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SortOrderEnum fromValue(String text) { + for (SortOrderEnum b : SortOrderEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SortOrderEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SortOrderEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SortOrderEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sortOrder") + private SortOrderEnum sortOrder = null; + + @SerializedName("studyDbIds") + private List studyDbIds = null; + + @SerializedName("studyLocations") + private List studyLocations = null; + + @SerializedName("studyNames") + private List studyNames = null; + + @SerializedName("studyType") + private String studyType = null; + + @SerializedName("trialDbIds") + private List trialDbIds = null; + + public StudySearchRequestDep active(Boolean active) { + this.active = active; + return this; + } + + /** + * Is this study currently active + * @return active + **/ + @Schema(description = "Is this study currently active") + public Boolean isActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public StudySearchRequestDep germplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + return this; + } + + public StudySearchRequestDep addGermplasmDbIdsItem(String germplasmDbIdsItem) { + if (this.germplasmDbIds == null) { + this.germplasmDbIds = new ArrayList(); + } + this.germplasmDbIds.add(germplasmDbIdsItem); + return this; + } + + /** + * List of IDs which uniquely identify germplasm + * @return germplasmDbIds + **/ + @Schema(description = "List of IDs which uniquely identify germplasm") + public List getGermplasmDbIds() { + return germplasmDbIds; + } + + public void setGermplasmDbIds(List germplasmDbIds) { + this.germplasmDbIds = germplasmDbIds; + } + + public StudySearchRequestDep locationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + return this; + } + + public StudySearchRequestDep addLocationDbIdsItem(String locationDbIdsItem) { + if (this.locationDbIds == null) { + this.locationDbIds = new ArrayList(); + } + this.locationDbIds.add(locationDbIdsItem); + return this; + } + + /** + * List of location identifiers to filter search results + * @return locationDbIds + **/ + @Schema(description = "List of location identifiers to filter search results") + public List getLocationDbIds() { + return locationDbIds; + } + + public void setLocationDbIds(List locationDbIds) { + this.locationDbIds = locationDbIds; + } + + public StudySearchRequestDep observationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + return this; + } + + public StudySearchRequestDep addObservationVariableDbIdsItem(String observationVariableDbIdsItem) { + if (this.observationVariableDbIds == null) { + this.observationVariableDbIds = new ArrayList(); + } + this.observationVariableDbIds.add(observationVariableDbIdsItem); + return this; + } + + /** + * List of observation variable IDs to search for + * @return observationVariableDbIds + **/ + @Schema(description = "List of observation variable IDs to search for") + public List getObservationVariableDbIds() { + return observationVariableDbIds; + } + + public void setObservationVariableDbIds(List observationVariableDbIds) { + this.observationVariableDbIds = observationVariableDbIds; + } + + public StudySearchRequestDep page(Integer page) { + this.page = page; + return this; + } + + /** + * Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0. + * @return page + **/ + @Schema(description = "Which page of the \"data\" array to return. The page indexing starts at 0 (page=0 will return the first page). Default is 0.") + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public StudySearchRequestDep pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The maximum number of items to return per page of the \"data\" array. Default is 1000. + * @return pageSize + **/ + @Schema(description = "The maximum number of items to return per page of the \"data\" array. Default is 1000.") + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public StudySearchRequestDep programDbIds(List programDbIds) { + this.programDbIds = programDbIds; + return this; + } + + public StudySearchRequestDep addProgramDbIdsItem(String programDbIdsItem) { + if (this.programDbIds == null) { + this.programDbIds = new ArrayList(); + } + this.programDbIds.add(programDbIdsItem); + return this; + } + + /** + * List of program identifiers to filter search results + * @return programDbIds + **/ + @Schema(description = "List of program identifiers to filter search results") + public List getProgramDbIds() { + return programDbIds; + } + + public void setProgramDbIds(List programDbIds) { + this.programDbIds = programDbIds; + } + + public StudySearchRequestDep programNames(List programNames) { + this.programNames = programNames; + return this; + } + + public StudySearchRequestDep addProgramNamesItem(String programNamesItem) { + if (this.programNames == null) { + this.programNames = new ArrayList(); + } + this.programNames.add(programNamesItem); + return this; + } + + /** + * List of program names to filter search results + * @return programNames + **/ + @Schema(description = "List of program names to filter search results") + public List getProgramNames() { + return programNames; + } + + public void setProgramNames(List programNames) { + this.programNames = programNames; + } + + public StudySearchRequestDep seasonDbId(List seasonDbId) { + this.seasonDbId = seasonDbId; + return this; + } + + public StudySearchRequestDep addSeasonDbIdItem(String seasonDbIdItem) { + if (this.seasonDbId == null) { + this.seasonDbId = new ArrayList(); + } + this.seasonDbId.add(seasonDbIdItem); + return this; + } + + /** + * The ID which uniquely identifies a season + * @return seasonDbId + **/ + @Schema(description = "The ID which uniquely identifies a season") + public List getSeasonDbId() { + return seasonDbId; + } + + public void setSeasonDbId(List seasonDbId) { + this.seasonDbId = seasonDbId; + } + + public StudySearchRequestDep sortBy(SortByEnum sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Name of one of the fields within the study object on which results can be sorted + * @return sortBy + **/ + @Schema(description = "Name of one of the fields within the study object on which results can be sorted") + public SortByEnum getSortBy() { + return sortBy; + } + + public void setSortBy(SortByEnum sortBy) { + this.sortBy = sortBy; + } + + public StudySearchRequestDep sortOrder(SortOrderEnum sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Order results should be sorted. ex. \"ASC\" or \"DESC\" + * @return sortOrder + **/ + @Schema(description = "Order results should be sorted. ex. \"ASC\" or \"DESC\"") + public SortOrderEnum getSortOrder() { + return sortOrder; + } + + public void setSortOrder(SortOrderEnum sortOrder) { + this.sortOrder = sortOrder; + } + + public StudySearchRequestDep studyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + return this; + } + + public StudySearchRequestDep addStudyDbIdsItem(String studyDbIdsItem) { + if (this.studyDbIds == null) { + this.studyDbIds = new ArrayList(); + } + this.studyDbIds.add(studyDbIdsItem); + return this; + } + + /** + * List of study identifiers to search for + * @return studyDbIds + **/ + @Schema(description = "List of study identifiers to search for") + public List getStudyDbIds() { + return studyDbIds; + } + + public void setStudyDbIds(List studyDbIds) { + this.studyDbIds = studyDbIds; + } + + public StudySearchRequestDep studyLocations(List studyLocations) { + this.studyLocations = studyLocations; + return this; + } + + public StudySearchRequestDep addStudyLocationsItem(String studyLocationsItem) { + if (this.studyLocations == null) { + this.studyLocations = new ArrayList(); + } + this.studyLocations.add(studyLocationsItem); + return this; + } + + /** + * List of location names to filter search results + * @return studyLocations + **/ + @Schema(description = "List of location names to filter search results") + public List getStudyLocations() { + return studyLocations; + } + + public void setStudyLocations(List studyLocations) { + this.studyLocations = studyLocations; + } + + public StudySearchRequestDep studyNames(List studyNames) { + this.studyNames = studyNames; + return this; + } + + public StudySearchRequestDep addStudyNamesItem(String studyNamesItem) { + if (this.studyNames == null) { + this.studyNames = new ArrayList(); + } + this.studyNames.add(studyNamesItem); + return this; + } + + /** + * List of study names to filter search results + * @return studyNames + **/ + @Schema(description = "List of study names to filter search results") + public List getStudyNames() { + return studyNames; + } + + public void setStudyNames(List studyNames) { + this.studyNames = studyNames; + } + + public StudySearchRequestDep studyType(String studyType) { + this.studyType = studyType; + return this; + } + + /** + * The type of study being performed. ex. \"Yeald Trial\", etc + * @return studyType + **/ + @Schema(description = "The type of study being performed. ex. \"Yeald Trial\", etc") + public String getStudyType() { + return studyType; + } + + public void setStudyType(String studyType) { + this.studyType = studyType; + } + + public StudySearchRequestDep trialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + return this; + } + + public StudySearchRequestDep addTrialDbIdsItem(String trialDbIdsItem) { + if (this.trialDbIds == null) { + this.trialDbIds = new ArrayList(); + } + this.trialDbIds.add(trialDbIdsItem); + return this; + } + + /** + * List of trial identifiers to filter search results + * @return trialDbIds + **/ + @Schema(description = "List of trial identifiers to filter search results") + public List getTrialDbIds() { + return trialDbIds; + } + + public void setTrialDbIds(List trialDbIds) { + this.trialDbIds = trialDbIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudySearchRequestDep studySearchRequestDep = (StudySearchRequestDep) o; + return Objects.equals(this.active, studySearchRequestDep.active) && + Objects.equals(this.germplasmDbIds, studySearchRequestDep.germplasmDbIds) && + Objects.equals(this.locationDbIds, studySearchRequestDep.locationDbIds) && + Objects.equals(this.observationVariableDbIds, studySearchRequestDep.observationVariableDbIds) && + Objects.equals(this.page, studySearchRequestDep.page) && + Objects.equals(this.pageSize, studySearchRequestDep.pageSize) && + Objects.equals(this.programDbIds, studySearchRequestDep.programDbIds) && + Objects.equals(this.programNames, studySearchRequestDep.programNames) && + Objects.equals(this.seasonDbId, studySearchRequestDep.seasonDbId) && + Objects.equals(this.sortBy, studySearchRequestDep.sortBy) && + Objects.equals(this.sortOrder, studySearchRequestDep.sortOrder) && + Objects.equals(this.studyDbIds, studySearchRequestDep.studyDbIds) && + Objects.equals(this.studyLocations, studySearchRequestDep.studyLocations) && + Objects.equals(this.studyNames, studySearchRequestDep.studyNames) && + Objects.equals(this.studyType, studySearchRequestDep.studyType) && + Objects.equals(this.trialDbIds, studySearchRequestDep.trialDbIds); + } + + @Override + public int hashCode() { + return Objects.hash(active, germplasmDbIds, locationDbIds, observationVariableDbIds, page, pageSize, programDbIds, programNames, seasonDbId, sortBy, sortOrder, studyDbIds, studyLocations, studyNames, studyType, trialDbIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudySearchRequestDep {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" germplasmDbIds: ").append(toIndentedString(germplasmDbIds)).append("\n"); + sb.append(" locationDbIds: ").append(toIndentedString(locationDbIds)).append("\n"); + sb.append(" observationVariableDbIds: ").append(toIndentedString(observationVariableDbIds)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" programDbIds: ").append(toIndentedString(programDbIds)).append("\n"); + sb.append(" programNames: ").append(toIndentedString(programNames)).append("\n"); + sb.append(" seasonDbId: ").append(toIndentedString(seasonDbId)).append("\n"); + sb.append(" sortBy: ").append(toIndentedString(sortBy)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" studyDbIds: ").append(toIndentedString(studyDbIds)).append("\n"); + sb.append(" studyLocations: ").append(toIndentedString(studyLocations)).append("\n"); + sb.append(" studyNames: ").append(toIndentedString(studyNames)).append("\n"); + sb.append(" studyType: ").append(toIndentedString(studyType)).append("\n"); + sb.append(" trialDbIds: ").append(toIndentedString(trialDbIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudySummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudySummary.java new file mode 100755 index 00000000..a636ae7d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudySummary.java @@ -0,0 +1,523 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Season; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * StudySummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudySummary { + @SerializedName("active") + private String active = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("endDate") + private LocalDate endDate = null; + + @SerializedName("locationDbId") + private String locationDbId = null; + + @SerializedName("locationName") + private String locationName = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("programDbId") + private String programDbId = null; + + @SerializedName("programName") + private String programName = null; + + @SerializedName("seasons") + private List seasons = null; + + @SerializedName("startDate") + private LocalDate startDate = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("studyName") + private String studyName = null; + + @SerializedName("studyType") + private String studyType = null; + + @SerializedName("studyTypeDbId") + private String studyTypeDbId = null; + + @SerializedName("studyTypeName") + private String studyTypeName = null; + + @SerializedName("trialDbId") + private String trialDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public StudySummary active(String active) { + this.active = active; + return this; + } + + /** + * Is this study currently active + * @return active + **/ + @Schema(description = "Is this study currently active") + public String getActive() { + return active; + } + + public void setActive(String active) { + this.active = active; + } + + public StudySummary additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public StudySummary putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public StudySummary commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop associated with this study + * @return commonCropName + **/ + @Schema(description = "Common name for the crop associated with this study") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public StudySummary documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public StudySummary endDate(LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The date the study ends + * @return endDate + **/ + @Schema(description = "The date the study ends") + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(LocalDate endDate) { + this.endDate = endDate; + } + + public StudySummary locationDbId(String locationDbId) { + this.locationDbId = locationDbId; + return this; + } + + /** + * The ID which uniquely identifies a location + * @return locationDbId + **/ + @Schema(description = "The ID which uniquely identifies a location") + public String getLocationDbId() { + return locationDbId; + } + + public void setLocationDbId(String locationDbId) { + this.locationDbId = locationDbId; + } + + public StudySummary locationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * The human readable name for a location + * @return locationName + **/ + @Schema(description = "The human readable name for a location") + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public StudySummary name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"studyName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"studyName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public StudySummary programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * The ID which uniquely identifies a program within the given database server + * @return programDbId + **/ + @Schema(description = "The ID which uniquely identifies a program within the given database server") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + public StudySummary programName(String programName) { + this.programName = programName; + return this; + } + + /** + * The humane readable name of a program + * @return programName + **/ + @Schema(description = "The humane readable name of a program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + public StudySummary seasons(List seasons) { + this.seasons = seasons; + return this; + } + + public StudySummary addSeasonsItem(Season seasonsItem) { + if (this.seasons == null) { + this.seasons = new ArrayList(); + } + this.seasons.add(seasonsItem); + return this; + } + + /** + * List of seasons over which this study was performed. + * @return seasons + **/ + @Schema(description = "List of seasons over which this study was performed.") + public List getSeasons() { + return seasons; + } + + public void setSeasons(List seasons) { + this.seasons = seasons; + } + + public StudySummary startDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The date this study started + * @return startDate + **/ + @Schema(description = "The date this study started") + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public StudySummary studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * The ID which uniquely identifies a study within the given database server + * @return studyDbId + **/ + @Schema(description = "The ID which uniquely identifies a study within the given database server") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public StudySummary studyName(String studyName) { + this.studyName = studyName; + return this; + } + + /** + * The humane readable name of a study + * @return studyName + **/ + @Schema(description = "The humane readable name of a study") + public String getStudyName() { + return studyName; + } + + public void setStudyName(String studyName) { + this.studyName = studyName; + } + + public StudySummary studyType(String studyType) { + this.studyType = studyType; + return this; + } + + /** + * DEPRECATED in v1.3 - See \"studyTypeName\" + * @return studyType + **/ + @Schema(description = "DEPRECATED in v1.3 - See \"studyTypeName\"") + public String getStudyType() { + return studyType; + } + + public void setStudyType(String studyType) { + this.studyType = studyType; + } + + public StudySummary studyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + return this; + } + + /** + * The unique identifier of the type of study being performed. + * @return studyTypeDbId + **/ + @Schema(description = "The unique identifier of the type of study being performed.") + public String getStudyTypeDbId() { + return studyTypeDbId; + } + + public void setStudyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + } + + public StudySummary studyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + return this; + } + + /** + * The name of the type of study being performed. ex. \"Yield Trial\", etc + * @return studyTypeName + **/ + @Schema(description = "The name of the type of study being performed. ex. \"Yield Trial\", etc") + public String getStudyTypeName() { + return studyTypeName; + } + + public void setStudyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + } + + public StudySummary trialDbId(String trialDbId) { + this.trialDbId = trialDbId; + return this; + } + + /** + * The ID which uniquely identifies a trial + * @return trialDbId + **/ + @Schema(description = "The ID which uniquely identifies a trial") + public String getTrialDbId() { + return trialDbId; + } + + public void setTrialDbId(String trialDbId) { + this.trialDbId = trialDbId; + } + + public StudySummary trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * The human readable name of a trial + * @return trialName + **/ + @Schema(description = "The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudySummary studySummary = (StudySummary) o; + return Objects.equals(this.active, studySummary.active) && + Objects.equals(this.additionalInfo, studySummary.additionalInfo) && + Objects.equals(this.commonCropName, studySummary.commonCropName) && + Objects.equals(this.documentationURL, studySummary.documentationURL) && + Objects.equals(this.endDate, studySummary.endDate) && + Objects.equals(this.locationDbId, studySummary.locationDbId) && + Objects.equals(this.locationName, studySummary.locationName) && + Objects.equals(this.name, studySummary.name) && + Objects.equals(this.programDbId, studySummary.programDbId) && + Objects.equals(this.programName, studySummary.programName) && + Objects.equals(this.seasons, studySummary.seasons) && + Objects.equals(this.startDate, studySummary.startDate) && + Objects.equals(this.studyDbId, studySummary.studyDbId) && + Objects.equals(this.studyName, studySummary.studyName) && + Objects.equals(this.studyType, studySummary.studyType) && + Objects.equals(this.studyTypeDbId, studySummary.studyTypeDbId) && + Objects.equals(this.studyTypeName, studySummary.studyTypeName) && + Objects.equals(this.trialDbId, studySummary.trialDbId) && + Objects.equals(this.trialName, studySummary.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(active, additionalInfo, commonCropName, documentationURL, endDate, locationDbId, locationName, name, programDbId, programName, seasons, startDate, studyDbId, studyName, studyType, studyTypeDbId, studyTypeName, trialDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudySummary {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" locationDbId: ").append(toIndentedString(locationDbId)).append("\n"); + sb.append(" locationName: ").append(toIndentedString(locationName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).append("\n"); + sb.append(" seasons: ").append(toIndentedString(seasons)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" studyName: ").append(toIndentedString(studyName)).append("\n"); + sb.append(" studyType: ").append(toIndentedString(studyType)).append("\n"); + sb.append(" studyTypeDbId: ").append(toIndentedString(studyTypeDbId)).append("\n"); + sb.append(" studyTypeName: ").append(toIndentedString(studyTypeName)).append("\n"); + sb.append(" trialDbId: ").append(toIndentedString(trialDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyType.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyType.java new file mode 100755 index 00000000..bde9a13d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyType.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyType + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyType { + @SerializedName("description") + private String description = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("studyTypeDbId") + private String studyTypeDbId = null; + + @SerializedName("studyTypeName") + private String studyTypeName = null; + + public StudyType description(String description) { + this.description = description; + return this; + } + + /** + * The description of this study type + * @return description + **/ + @Schema(description = "The description of this study type") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public StudyType name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"studyTypeName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"studyTypeName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public StudyType studyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + return this; + } + + /** + * The unique identifier of a study type + * @return studyTypeDbId + **/ + @Schema(description = "The unique identifier of a study type") + public String getStudyTypeDbId() { + return studyTypeDbId; + } + + public void setStudyTypeDbId(String studyTypeDbId) { + this.studyTypeDbId = studyTypeDbId; + } + + public StudyType studyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + return this; + } + + /** + * The human readable name of a study type + * @return studyTypeName + **/ + @Schema(description = "The human readable name of a study type") + public String getStudyTypeName() { + return studyTypeName; + } + + public void setStudyTypeName(String studyTypeName) { + this.studyTypeName = studyTypeName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyType studyType = (StudyType) o; + return Objects.equals(this.description, studyType.description) && + Objects.equals(this.name, studyType.name) && + Objects.equals(this.studyTypeDbId, studyType.studyTypeDbId) && + Objects.equals(this.studyTypeName, studyType.studyTypeName); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, studyTypeDbId, studyTypeName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyType {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" studyTypeDbId: ").append(toIndentedString(studyTypeDbId)).append("\n"); + sb.append(" studyTypeName: ").append(toIndentedString(studyTypeName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse.java new file mode 100755 index 00000000..18b6972d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudyTypesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyTypesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyTypesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudyTypesResponseResult result = null; + + public StudyTypesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyTypesResponse result(StudyTypesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public StudyTypesResponseResult getResult() { + return result; + } + + public void setResult(StudyTypesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyTypesResponse studyTypesResponse = (StudyTypesResponse) o; + return Objects.equals(this.metadata, studyTypesResponse.metadata) && + Objects.equals(this.result, studyTypesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyTypesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1.java new file mode 100755 index 00000000..626d20a3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.StudyTypesResponse1Result; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyTypesResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyTypesResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private StudyTypesResponse1Result result = null; + + public StudyTypesResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyTypesResponse1 result(StudyTypesResponse1Result result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public StudyTypesResponse1Result getResult() { + return result; + } + + public void setResult(StudyTypesResponse1Result result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyTypesResponse1 studyTypesResponse1 = (StudyTypesResponse1) o; + return Objects.equals(this.metadata, studyTypesResponse1.metadata) && + Objects.equals(this.result, studyTypesResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyTypesResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1Result.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1Result.java new file mode 100755 index 00000000..6f2955b0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponse1Result.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.StudyType; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudyTypesResponse1Result + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyTypesResponse1Result { + @SerializedName("data") + private List data = new ArrayList(); + + public StudyTypesResponse1Result data(List data) { + this.data = data; + return this; + } + + public StudyTypesResponse1Result addDataItem(StudyType dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyTypesResponse1Result studyTypesResponse1Result = (StudyTypesResponse1Result) o; + return Objects.equals(this.data, studyTypesResponse1Result.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyTypesResponse1Result {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponseResult.java new file mode 100755 index 00000000..f51371ea --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyTypesResponseResult.java @@ -0,0 +1,98 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.StudyType; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * StudyTypesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyTypesResponseResult { + @SerializedName("data") + private List data = null; + + public StudyTypesResponseResult data(List data) { + this.data = data; + return this; + } + + public StudyTypesResponseResult addDataItem(StudyType dataItem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyTypesResponseResult studyTypesResponseResult = (StudyTypesResponseResult) o; + return Objects.equals(this.data, studyTypesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyTypesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/StudyobservationsTableResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/StudyobservationsTableResponse.java new file mode 100755 index 00000000..8f15bd83 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/StudyobservationsTableResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.ObservationsTable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * StudyobservationsTableResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class StudyobservationsTableResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private ObservationsTable result = null; + + public StudyobservationsTableResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public StudyobservationsTableResponse result(ObservationsTable result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public ObservationsTable getResult() { + return result; + } + + public void setResult(ObservationsTable result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StudyobservationsTableResponse studyobservationsTableResponse = (StudyobservationsTableResponse) o; + return Objects.equals(this.metadata, studyobservationsTableResponse.metadata) && + Objects.equals(this.result, studyobservationsTableResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StudyobservationsTableResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponse.java new file mode 100755 index 00000000..956eff9e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.SuccessfulSearchResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SuccessfulSearchResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SuccessfulSearchResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private SuccessfulSearchResponseResult result = null; + + public SuccessfulSearchResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public SuccessfulSearchResponse result(SuccessfulSearchResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public SuccessfulSearchResponseResult getResult() { + return result; + } + + public void setResult(SuccessfulSearchResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuccessfulSearchResponse successfulSearchResponse = (SuccessfulSearchResponse) o; + return Objects.equals(this.metadata, successfulSearchResponse.metadata) && + Objects.equals(this.result, successfulSearchResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuccessfulSearchResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponseResult.java new file mode 100755 index 00000000..53b73122 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/SuccessfulSearchResponseResult.java @@ -0,0 +1,87 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * SuccessfulSearchResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class SuccessfulSearchResponseResult { + @SerializedName("searchResultDbId") + private String searchResultDbId = null; + + public SuccessfulSearchResponseResult searchResultDbId(String searchResultDbId) { + this.searchResultDbId = searchResultDbId; + return this; + } + + /** + * Get searchResultDbId + * @return searchResultDbId + **/ + @Schema(description = "") + public String getSearchResultDbId() { + return searchResultDbId; + } + + public void setSearchResultDbId(String searchResultDbId) { + this.searchResultDbId = searchResultDbId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuccessfulSearchResponseResult successfulSearchResponseResult = (SuccessfulSearchResponseResult) o; + return Objects.equals(this.searchResultDbId, successfulSearchResponseResult.searchResultDbId); + } + + @Override + public int hashCode() { + return Objects.hash(searchResultDbId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuccessfulSearchResponseResult {\n"); + + sb.append(" searchResultDbId: ").append(toIndentedString(searchResultDbId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TaxonID.java b/brapi-client/src/main/resources/swagger-generated-client/model/TaxonID.java new file mode 100755 index 00000000..33f19063 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TaxonID.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TaxonID + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TaxonID { + @SerializedName("sourceName") + private String sourceName = null; + + @SerializedName("taxonId") + private String taxonId = null; + + public TaxonID sourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + + /** + * The human readable name of the taxonomy provider + * @return sourceName + **/ + @Schema(required = true, description = "The human readable name of the taxonomy provider") + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public TaxonID taxonId(String taxonId) { + this.taxonId = taxonId; + return this; + } + + /** + * The identifier (name, ID, URI) of a particular taxonomy within the source provider + * @return taxonId + **/ + @Schema(required = true, description = "The identifier (name, ID, URI) of a particular taxonomy within the source provider") + public String getTaxonId() { + return taxonId; + } + + public void setTaxonId(String taxonId) { + this.taxonId = taxonId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxonID taxonID = (TaxonID) o; + return Objects.equals(this.sourceName, taxonID.sourceName) && + Objects.equals(this.taxonId, taxonID.taxonId); + } + + @Override + public int hashCode() { + return Objects.hash(sourceName, taxonId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TaxonID {\n"); + + sb.append(" sourceName: ").append(toIndentedString(sourceName)).append("\n"); + sb.append(" taxonId: ").append(toIndentedString(taxonId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Trait.java b/brapi-client/src/main/resources/swagger-generated-client/model/Trait.java new file mode 100755 index 00000000..ed3c97bb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Trait.java @@ -0,0 +1,382 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.OntologyReference; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Trait + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Trait { + @SerializedName("alternativeAbbreviations") + private List alternativeAbbreviations = null; + + @SerializedName("attribute") + private String attribute = null; + + @SerializedName("class") + private String propertyClass = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("entity") + private String entity = null; + + @SerializedName("mainAbbreviation") + private String mainAbbreviation = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("status") + private String status = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("traitDbId") + private String traitDbId = null; + + @SerializedName("traitName") + private String traitName = null; + + @SerializedName("xref") + private String xref = null; + + public Trait alternativeAbbreviations(List alternativeAbbreviations) { + this.alternativeAbbreviations = alternativeAbbreviations; + return this; + } + + public Trait addAlternativeAbbreviationsItem(String alternativeAbbreviationsItem) { + if (this.alternativeAbbreviations == null) { + this.alternativeAbbreviations = new ArrayList(); + } + this.alternativeAbbreviations.add(alternativeAbbreviationsItem); + return this; + } + + /** + * Other frequent abbreviations of the trait, if any. These abbreviations do not have to follow a convention + * @return alternativeAbbreviations + **/ + @Schema(description = "Other frequent abbreviations of the trait, if any. These abbreviations do not have to follow a convention") + public List getAlternativeAbbreviations() { + return alternativeAbbreviations; + } + + public void setAlternativeAbbreviations(List alternativeAbbreviations) { + this.alternativeAbbreviations = alternativeAbbreviations; + } + + public Trait attribute(String attribute) { + this.attribute = attribute; + return this; + } + + /** + * A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the attribute is the observed feature (or characteristic) of the entity e.g., for \"grain colour\", attribute = \"colour\" + * @return attribute + **/ + @Schema(description = "A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the attribute is the observed feature (or characteristic) of the entity e.g., for \"grain colour\", attribute = \"colour\"") + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public Trait propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Trait class. (examples: \"morphological trait\", \"phenological trait\", \"agronomical trait\", \"physiological trait\", \"abiotic stress trait\", \"biotic stress trait\", \"biochemical trait\", \"quality traits trait\", \"fertility trait\", etc.) + * @return propertyClass + **/ + @Schema(description = "Trait class. (examples: \"morphological trait\", \"phenological trait\", \"agronomical trait\", \"physiological trait\", \"abiotic stress trait\", \"biotic stress trait\", \"biochemical trait\", \"quality traits trait\", \"fertility trait\", etc.)") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Trait description(String description) { + this.description = description; + return this; + } + + /** + * The description of a trait + * @return description + **/ + @Schema(description = "The description of a trait") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Trait entity(String entity) { + this.entity = entity; + return this; + } + + /** + * A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the entity is the part of the plant that the trait refers to e.g., for \"grain colour\", entity = \"grain\" + * @return entity + **/ + @Schema(description = "A trait can be decomposed as \"Trait\" = \"Entity\" + \"Attribute\", the entity is the part of the plant that the trait refers to e.g., for \"grain colour\", entity = \"grain\"") + public String getEntity() { + return entity; + } + + public void setEntity(String entity) { + this.entity = entity; + } + + public Trait mainAbbreviation(String mainAbbreviation) { + this.mainAbbreviation = mainAbbreviation; + return this; + } + + /** + * Main abbreviation for trait name. (examples: \"Carotenoid content\" => \"CC\") + * @return mainAbbreviation + **/ + @Schema(description = "Main abbreviation for trait name. (examples: \"Carotenoid content\" => \"CC\")") + public String getMainAbbreviation() { + return mainAbbreviation; + } + + public void setMainAbbreviation(String mainAbbreviation) { + this.mainAbbreviation = mainAbbreviation; + } + + public Trait name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"traitName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"traitName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Trait ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public Trait status(String status) { + this.status = status; + return this; + } + + /** + * Trait status (examples: \"recommended\", \"obsolete\", \"legacy\", etc.) + * @return status + **/ + @Schema(description = "Trait status (examples: \"recommended\", \"obsolete\", \"legacy\", etc.)") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Trait synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public Trait addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * Other trait names + * @return synonyms + **/ + @Schema(description = "Other trait names") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public Trait traitDbId(String traitDbId) { + this.traitDbId = traitDbId; + return this; + } + + /** + * The ID which uniquely identifies a trait + * @return traitDbId + **/ + @Schema(description = "The ID which uniquely identifies a trait") + public String getTraitDbId() { + return traitDbId; + } + + public void setTraitDbId(String traitDbId) { + this.traitDbId = traitDbId; + } + + public Trait traitName(String traitName) { + this.traitName = traitName; + return this; + } + + /** + * The human readable name of a trait + * @return traitName + **/ + @Schema(description = "The human readable name of a trait") + public String getTraitName() { + return traitName; + } + + public void setTraitName(String traitName) { + this.traitName = traitName; + } + + public Trait xref(String xref) { + this.xref = xref; + return this; + } + + /** + * Cross reference of the trait to an external ontology or database term e.g., Xref to a trait ontology (TO) term + * @return xref + **/ + @Schema(description = "Cross reference of the trait to an external ontology or database term e.g., Xref to a trait ontology (TO) term") + public String getXref() { + return xref; + } + + public void setXref(String xref) { + this.xref = xref; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Trait trait = (Trait) o; + return Objects.equals(this.alternativeAbbreviations, trait.alternativeAbbreviations) && + Objects.equals(this.attribute, trait.attribute) && + Objects.equals(this.propertyClass, trait.propertyClass) && + Objects.equals(this.description, trait.description) && + Objects.equals(this.entity, trait.entity) && + Objects.equals(this.mainAbbreviation, trait.mainAbbreviation) && + Objects.equals(this.name, trait.name) && + Objects.equals(this.ontologyReference, trait.ontologyReference) && + Objects.equals(this.status, trait.status) && + Objects.equals(this.synonyms, trait.synonyms) && + Objects.equals(this.traitDbId, trait.traitDbId) && + Objects.equals(this.traitName, trait.traitName) && + Objects.equals(this.xref, trait.xref); + } + + @Override + public int hashCode() { + return Objects.hash(alternativeAbbreviations, attribute, propertyClass, description, entity, mainAbbreviation, name, ontologyReference, status, synonyms, traitDbId, traitName, xref); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Trait {\n"); + + sb.append(" alternativeAbbreviations: ").append(toIndentedString(alternativeAbbreviations)).append("\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" mainAbbreviation: ").append(toIndentedString(mainAbbreviation)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" traitDbId: ").append(toIndentedString(traitDbId)).append("\n"); + sb.append(" traitName: ").append(toIndentedString(traitName)).append("\n"); + sb.append(" xref: ").append(toIndentedString(xref)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitDataType.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitDataType.java new file mode 100755 index 00000000..3df5c3c4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitDataType.java @@ -0,0 +1,72 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Class of the scale, entries can be \"Code\" - This scale class is exceptionally used to express complex traits. Code is a nominal scale that combines the expressions of the different traits composing the complex trait. For exemple a severity trait might be expressed by a 2 digit and 2 character code. The first 2 digits are the percentage of the plant covered by a fungus and the 2 characters refer to the delay in development, e.g. \"75VD\" means \"75%\" of the plant is Crop Ontology & Integrated Breeding Platform | Curation Guidelines | 5/6/2016 9 infected and the plant is very delayed. \"Date\" - The date class is for events expressed in a time format, e.g. yyyymmddThh:mm:ssZ or dd/mm/yy \"Duration\" - The Duration class is for time elapsed between two events expressed in a time format, e.g. days, hours, months \"Nominal\" - Categorical scale that can take one of a limited and fixed number of categories. There is no intrinsic ordering to the categories \"Numerical\" - Numerical scales express the trait with real numbers. The numerical scale defines the unit e.g. centimeter, ton per hectar, branches \"Ordinal\" - Ordinal scales are scales composed of ordered categories \"Text\" - A free text is used to express the trait. + */ +@JsonAdapter(TraitDataType.Adapter.class) +public enum TraitDataType { + CODE("Code"), + DURATION("Duration"), + NOMINAL("Nominal"), + NUMERICAL("Numerical"), + ORDINAL("Ordinal"), + TEXT("Text"), + DATE("Date"); + + private String value; + + TraitDataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TraitDataType fromValue(String text) { + for (TraitDataType b : TraitDataType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TraitDataType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TraitDataType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TraitDataType.fromValue(String.valueOf(value)); + } + } +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitResponse.java new file mode 100755 index 00000000..36700b08 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Trait; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TraitResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TraitResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Trait result = null; + + public TraitResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public TraitResponse result(Trait result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Trait getResult() { + return result; + } + + public void setResult(Trait result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TraitResponse traitResponse = (TraitResponse) o; + return Objects.equals(this.metadata, traitResponse.metadata) && + Objects.equals(this.result, traitResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TraitResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummary.java new file mode 100755 index 00000000..285e5ee8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummary.java @@ -0,0 +1,235 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * TraitSummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TraitSummary { + @SerializedName("defaultValue") + private String defaultValue = null; + + @SerializedName("description") + private String description = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("observationVariables") + private List observationVariables = null; + + @SerializedName("traitDbId") + private String traitDbId = null; + + @SerializedName("traitId") + private String traitId = null; + + @SerializedName("traitName") + private String traitName = null; + + public TraitSummary defaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * The default value of a trait (if applicable) ex. \"0\", \"\", \"null\" + * @return defaultValue + **/ + @Schema(description = "The default value of a trait (if applicable) ex. \"0\", \"\", \"null\"") + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public TraitSummary description(String description) { + this.description = description; + return this; + } + + /** + * The description of a trait + * @return description + **/ + @Schema(description = "The description of a trait") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public TraitSummary name(String name) { + this.name = name; + return this; + } + + /** + * DEPRECATED in v1.3 - Use \"traitName\" + * @return name + **/ + @Schema(description = "DEPRECATED in v1.3 - Use \"traitName\"") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TraitSummary observationVariables(List observationVariables) { + this.observationVariables = observationVariables; + return this; + } + + public TraitSummary addObservationVariablesItem(String observationVariablesItem) { + if (this.observationVariables == null) { + this.observationVariables = new ArrayList(); + } + this.observationVariables.add(observationVariablesItem); + return this; + } + + /** + * List of observation variable DbIds which include this trait + * @return observationVariables + **/ + @Schema(description = "List of observation variable DbIds which include this trait") + public List getObservationVariables() { + return observationVariables; + } + + public void setObservationVariables(List observationVariables) { + this.observationVariables = observationVariables; + } + + public TraitSummary traitDbId(String traitDbId) { + this.traitDbId = traitDbId; + return this; + } + + /** + * The ID which uniquely identifies a trait + * @return traitDbId + **/ + @Schema(description = "The ID which uniquely identifies a trait") + public String getTraitDbId() { + return traitDbId; + } + + public void setTraitDbId(String traitDbId) { + this.traitDbId = traitDbId; + } + + public TraitSummary traitId(String traitId) { + this.traitId = traitId; + return this; + } + + /** + * DEPRECATED The ID which uniquely identifies a trait + * @return traitId + **/ + @Schema(description = "DEPRECATED The ID which uniquely identifies a trait") + public String getTraitId() { + return traitId; + } + + public void setTraitId(String traitId) { + this.traitId = traitId; + } + + public TraitSummary traitName(String traitName) { + this.traitName = traitName; + return this; + } + + /** + * The human readable name of a trait + * @return traitName + **/ + @Schema(description = "The human readable name of a trait") + public String getTraitName() { + return traitName; + } + + public void setTraitName(String traitName) { + this.traitName = traitName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TraitSummary traitSummary = (TraitSummary) o; + return Objects.equals(this.defaultValue, traitSummary.defaultValue) && + Objects.equals(this.description, traitSummary.description) && + Objects.equals(this.name, traitSummary.name) && + Objects.equals(this.observationVariables, traitSummary.observationVariables) && + Objects.equals(this.traitDbId, traitSummary.traitDbId) && + Objects.equals(this.traitId, traitSummary.traitId) && + Objects.equals(this.traitName, traitSummary.traitName); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, description, name, observationVariables, traitDbId, traitId, traitName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TraitSummary {\n"); + + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" observationVariables: ").append(toIndentedString(observationVariables)).append("\n"); + sb.append(" traitDbId: ").append(toIndentedString(traitDbId)).append("\n"); + sb.append(" traitId: ").append(toIndentedString(traitId)).append("\n"); + sb.append(" traitName: ").append(toIndentedString(traitName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummaryResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummaryResponse.java new file mode 100755 index 00000000..243050af --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitSummaryResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.TraitSummary; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TraitSummaryResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TraitSummaryResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private TraitSummary result = null; + + public TraitSummaryResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public TraitSummaryResponse result(TraitSummary result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public TraitSummary getResult() { + return result; + } + + public void setResult(TraitSummary result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TraitSummaryResponse traitSummaryResponse = (TraitSummaryResponse) o; + return Objects.equals(this.metadata, traitSummaryResponse.metadata) && + Objects.equals(this.result, traitSummaryResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TraitSummaryResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponse.java new file mode 100755 index 00000000..afaac9bf --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.TraitsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TraitsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TraitsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private TraitsResponseResult result = null; + + public TraitsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public TraitsResponse result(TraitsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public TraitsResponseResult getResult() { + return result; + } + + public void setResult(TraitsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TraitsResponse traitsResponse = (TraitsResponse) o; + return Objects.equals(this.metadata, traitsResponse.metadata) && + Objects.equals(this.result, traitsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TraitsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponseResult.java new file mode 100755 index 00000000..ed22be61 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TraitsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.TraitSummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * TraitsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TraitsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public TraitsResponseResult data(List data) { + this.data = data; + return this; + } + + public TraitsResponseResult addDataItem(TraitSummary dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TraitsResponseResult traitsResponseResult = (TraitsResponseResult) o; + return Objects.equals(this.data, traitsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TraitsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/Trial.java b/brapi-client/src/main/resources/swagger-generated-client/model/Trial.java new file mode 100755 index 00000000..cb1ea385 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/Trial.java @@ -0,0 +1,459 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Contact; +import io.swagger.client.model.TrialDatasetAuthorship; +import io.swagger.client.model.TrialDatasetAuthorships; +import io.swagger.client.model.TrialPublications; +import io.swagger.client.model.TrialStudies; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * Trial + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class Trial { + @SerializedName("active") + private Boolean active = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("contacts") + private List contacts = null; + + @SerializedName("datasetAuthorship") + private TrialDatasetAuthorship datasetAuthorship = null; + + @SerializedName("datasetAuthorships") + private List datasetAuthorships = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("endDate") + private LocalDate endDate = null; + + @SerializedName("programDbId") + private String programDbId = null; + + @SerializedName("programName") + private String programName = null; + + @SerializedName("publications") + private List publications = null; + + @SerializedName("startDate") + private LocalDate startDate = null; + + @SerializedName("studies") + private List studies = null; + + @SerializedName("trialDbId") + private String trialDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public Trial active(Boolean active) { + this.active = active; + return this; + } + + /** + * Is this trail currently active + * @return active + **/ + @Schema(description = "Is this trail currently active") + public Boolean isActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public Trial additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public Trial putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public Trial commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop associated with this trial + * @return commonCropName + **/ + @Schema(description = "Common name for the crop associated with this trial") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public Trial contacts(List contacts) { + this.contacts = contacts; + return this; + } + + public Trial addContactsItem(Contact contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * List of contact entities associated with this trial + * @return contacts + **/ + @Schema(description = "List of contact entities associated with this trial") + public List getContacts() { + return contacts; + } + + public void setContacts(List contacts) { + this.contacts = contacts; + } + + public Trial datasetAuthorship(TrialDatasetAuthorship datasetAuthorship) { + this.datasetAuthorship = datasetAuthorship; + return this; + } + + /** + * Get datasetAuthorship + * @return datasetAuthorship + **/ + @Schema(description = "") + public TrialDatasetAuthorship getDatasetAuthorship() { + return datasetAuthorship; + } + + public void setDatasetAuthorship(TrialDatasetAuthorship datasetAuthorship) { + this.datasetAuthorship = datasetAuthorship; + } + + public Trial datasetAuthorships(List datasetAuthorships) { + this.datasetAuthorships = datasetAuthorships; + return this; + } + + public Trial addDatasetAuthorshipsItem(TrialDatasetAuthorships datasetAuthorshipsItem) { + if (this.datasetAuthorships == null) { + this.datasetAuthorships = new ArrayList(); + } + this.datasetAuthorships.add(datasetAuthorshipsItem); + return this; + } + + /** + * License and citation information for the data in this trial + * @return datasetAuthorships + **/ + @Schema(description = "License and citation information for the data in this trial") + public List getDatasetAuthorships() { + return datasetAuthorships; + } + + public void setDatasetAuthorships(List datasetAuthorships) { + this.datasetAuthorships = datasetAuthorships; + } + + public Trial documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public Trial endDate(LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The date this trial ends + * @return endDate + **/ + @Schema(description = "The date this trial ends") + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(LocalDate endDate) { + this.endDate = endDate; + } + + public Trial programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * A program identifier to search for + * @return programDbId + **/ + @Schema(description = "A program identifier to search for") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + public Trial programName(String programName) { + this.programName = programName; + return this; + } + + /** + * The human readable name of a program + * @return programName + **/ + @Schema(description = "The human readable name of a program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + public Trial publications(List publications) { + this.publications = publications; + return this; + } + + public Trial addPublicationsItem(TrialPublications publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + **/ + @Schema(description = "") + public List getPublications() { + return publications; + } + + public void setPublications(List publications) { + this.publications = publications; + } + + public Trial startDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The date this trial started + * @return startDate + **/ + @Schema(description = "The date this trial started") + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public Trial studies(List studies) { + this.studies = studies; + return this; + } + + public Trial addStudiesItem(TrialStudies studiesItem) { + if (this.studies == null) { + this.studies = new ArrayList(); + } + this.studies.add(studiesItem); + return this; + } + + /** + * List of studies inside this trial + * @return studies + **/ + @Schema(description = "List of studies inside this trial") + public List getStudies() { + return studies; + } + + public void setStudies(List studies) { + this.studies = studies; + } + + public Trial trialDbId(String trialDbId) { + this.trialDbId = trialDbId; + return this; + } + + /** + * The ID which uniquely identifies a trial + * @return trialDbId + **/ + @Schema(description = "The ID which uniquely identifies a trial") + public String getTrialDbId() { + return trialDbId; + } + + public void setTrialDbId(String trialDbId) { + this.trialDbId = trialDbId; + } + + public Trial trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * The human readable name of a trial + * @return trialName + **/ + @Schema(description = "The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Trial trial = (Trial) o; + return Objects.equals(this.active, trial.active) && + Objects.equals(this.additionalInfo, trial.additionalInfo) && + Objects.equals(this.commonCropName, trial.commonCropName) && + Objects.equals(this.contacts, trial.contacts) && + Objects.equals(this.datasetAuthorship, trial.datasetAuthorship) && + Objects.equals(this.datasetAuthorships, trial.datasetAuthorships) && + Objects.equals(this.documentationURL, trial.documentationURL) && + Objects.equals(this.endDate, trial.endDate) && + Objects.equals(this.programDbId, trial.programDbId) && + Objects.equals(this.programName, trial.programName) && + Objects.equals(this.publications, trial.publications) && + Objects.equals(this.startDate, trial.startDate) && + Objects.equals(this.studies, trial.studies) && + Objects.equals(this.trialDbId, trial.trialDbId) && + Objects.equals(this.trialName, trial.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(active, additionalInfo, commonCropName, contacts, datasetAuthorship, datasetAuthorships, documentationURL, endDate, programDbId, programName, publications, startDate, studies, trialDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Trial {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" datasetAuthorship: ").append(toIndentedString(datasetAuthorship)).append("\n"); + sb.append(" datasetAuthorships: ").append(toIndentedString(datasetAuthorships)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" studies: ").append(toIndentedString(studies)).append("\n"); + sb.append(" trialDbId: ").append(toIndentedString(trialDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorship.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorship.java new file mode 100755 index 00000000..3cd17dc3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorship.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * DEPRECATED in v1.3 - see datasetAuthorships + */ +@Schema(description = "DEPRECATED in v1.3 - see datasetAuthorships") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialDatasetAuthorship { + @SerializedName("datasetPUI") + private String datasetPUI = null; + + @SerializedName("license") + private String license = null; + + public TrialDatasetAuthorship datasetPUI(String datasetPUI) { + this.datasetPUI = datasetPUI; + return this; + } + + /** + * Get datasetPUI + * @return datasetPUI + **/ + @Schema(description = "") + public String getDatasetPUI() { + return datasetPUI; + } + + public void setDatasetPUI(String datasetPUI) { + this.datasetPUI = datasetPUI; + } + + public TrialDatasetAuthorship license(String license) { + this.license = license; + return this; + } + + /** + * Get license + * @return license + **/ + @Schema(description = "") + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialDatasetAuthorship trialDatasetAuthorship = (TrialDatasetAuthorship) o; + return Objects.equals(this.datasetPUI, trialDatasetAuthorship.datasetPUI) && + Objects.equals(this.license, trialDatasetAuthorship.license); + } + + @Override + public int hashCode() { + return Objects.hash(datasetPUI, license); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialDatasetAuthorship {\n"); + + sb.append(" datasetPUI: ").append(toIndentedString(datasetPUI)).append("\n"); + sb.append(" license: ").append(toIndentedString(license)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorships.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorships.java new file mode 100755 index 00000000..7afefb95 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialDatasetAuthorships.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TrialDatasetAuthorships + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialDatasetAuthorships { + @SerializedName("datasetPUI") + private String datasetPUI = null; + + @SerializedName("license") + private String license = null; + + public TrialDatasetAuthorships datasetPUI(String datasetPUI) { + this.datasetPUI = datasetPUI; + return this; + } + + /** + * Get datasetPUI + * @return datasetPUI + **/ + @Schema(description = "") + public String getDatasetPUI() { + return datasetPUI; + } + + public void setDatasetPUI(String datasetPUI) { + this.datasetPUI = datasetPUI; + } + + public TrialDatasetAuthorships license(String license) { + this.license = license; + return this; + } + + /** + * Get license + * @return license + **/ + @Schema(description = "") + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialDatasetAuthorships trialDatasetAuthorships = (TrialDatasetAuthorships) o; + return Objects.equals(this.datasetPUI, trialDatasetAuthorships.datasetPUI) && + Objects.equals(this.license, trialDatasetAuthorships.license); + } + + @Override + public int hashCode() { + return Objects.hash(datasetPUI, license); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialDatasetAuthorships {\n"); + + sb.append(" datasetPUI: ").append(toIndentedString(datasetPUI)).append("\n"); + sb.append(" license: ").append(toIndentedString(license)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialPublications.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialPublications.java new file mode 100755 index 00000000..aa83a506 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialPublications.java @@ -0,0 +1,110 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TrialPublications + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialPublications { + @SerializedName("publicationPUI") + private String publicationPUI = null; + + @SerializedName("publicationReference") + private String publicationReference = null; + + public TrialPublications publicationPUI(String publicationPUI) { + this.publicationPUI = publicationPUI; + return this; + } + + /** + * Get publicationPUI + * @return publicationPUI + **/ + @Schema(description = "") + public String getPublicationPUI() { + return publicationPUI; + } + + public void setPublicationPUI(String publicationPUI) { + this.publicationPUI = publicationPUI; + } + + public TrialPublications publicationReference(String publicationReference) { + this.publicationReference = publicationReference; + return this; + } + + /** + * Get publicationReference + * @return publicationReference + **/ + @Schema(description = "") + public String getPublicationReference() { + return publicationReference; + } + + public void setPublicationReference(String publicationReference) { + this.publicationReference = publicationReference; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialPublications trialPublications = (TrialPublications) o; + return Objects.equals(this.publicationPUI, trialPublications.publicationPUI) && + Objects.equals(this.publicationReference, trialPublications.publicationReference); + } + + @Override + public int hashCode() { + return Objects.hash(publicationPUI, publicationReference); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialPublications {\n"); + + sb.append(" publicationPUI: ").append(toIndentedString(publicationPUI)).append("\n"); + sb.append(" publicationReference: ").append(toIndentedString(publicationReference)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialResponse.java new file mode 100755 index 00000000..c339a538 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.Trial; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TrialResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private Trial result = null; + + public TrialResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public TrialResponse result(Trial result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public Trial getResult() { + return result; + } + + public void setResult(Trial result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialResponse trialResponse = (TrialResponse) o; + return Objects.equals(this.metadata, trialResponse.metadata) && + Objects.equals(this.result, trialResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialStudies.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialStudies.java new file mode 100755 index 00000000..5f2dfe6d --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialStudies.java @@ -0,0 +1,156 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TrialStudies + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialStudies { + @SerializedName("locationDbId") + private String locationDbId = null; + + @SerializedName("locationName") + private String locationName = null; + + @SerializedName("studyDbId") + private String studyDbId = null; + + @SerializedName("studyName") + private String studyName = null; + + public TrialStudies locationDbId(String locationDbId) { + this.locationDbId = locationDbId; + return this; + } + + /** + * Get locationDbId + * @return locationDbId + **/ + @Schema(description = "") + public String getLocationDbId() { + return locationDbId; + } + + public void setLocationDbId(String locationDbId) { + this.locationDbId = locationDbId; + } + + public TrialStudies locationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * Get locationName + * @return locationName + **/ + @Schema(description = "") + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public TrialStudies studyDbId(String studyDbId) { + this.studyDbId = studyDbId; + return this; + } + + /** + * Get studyDbId + * @return studyDbId + **/ + @Schema(description = "") + public String getStudyDbId() { + return studyDbId; + } + + public void setStudyDbId(String studyDbId) { + this.studyDbId = studyDbId; + } + + public TrialStudies studyName(String studyName) { + this.studyName = studyName; + return this; + } + + /** + * Get studyName + * @return studyName + **/ + @Schema(description = "") + public String getStudyName() { + return studyName; + } + + public void setStudyName(String studyName) { + this.studyName = studyName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialStudies trialStudies = (TrialStudies) o; + return Objects.equals(this.locationDbId, trialStudies.locationDbId) && + Objects.equals(this.locationName, trialStudies.locationName) && + Objects.equals(this.studyDbId, trialStudies.studyDbId) && + Objects.equals(this.studyName, trialStudies.studyName); + } + + @Override + public int hashCode() { + return Objects.hash(locationDbId, locationName, studyDbId, studyName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialStudies {\n"); + + sb.append(" locationDbId: ").append(toIndentedString(locationDbId)).append("\n"); + sb.append(" locationName: ").append(toIndentedString(locationName)).append("\n"); + sb.append(" studyDbId: ").append(toIndentedString(studyDbId)).append("\n"); + sb.append(" studyName: ").append(toIndentedString(studyName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialSummary.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialSummary.java new file mode 100755 index 00000000..dbf97b01 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialSummary.java @@ -0,0 +1,339 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.TrialStudies; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.LocalDate; +/** + * TrialSummary + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialSummary { + @SerializedName("active") + private Boolean active = null; + + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("commonCropName") + private String commonCropName = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("endDate") + private LocalDate endDate = null; + + @SerializedName("programDbId") + private String programDbId = null; + + @SerializedName("programName") + private String programName = null; + + @SerializedName("startDate") + private LocalDate startDate = null; + + @SerializedName("studies") + private List studies = null; + + @SerializedName("trialDbId") + private String trialDbId = null; + + @SerializedName("trialName") + private String trialName = null; + + public TrialSummary active(Boolean active) { + this.active = active; + return this; + } + + /** + * Is this trail currently active + * @return active + **/ + @Schema(description = "Is this trail currently active") + public Boolean isActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public TrialSummary additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public TrialSummary putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public TrialSummary commonCropName(String commonCropName) { + this.commonCropName = commonCropName; + return this; + } + + /** + * Common name for the crop associated with this trial + * @return commonCropName + **/ + @Schema(description = "Common name for the crop associated with this trial") + public String getCommonCropName() { + return commonCropName; + } + + public void setCommonCropName(String commonCropName) { + this.commonCropName = commonCropName; + } + + public TrialSummary documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public TrialSummary endDate(LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The date this trial ends + * @return endDate + **/ + @Schema(description = "The date this trial ends") + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(LocalDate endDate) { + this.endDate = endDate; + } + + public TrialSummary programDbId(String programDbId) { + this.programDbId = programDbId; + return this; + } + + /** + * The ID which uniquely identifies a program + * @return programDbId + **/ + @Schema(description = "The ID which uniquely identifies a program") + public String getProgramDbId() { + return programDbId; + } + + public void setProgramDbId(String programDbId) { + this.programDbId = programDbId; + } + + public TrialSummary programName(String programName) { + this.programName = programName; + return this; + } + + /** + * The human readable name of a program + * @return programName + **/ + @Schema(description = "The human readable name of a program") + public String getProgramName() { + return programName; + } + + public void setProgramName(String programName) { + this.programName = programName; + } + + public TrialSummary startDate(LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The date this trial started + * @return startDate + **/ + @Schema(description = "The date this trial started") + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(LocalDate startDate) { + this.startDate = startDate; + } + + public TrialSummary studies(List studies) { + this.studies = studies; + return this; + } + + public TrialSummary addStudiesItem(TrialStudies studiesItem) { + if (this.studies == null) { + this.studies = new ArrayList(); + } + this.studies.add(studiesItem); + return this; + } + + /** + * List of studies inside this trial + * @return studies + **/ + @Schema(description = "List of studies inside this trial") + public List getStudies() { + return studies; + } + + public void setStudies(List studies) { + this.studies = studies; + } + + public TrialSummary trialDbId(String trialDbId) { + this.trialDbId = trialDbId; + return this; + } + + /** + * The ID which uniquely identifies a trial + * @return trialDbId + **/ + @Schema(description = "The ID which uniquely identifies a trial") + public String getTrialDbId() { + return trialDbId; + } + + public void setTrialDbId(String trialDbId) { + this.trialDbId = trialDbId; + } + + public TrialSummary trialName(String trialName) { + this.trialName = trialName; + return this; + } + + /** + * The human readable name of a trial + * @return trialName + **/ + @Schema(description = "The human readable name of a trial") + public String getTrialName() { + return trialName; + } + + public void setTrialName(String trialName) { + this.trialName = trialName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialSummary trialSummary = (TrialSummary) o; + return Objects.equals(this.active, trialSummary.active) && + Objects.equals(this.additionalInfo, trialSummary.additionalInfo) && + Objects.equals(this.commonCropName, trialSummary.commonCropName) && + Objects.equals(this.documentationURL, trialSummary.documentationURL) && + Objects.equals(this.endDate, trialSummary.endDate) && + Objects.equals(this.programDbId, trialSummary.programDbId) && + Objects.equals(this.programName, trialSummary.programName) && + Objects.equals(this.startDate, trialSummary.startDate) && + Objects.equals(this.studies, trialSummary.studies) && + Objects.equals(this.trialDbId, trialSummary.trialDbId) && + Objects.equals(this.trialName, trialSummary.trialName); + } + + @Override + public int hashCode() { + return Objects.hash(active, additionalInfo, commonCropName, documentationURL, endDate, programDbId, programName, startDate, studies, trialDbId, trialName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialSummary {\n"); + + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" commonCropName: ").append(toIndentedString(commonCropName)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n"); + sb.append(" programName: ").append(toIndentedString(programName)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" studies: ").append(toIndentedString(studies)).append("\n"); + sb.append(" trialDbId: ").append(toIndentedString(trialDbId)).append("\n"); + sb.append(" trialName: ").append(toIndentedString(trialName)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponse.java new file mode 100755 index 00000000..2fa556f2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.TrialsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * TrialsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private TrialsResponseResult result = null; + + public TrialsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public TrialsResponse result(TrialsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public TrialsResponseResult getResult() { + return result; + } + + public void setResult(TrialsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialsResponse trialsResponse = (TrialsResponse) o; + return Objects.equals(this.metadata, trialsResponse.metadata) && + Objects.equals(this.result, trialsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponseResult.java new file mode 100755 index 00000000..86332c43 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/TrialsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.TrialSummary; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * TrialsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class TrialsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public TrialsResponseResult data(List data) { + this.data = data; + return this; + } + + public TrialsResponseResult addDataItem(TrialSummary dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrialsResponseResult trialsResponseResult = (TrialsResponseResult) o; + return Objects.equals(this.data, trialsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrialsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/ValidValues.java b/brapi-client/src/main/resources/swagger-generated-client/model/ValidValues.java new file mode 100755 index 00000000..ae48f6aa --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/ValidValues.java @@ -0,0 +1,143 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * ValidValues + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class ValidValues { + @SerializedName("categories") + private List categories = null; + + @SerializedName("max") + private Integer max = null; + + @SerializedName("min") + private Integer min = null; + + public ValidValues categories(List categories) { + this.categories = categories; + return this; + } + + public ValidValues addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * List of possible values and their meaning (examples: [\"0=low\", \"1=medium\", \"2=high\"] + * @return categories + **/ + @Schema(description = "List of possible values and their meaning (examples: [\"0=low\", \"1=medium\", \"2=high\"]") + public List getCategories() { + return categories; + } + + public void setCategories(List categories) { + this.categories = categories; + } + + public ValidValues max(Integer max) { + this.max = max; + return this; + } + + /** + * Maximum value (used for field data capture control). + * @return max + **/ + @Schema(description = "Maximum value (used for field data capture control).") + public Integer getMax() { + return max; + } + + public void setMax(Integer max) { + this.max = max; + } + + public ValidValues min(Integer min) { + this.min = min; + return this; + } + + /** + * Minimum value (used for data capture control) for numerical and date scales + * @return min + **/ + @Schema(description = "Minimum value (used for data capture control) for numerical and date scales") + public Integer getMin() { + return min; + } + + public void setMin(Integer min) { + this.min = min; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidValues validValues = (ValidValues) o; + return Objects.equals(this.categories, validValues.categories) && + Objects.equals(this.max, validValues.max) && + Objects.equals(this.min, validValues.min); + } + + @Override + public int hashCode() { + return Objects.hash(categories, max, min); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidValues {\n"); + + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" min: ").append(toIndentedString(min)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VariableBaseClass.java b/brapi-client/src/main/resources/swagger-generated-client/model/VariableBaseClass.java new file mode 100755 index 00000000..33b1ccce --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VariableBaseClass.java @@ -0,0 +1,501 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Method; +import io.swagger.client.model.OntologyReference; +import io.swagger.client.model.Scale; +import io.swagger.client.model.Trait; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +import org.threeten.bp.OffsetDateTime; +/** + * VariableBaseClass + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VariableBaseClass { + @SerializedName("contextOfUse") + private List contextOfUse = null; + + @SerializedName("crop") + private String crop = null; + + @SerializedName("defaultValue") + private String defaultValue = null; + + @SerializedName("documentationURL") + private String documentationURL = null; + + @SerializedName("growthStage") + private String growthStage = null; + + @SerializedName("institution") + private String institution = null; + + @SerializedName("language") + private String language = null; + + @SerializedName("method") + private Method method = null; + + @SerializedName("ontologyDbId") + private String ontologyDbId = null; + + @SerializedName("ontologyName") + private String ontologyName = null; + + @SerializedName("ontologyReference") + private OntologyReference ontologyReference = null; + + @SerializedName("scale") + private Scale scale = null; + + @SerializedName("scientist") + private String scientist = null; + + @SerializedName("status") + private String status = null; + + @SerializedName("submissionTimestamp") + private OffsetDateTime submissionTimestamp = null; + + @SerializedName("synonyms") + private List synonyms = null; + + @SerializedName("trait") + private Trait trait = null; + + @SerializedName("xref") + private String xref = null; + + public VariableBaseClass contextOfUse(List contextOfUse) { + this.contextOfUse = contextOfUse; + return this; + } + + public VariableBaseClass addContextOfUseItem(String contextOfUseItem) { + if (this.contextOfUse == null) { + this.contextOfUse = new ArrayList(); + } + this.contextOfUse.add(contextOfUseItem); + return this; + } + + /** + * Indication of how trait is routinely used. (examples: [\"Trial evaluation\", \"Nursery evaluation\"]) + * @return contextOfUse + **/ + @Schema(description = "Indication of how trait is routinely used. (examples: [\"Trial evaluation\", \"Nursery evaluation\"])") + public List getContextOfUse() { + return contextOfUse; + } + + public void setContextOfUse(List contextOfUse) { + this.contextOfUse = contextOfUse; + } + + public VariableBaseClass crop(String crop) { + this.crop = crop; + return this; + } + + /** + * Crop name (examples: \"Maize\", \"Wheat\") + * @return crop + **/ + @Schema(description = "Crop name (examples: \"Maize\", \"Wheat\")") + public String getCrop() { + return crop; + } + + public void setCrop(String crop) { + this.crop = crop; + } + + public VariableBaseClass defaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Variable default value. (examples: \"red\", \"2.3\", etc.) + * @return defaultValue + **/ + @Schema(description = "Variable default value. (examples: \"red\", \"2.3\", etc.)") + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public VariableBaseClass documentationURL(String documentationURL) { + this.documentationURL = documentationURL; + return this; + } + + /** + * A URL to the human readable documentation of this object + * @return documentationURL + **/ + @Schema(description = "A URL to the human readable documentation of this object") + public String getDocumentationURL() { + return documentationURL; + } + + public void setDocumentationURL(String documentationURL) { + this.documentationURL = documentationURL; + } + + public VariableBaseClass growthStage(String growthStage) { + this.growthStage = growthStage; + return this; + } + + /** + * Growth stage at which measurement is made (examples: \"flowering\") + * @return growthStage + **/ + @Schema(description = "Growth stage at which measurement is made (examples: \"flowering\")") + public String getGrowthStage() { + return growthStage; + } + + public void setGrowthStage(String growthStage) { + this.growthStage = growthStage; + } + + public VariableBaseClass institution(String institution) { + this.institution = institution; + return this; + } + + /** + * Name of institution submitting the variable + * @return institution + **/ + @Schema(description = "Name of institution submitting the variable") + public String getInstitution() { + return institution; + } + + public void setInstitution(String institution) { + this.institution = institution; + } + + public VariableBaseClass language(String language) { + this.language = language; + return this; + } + + /** + * 2 letter ISO code for the language of submission of the variable. + * @return language + **/ + @Schema(description = "2 letter ISO code for the language of submission of the variable.") + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public VariableBaseClass method(Method method) { + this.method = method; + return this; + } + + /** + * Get method + * @return method + **/ + @Schema(required = true, description = "") + public Method getMethod() { + return method; + } + + public void setMethod(Method method) { + this.method = method; + } + + public VariableBaseClass ontologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.ontologyReference.ontologyDbId\" + * @return ontologyDbId + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.ontologyReference.ontologyDbId\"") + public String getOntologyDbId() { + return ontologyDbId; + } + + public void setOntologyDbId(String ontologyDbId) { + this.ontologyDbId = ontologyDbId; + } + + public VariableBaseClass ontologyName(String ontologyName) { + this.ontologyName = ontologyName; + return this; + } + + /** + * DEPRECATED in v1.3 - see \"this.ontologyReference.ontologyName\" + * @return ontologyName + **/ + @Schema(description = "DEPRECATED in v1.3 - see \"this.ontologyReference.ontologyName\"") + public String getOntologyName() { + return ontologyName; + } + + public void setOntologyName(String ontologyName) { + this.ontologyName = ontologyName; + } + + public VariableBaseClass ontologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + return this; + } + + /** + * Get ontologyReference + * @return ontologyReference + **/ + @Schema(description = "") + public OntologyReference getOntologyReference() { + return ontologyReference; + } + + public void setOntologyReference(OntologyReference ontologyReference) { + this.ontologyReference = ontologyReference; + } + + public VariableBaseClass scale(Scale scale) { + this.scale = scale; + return this; + } + + /** + * Get scale + * @return scale + **/ + @Schema(required = true, description = "") + public Scale getScale() { + return scale; + } + + public void setScale(Scale scale) { + this.scale = scale; + } + + public VariableBaseClass scientist(String scientist) { + this.scientist = scientist; + return this; + } + + /** + * Name of scientist submitting the variable. + * @return scientist + **/ + @Schema(description = "Name of scientist submitting the variable.") + public String getScientist() { + return scientist; + } + + public void setScientist(String scientist) { + this.scientist = scientist; + } + + public VariableBaseClass status(String status) { + this.status = status; + return this; + } + + /** + * Variable status. (examples: \"recommended\", \"obsolete\", \"legacy\", etc.) + * @return status + **/ + @Schema(description = "Variable status. (examples: \"recommended\", \"obsolete\", \"legacy\", etc.)") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public VariableBaseClass submissionTimestamp(OffsetDateTime submissionTimestamp) { + this.submissionTimestamp = submissionTimestamp; + return this; + } + + /** + * Timestamp when the Variable was added (ISO 8601) + * @return submissionTimestamp + **/ + @Schema(description = "Timestamp when the Variable was added (ISO 8601)") + public OffsetDateTime getSubmissionTimestamp() { + return submissionTimestamp; + } + + public void setSubmissionTimestamp(OffsetDateTime submissionTimestamp) { + this.submissionTimestamp = submissionTimestamp; + } + + public VariableBaseClass synonyms(List synonyms) { + this.synonyms = synonyms; + return this; + } + + public VariableBaseClass addSynonymsItem(String synonymsItem) { + if (this.synonyms == null) { + this.synonyms = new ArrayList(); + } + this.synonyms.add(synonymsItem); + return this; + } + + /** + * Other variable names + * @return synonyms + **/ + @Schema(description = "Other variable names") + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + } + + public VariableBaseClass trait(Trait trait) { + this.trait = trait; + return this; + } + + /** + * Get trait + * @return trait + **/ + @Schema(required = true, description = "") + public Trait getTrait() { + return trait; + } + + public void setTrait(Trait trait) { + this.trait = trait; + } + + public VariableBaseClass xref(String xref) { + this.xref = xref; + return this; + } + + /** + * Cross reference of the variable term to a term from an external ontology or to a database of a major system. + * @return xref + **/ + @Schema(description = "Cross reference of the variable term to a term from an external ontology or to a database of a major system.") + public String getXref() { + return xref; + } + + public void setXref(String xref) { + this.xref = xref; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VariableBaseClass variableBaseClass = (VariableBaseClass) o; + return Objects.equals(this.contextOfUse, variableBaseClass.contextOfUse) && + Objects.equals(this.crop, variableBaseClass.crop) && + Objects.equals(this.defaultValue, variableBaseClass.defaultValue) && + Objects.equals(this.documentationURL, variableBaseClass.documentationURL) && + Objects.equals(this.growthStage, variableBaseClass.growthStage) && + Objects.equals(this.institution, variableBaseClass.institution) && + Objects.equals(this.language, variableBaseClass.language) && + Objects.equals(this.method, variableBaseClass.method) && + Objects.equals(this.ontologyDbId, variableBaseClass.ontologyDbId) && + Objects.equals(this.ontologyName, variableBaseClass.ontologyName) && + Objects.equals(this.ontologyReference, variableBaseClass.ontologyReference) && + Objects.equals(this.scale, variableBaseClass.scale) && + Objects.equals(this.scientist, variableBaseClass.scientist) && + Objects.equals(this.status, variableBaseClass.status) && + Objects.equals(this.submissionTimestamp, variableBaseClass.submissionTimestamp) && + Objects.equals(this.synonyms, variableBaseClass.synonyms) && + Objects.equals(this.trait, variableBaseClass.trait) && + Objects.equals(this.xref, variableBaseClass.xref); + } + + @Override + public int hashCode() { + return Objects.hash(contextOfUse, crop, defaultValue, documentationURL, growthStage, institution, language, method, ontologyDbId, ontologyName, ontologyReference, scale, scientist, status, submissionTimestamp, synonyms, trait, xref); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VariableBaseClass {\n"); + + sb.append(" contextOfUse: ").append(toIndentedString(contextOfUse)).append("\n"); + sb.append(" crop: ").append(toIndentedString(crop)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" documentationURL: ").append(toIndentedString(documentationURL)).append("\n"); + sb.append(" growthStage: ").append(toIndentedString(growthStage)).append("\n"); + sb.append(" institution: ").append(toIndentedString(institution)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" ontologyDbId: ").append(toIndentedString(ontologyDbId)).append("\n"); + sb.append(" ontologyName: ").append(toIndentedString(ontologyName)).append("\n"); + sb.append(" ontologyReference: ").append(toIndentedString(ontologyReference)).append("\n"); + sb.append(" scale: ").append(toIndentedString(scale)).append("\n"); + sb.append(" scientist: ").append(toIndentedString(scientist)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" submissionTimestamp: ").append(toIndentedString(submissionTimestamp)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" trait: ").append(toIndentedString(trait)).append("\n"); + sb.append(" xref: ").append(toIndentedString(xref)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorContact.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorContact.java new file mode 100755 index 00000000..a8973db8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorContact.java @@ -0,0 +1,271 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorContact + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorContact { + @SerializedName("vendorAddress") + private String vendorAddress = null; + + @SerializedName("vendorCity") + private String vendorCity = null; + + @SerializedName("vendorContactName") + private String vendorContactName = null; + + @SerializedName("vendorCountry") + private String vendorCountry = null; + + @SerializedName("vendorDescription") + private String vendorDescription = null; + + @SerializedName("vendorEmail") + private String vendorEmail = null; + + @SerializedName("vendorName") + private String vendorName = null; + + @SerializedName("vendorPhone") + private String vendorPhone = null; + + @SerializedName("vendorURL") + private String vendorURL = null; + + public VendorContact vendorAddress(String vendorAddress) { + this.vendorAddress = vendorAddress; + return this; + } + + /** + * The street address of the vendor + * @return vendorAddress + **/ + @Schema(description = "The street address of the vendor") + public String getVendorAddress() { + return vendorAddress; + } + + public void setVendorAddress(String vendorAddress) { + this.vendorAddress = vendorAddress; + } + + public VendorContact vendorCity(String vendorCity) { + this.vendorCity = vendorCity; + return this; + } + + /** + * The name of the city where the vendor is located + * @return vendorCity + **/ + @Schema(description = "The name of the city where the vendor is located") + public String getVendorCity() { + return vendorCity; + } + + public void setVendorCity(String vendorCity) { + this.vendorCity = vendorCity; + } + + public VendorContact vendorContactName(String vendorContactName) { + this.vendorContactName = vendorContactName; + return this; + } + + /** + * The name or identifier of the primary vendor contact + * @return vendorContactName + **/ + @Schema(description = "The name or identifier of the primary vendor contact") + public String getVendorContactName() { + return vendorContactName; + } + + public void setVendorContactName(String vendorContactName) { + this.vendorContactName = vendorContactName; + } + + public VendorContact vendorCountry(String vendorCountry) { + this.vendorCountry = vendorCountry; + return this; + } + + /** + * The name of the country where the vendor is located + * @return vendorCountry + **/ + @Schema(description = "The name of the country where the vendor is located") + public String getVendorCountry() { + return vendorCountry; + } + + public void setVendorCountry(String vendorCountry) { + this.vendorCountry = vendorCountry; + } + + public VendorContact vendorDescription(String vendorDescription) { + this.vendorDescription = vendorDescription; + return this; + } + + /** + * A description of the vendor + * @return vendorDescription + **/ + @Schema(description = "A description of the vendor") + public String getVendorDescription() { + return vendorDescription; + } + + public void setVendorDescription(String vendorDescription) { + this.vendorDescription = vendorDescription; + } + + public VendorContact vendorEmail(String vendorEmail) { + this.vendorEmail = vendorEmail; + return this; + } + + /** + * The primary email address used to contact the vendor + * @return vendorEmail + **/ + @Schema(description = "The primary email address used to contact the vendor") + public String getVendorEmail() { + return vendorEmail; + } + + public void setVendorEmail(String vendorEmail) { + this.vendorEmail = vendorEmail; + } + + public VendorContact vendorName(String vendorName) { + this.vendorName = vendorName; + return this; + } + + /** + * The human readable name of the vendor + * @return vendorName + **/ + @Schema(description = "The human readable name of the vendor") + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public VendorContact vendorPhone(String vendorPhone) { + this.vendorPhone = vendorPhone; + return this; + } + + /** + * The primary phone number used to contact the vendor + * @return vendorPhone + **/ + @Schema(description = "The primary phone number used to contact the vendor") + public String getVendorPhone() { + return vendorPhone; + } + + public void setVendorPhone(String vendorPhone) { + this.vendorPhone = vendorPhone; + } + + public VendorContact vendorURL(String vendorURL) { + this.vendorURL = vendorURL; + return this; + } + + /** + * The primary URL for the vendor + * @return vendorURL + **/ + @Schema(description = "The primary URL for the vendor") + public String getVendorURL() { + return vendorURL; + } + + public void setVendorURL(String vendorURL) { + this.vendorURL = vendorURL; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorContact vendorContact = (VendorContact) o; + return Objects.equals(this.vendorAddress, vendorContact.vendorAddress) && + Objects.equals(this.vendorCity, vendorContact.vendorCity) && + Objects.equals(this.vendorContactName, vendorContact.vendorContactName) && + Objects.equals(this.vendorCountry, vendorContact.vendorCountry) && + Objects.equals(this.vendorDescription, vendorContact.vendorDescription) && + Objects.equals(this.vendorEmail, vendorContact.vendorEmail) && + Objects.equals(this.vendorName, vendorContact.vendorName) && + Objects.equals(this.vendorPhone, vendorContact.vendorPhone) && + Objects.equals(this.vendorURL, vendorContact.vendorURL); + } + + @Override + public int hashCode() { + return Objects.hash(vendorAddress, vendorCity, vendorContactName, vendorCountry, vendorDescription, vendorEmail, vendorName, vendorPhone, vendorURL); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorContact {\n"); + + sb.append(" vendorAddress: ").append(toIndentedString(vendorAddress)).append("\n"); + sb.append(" vendorCity: ").append(toIndentedString(vendorCity)).append("\n"); + sb.append(" vendorContactName: ").append(toIndentedString(vendorContactName)).append("\n"); + sb.append(" vendorCountry: ").append(toIndentedString(vendorCountry)).append("\n"); + sb.append(" vendorDescription: ").append(toIndentedString(vendorDescription)).append("\n"); + sb.append(" vendorEmail: ").append(toIndentedString(vendorEmail)).append("\n"); + sb.append(" vendorName: ").append(toIndentedString(vendorName)).append("\n"); + sb.append(" vendorPhone: ").append(toIndentedString(vendorPhone)).append("\n"); + sb.append(" vendorURL: ").append(toIndentedString(vendorURL)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOntologyReference.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOntologyReference.java new file mode 100755 index 00000000..e629f330 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOntologyReference.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Ontology reference details + */ +@Schema(description = "Ontology reference details") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOntologyReference { + @SerializedName("ontologyID") + private String ontologyID = null; + + @SerializedName("ontologyPrefix") + private String ontologyPrefix = null; + + @SerializedName("ontologyTerm") + private String ontologyTerm = null; + + public VendorOntologyReference ontologyID(String ontologyID) { + this.ontologyID = ontologyID; + return this; + } + + /** + * Ontology unique ID (example: \"0025034\" or \"4577\") + * @return ontologyID + **/ + @Schema(description = "Ontology unique ID (example: \"0025034\" or \"4577\")") + public String getOntologyID() { + return ontologyID; + } + + public void setOntologyID(String ontologyID) { + this.ontologyID = ontologyID; + } + + public VendorOntologyReference ontologyPrefix(String ontologyPrefix) { + this.ontologyPrefix = ontologyPrefix; + return this; + } + + /** + * Ontology identifier prefix (example: \"PO\" or \"NCBITaxon\") + * @return ontologyPrefix + **/ + @Schema(description = "Ontology identifier prefix (example: \"PO\" or \"NCBITaxon\")") + public String getOntologyPrefix() { + return ontologyPrefix; + } + + public void setOntologyPrefix(String ontologyPrefix) { + this.ontologyPrefix = ontologyPrefix; + } + + public VendorOntologyReference ontologyTerm(String ontologyTerm) { + this.ontologyTerm = ontologyTerm; + return this; + } + + /** + * Ontology term string (example: \"leaf\" or \"Zea mays\") + * @return ontologyTerm + **/ + @Schema(description = "Ontology term string (example: \"leaf\" or \"Zea mays\")") + public String getOntologyTerm() { + return ontologyTerm; + } + + public void setOntologyTerm(String ontologyTerm) { + this.ontologyTerm = ontologyTerm; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOntologyReference vendorOntologyReference = (VendorOntologyReference) o; + return Objects.equals(this.ontologyID, vendorOntologyReference.ontologyID) && + Objects.equals(this.ontologyPrefix, vendorOntologyReference.ontologyPrefix) && + Objects.equals(this.ontologyTerm, vendorOntologyReference.ontologyTerm); + } + + @Override + public int hashCode() { + return Objects.hash(ontologyID, ontologyPrefix, ontologyTerm); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOntologyReference {\n"); + + sb.append(" ontologyID: ").append(toIndentedString(ontologyID)).append("\n"); + sb.append(" ontologyPrefix: ").append(toIndentedString(ontologyPrefix)).append("\n"); + sb.append(" ontologyTerm: ").append(toIndentedString(ontologyTerm)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrder.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrder.java new file mode 100755 index 00000000..34cc11d0 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrder.java @@ -0,0 +1,189 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.HashMap; +import java.util.Map; +/** + * The details of a vendor order + */ +@Schema(description = "The details of a vendor order") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrder { + @SerializedName("clientId") + private String clientId = null; + + @SerializedName("numberOfSamples") + private Integer numberOfSamples = null; + + @SerializedName("orderId") + private String orderId = null; + + @SerializedName("requiredServiceInfo") + private Map requiredServiceInfo = null; + + @SerializedName("serviceId") + private String serviceId = null; + + public VendorOrder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the correct billing and contact info. + * @return clientId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the correct billing and contact info.") + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public VendorOrder numberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + return this; + } + + /** + * The total number of samples contained in this request. Used for billing and basic validation of the request. + * @return numberOfSamples + **/ + @Schema(description = "The total number of samples contained in this request. Used for billing and basic validation of the request.") + public Integer getNumberOfSamples() { + return numberOfSamples; + } + + public void setNumberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + } + + public VendorOrder orderId(String orderId) { + this.orderId = orderId; + return this; + } + + /** + * The order id returned by the vendor when the order was successfully submitted. + * @return orderId + **/ + @Schema(description = "The order id returned by the vendor when the order was successfully submitted.") + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public VendorOrder requiredServiceInfo(Map requiredServiceInfo) { + this.requiredServiceInfo = requiredServiceInfo; + return this; + } + + public VendorOrder putRequiredServiceInfoItem(String key, String requiredServiceInfoItem) { + if (this.requiredServiceInfo == null) { + this.requiredServiceInfo = new HashMap(); + } + this.requiredServiceInfo.put(key, requiredServiceInfoItem); + return this; + } + + /** + * A map of additional data required by the requested service. This includes things like Volume and Concentration. + * @return requiredServiceInfo + **/ + @Schema(description = "A map of additional data required by the requested service. This includes things like Volume and Concentration.") + public Map getRequiredServiceInfo() { + return requiredServiceInfo; + } + + public void setRequiredServiceInfo(Map requiredServiceInfo) { + this.requiredServiceInfo = requiredServiceInfo; + } + + public VendorOrder serviceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the requested service to be used for this order. The service defines what platform, technology, and markers will be used. A list of service IDs can be retrieved from the Vendor Specs. + * @return serviceId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the requested service to be used for this order. The service defines what platform, technology, and markers will be used. A list of service IDs can be retrieved from the Vendor Specs.") + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrder vendorOrder = (VendorOrder) o; + return Objects.equals(this.clientId, vendorOrder.clientId) && + Objects.equals(this.numberOfSamples, vendorOrder.numberOfSamples) && + Objects.equals(this.orderId, vendorOrder.orderId) && + Objects.equals(this.requiredServiceInfo, vendorOrder.requiredServiceInfo) && + Objects.equals(this.serviceId, vendorOrder.serviceId); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, numberOfSamples, orderId, requiredServiceInfo, serviceId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrder {\n"); + + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" numberOfSamples: ").append(toIndentedString(numberOfSamples)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" requiredServiceInfo: ").append(toIndentedString(requiredServiceInfo)).append("\n"); + sb.append(" serviceId: ").append(toIndentedString(serviceId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequest.java new file mode 100755 index 00000000..31bedb60 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequest.java @@ -0,0 +1,277 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.VendorOrderRequestPlates; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * Request object structure to submit plate data to a vendor + */ +@Schema(description = "Request object structure to submit plate data to a vendor") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderRequest { + @SerializedName("clientId") + private String clientId = null; + + @SerializedName("numberOfSamples") + private Integer numberOfSamples = null; + + @SerializedName("plates") + private List plates = null; + + @SerializedName("requiredServiceInfo") + private Map requiredServiceInfo = null; + + /** + * The type of Samples being submitted + */ + @JsonAdapter(SampleTypeEnum.Adapter.class) + public enum SampleTypeEnum { + DNA("DNA"), + RNA("RNA"), + TISSUE("Tissue"); + + private String value; + + SampleTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SampleTypeEnum fromValue(String text) { + for (SampleTypeEnum b : SampleTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SampleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SampleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SampleTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sampleType") + private SampleTypeEnum sampleType = null; + + @SerializedName("serviceIds") + private List serviceIds = null; + + public VendorOrderRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info. + * @return clientId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info.") + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public VendorOrderRequest numberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + return this; + } + + /** + * The total number of samples contained in this request. Used for billing and basic validation of the request. + * @return numberOfSamples + **/ + @Schema(description = "The total number of samples contained in this request. Used for billing and basic validation of the request.") + public Integer getNumberOfSamples() { + return numberOfSamples; + } + + public void setNumberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + } + + public VendorOrderRequest plates(List plates) { + this.plates = plates; + return this; + } + + public VendorOrderRequest addPlatesItem(VendorOrderRequestPlates platesItem) { + if (this.plates == null) { + this.plates = new ArrayList(); + } + this.plates.add(platesItem); + return this; + } + + /** + * Array of new plates to be submitted to a vendor + * @return plates + **/ + @Schema(description = "Array of new plates to be submitted to a vendor") + public List getPlates() { + return plates; + } + + public void setPlates(List plates) { + this.plates = plates; + } + + public VendorOrderRequest requiredServiceInfo(Map requiredServiceInfo) { + this.requiredServiceInfo = requiredServiceInfo; + return this; + } + + public VendorOrderRequest putRequiredServiceInfoItem(String key, String requiredServiceInfoItem) { + if (this.requiredServiceInfo == null) { + this.requiredServiceInfo = new HashMap(); + } + this.requiredServiceInfo.put(key, requiredServiceInfoItem); + return this; + } + + /** + * A map of additional data required by the requested service. This includes things like Volume and Concentration. + * @return requiredServiceInfo + **/ + @Schema(description = "A map of additional data required by the requested service. This includes things like Volume and Concentration.") + public Map getRequiredServiceInfo() { + return requiredServiceInfo; + } + + public void setRequiredServiceInfo(Map requiredServiceInfo) { + this.requiredServiceInfo = requiredServiceInfo; + } + + public VendorOrderRequest sampleType(SampleTypeEnum sampleType) { + this.sampleType = sampleType; + return this; + } + + /** + * The type of Samples being submitted + * @return sampleType + **/ + @Schema(description = "The type of Samples being submitted") + public SampleTypeEnum getSampleType() { + return sampleType; + } + + public void setSampleType(SampleTypeEnum sampleType) { + this.sampleType = sampleType; + } + + public VendorOrderRequest serviceIds(List serviceIds) { + this.serviceIds = serviceIds; + return this; + } + + public VendorOrderRequest addServiceIdsItem(String serviceIdsItem) { + if (this.serviceIds == null) { + this.serviceIds = new ArrayList(); + } + this.serviceIds.add(serviceIdsItem); + return this; + } + + /** + * A list of unique, alpha-numeric ID which identify the requested services to be applied to this order. A Vendor Service defines what platform, technology, and markers will be used. A list of service IDs can be retrieved from the Vendor Specs. + * @return serviceIds + **/ + @Schema(description = "A list of unique, alpha-numeric ID which identify the requested services to be applied to this order. A Vendor Service defines what platform, technology, and markers will be used. A list of service IDs can be retrieved from the Vendor Specs.") + public List getServiceIds() { + return serviceIds; + } + + public void setServiceIds(List serviceIds) { + this.serviceIds = serviceIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderRequest vendorOrderRequest = (VendorOrderRequest) o; + return Objects.equals(this.clientId, vendorOrderRequest.clientId) && + Objects.equals(this.numberOfSamples, vendorOrderRequest.numberOfSamples) && + Objects.equals(this.plates, vendorOrderRequest.plates) && + Objects.equals(this.requiredServiceInfo, vendorOrderRequest.requiredServiceInfo) && + Objects.equals(this.sampleType, vendorOrderRequest.sampleType) && + Objects.equals(this.serviceIds, vendorOrderRequest.serviceIds); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, numberOfSamples, plates, requiredServiceInfo, sampleType, serviceIds); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderRequest {\n"); + + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" numberOfSamples: ").append(toIndentedString(numberOfSamples)).append("\n"); + sb.append(" plates: ").append(toIndentedString(plates)).append("\n"); + sb.append(" requiredServiceInfo: ").append(toIndentedString(requiredServiceInfo)).append("\n"); + sb.append(" sampleType: ").append(toIndentedString(sampleType)).append("\n"); + sb.append(" serviceIds: ").append(toIndentedString(serviceIds)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequestPlates.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequestPlates.java new file mode 100755 index 00000000..267bb02b --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderRequestPlates.java @@ -0,0 +1,168 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.PlateFormat; +import io.swagger.client.model.VendorSample; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * VendorOrderRequestPlates + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderRequestPlates { + @SerializedName("clientPlateBarcode") + private String clientPlateBarcode = null; + + @SerializedName("clientPlateId") + private String clientPlateId = null; + + @SerializedName("sampleSubmissionFormat") + private PlateFormat sampleSubmissionFormat = null; + + @SerializedName("samples") + private List samples = null; + + public VendorOrderRequestPlates clientPlateBarcode(String clientPlateBarcode) { + this.clientPlateBarcode = clientPlateBarcode; + return this; + } + + /** + * (Optional) The value of the bar code attached to this plate + * @return clientPlateBarcode + **/ + @Schema(description = "(Optional) The value of the bar code attached to this plate") + public String getClientPlateBarcode() { + return clientPlateBarcode; + } + + public void setClientPlateBarcode(String clientPlateBarcode) { + this.clientPlateBarcode = clientPlateBarcode; + } + + public VendorOrderRequestPlates clientPlateId(String clientPlateId) { + this.clientPlateId = clientPlateId; + return this; + } + + /** + * The ID which uniquely identifies this plate to the client making the request + * @return clientPlateId + **/ + @Schema(description = "The ID which uniquely identifies this plate to the client making the request") + public String getClientPlateId() { + return clientPlateId; + } + + public void setClientPlateId(String clientPlateId) { + this.clientPlateId = clientPlateId; + } + + public VendorOrderRequestPlates sampleSubmissionFormat(PlateFormat sampleSubmissionFormat) { + this.sampleSubmissionFormat = sampleSubmissionFormat; + return this; + } + + /** + * Get sampleSubmissionFormat + * @return sampleSubmissionFormat + **/ + @Schema(description = "") + public PlateFormat getSampleSubmissionFormat() { + return sampleSubmissionFormat; + } + + public void setSampleSubmissionFormat(PlateFormat sampleSubmissionFormat) { + this.sampleSubmissionFormat = sampleSubmissionFormat; + } + + public VendorOrderRequestPlates samples(List samples) { + this.samples = samples; + return this; + } + + public VendorOrderRequestPlates addSamplesItem(VendorSample samplesItem) { + if (this.samples == null) { + this.samples = new ArrayList(); + } + this.samples.add(samplesItem); + return this; + } + + /** + * Get samples + * @return samples + **/ + @Schema(description = "") + public List getSamples() { + return samples; + } + + public void setSamples(List samples) { + this.samples = samples; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderRequestPlates vendorOrderRequestPlates = (VendorOrderRequestPlates) o; + return Objects.equals(this.clientPlateBarcode, vendorOrderRequestPlates.clientPlateBarcode) && + Objects.equals(this.clientPlateId, vendorOrderRequestPlates.clientPlateId) && + Objects.equals(this.sampleSubmissionFormat, vendorOrderRequestPlates.sampleSubmissionFormat) && + Objects.equals(this.samples, vendorOrderRequestPlates.samples); + } + + @Override + public int hashCode() { + return Objects.hash(clientPlateBarcode, clientPlateId, sampleSubmissionFormat, samples); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderRequestPlates {\n"); + + sb.append(" clientPlateBarcode: ").append(toIndentedString(clientPlateBarcode)).append("\n"); + sb.append(" clientPlateId: ").append(toIndentedString(clientPlateId)).append("\n"); + sb.append(" sampleSubmissionFormat: ").append(toIndentedString(sampleSubmissionFormat)).append("\n"); + sb.append(" samples: ").append(toIndentedString(samples)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponse.java new file mode 100755 index 00000000..38aba371 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorOrderResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorOrderResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorOrderResponseResult result = null; + + public VendorOrderResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorOrderResponse result(VendorOrderResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(description = "") + public VendorOrderResponseResult getResult() { + return result; + } + + public void setResult(VendorOrderResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderResponse vendorOrderResponse = (VendorOrderResponse) o; + return Objects.equals(this.metadata, vendorOrderResponse.metadata) && + Objects.equals(this.result, vendorOrderResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResult.java new file mode 100755 index 00000000..7144568f --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResult.java @@ -0,0 +1,121 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorOrderResponseResultShipmentForms; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Response to an order request + */ +@Schema(description = "Response to an order request") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderResponseResult { + @SerializedName("orderId") + private String orderId = null; + + @SerializedName("shipmentForms") + private List shipmentForms = null; + + public VendorOrderResponseResult orderId(String orderId) { + this.orderId = orderId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the order . + * @return orderId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the order .") + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public VendorOrderResponseResult shipmentForms(List shipmentForms) { + this.shipmentForms = shipmentForms; + return this; + } + + public VendorOrderResponseResult addShipmentFormsItem(VendorOrderResponseResultShipmentForms shipmentFormsItem) { + if (this.shipmentForms == null) { + this.shipmentForms = new ArrayList(); + } + this.shipmentForms.add(shipmentFormsItem); + return this; + } + + /** + * Array of paper forms which need to be printed and included with the physical shipment + * @return shipmentForms + **/ + @Schema(description = "Array of paper forms which need to be printed and included with the physical shipment") + public List getShipmentForms() { + return shipmentForms; + } + + public void setShipmentForms(List shipmentForms) { + this.shipmentForms = shipmentForms; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderResponseResult vendorOrderResponseResult = (VendorOrderResponseResult) o; + return Objects.equals(this.orderId, vendorOrderResponseResult.orderId) && + Objects.equals(this.shipmentForms, vendorOrderResponseResult.shipmentForms); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, shipmentForms); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderResponseResult {\n"); + + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" shipmentForms: ").append(toIndentedString(shipmentForms)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResultShipmentForms.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResultShipmentForms.java new file mode 100755 index 00000000..db536fc7 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResponseResultShipmentForms.java @@ -0,0 +1,133 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorOrderResponseResultShipmentForms + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderResponseResultShipmentForms { + @SerializedName("fileDescription") + private String fileDescription = null; + + @SerializedName("fileName") + private String fileName = null; + + @SerializedName("fileURL") + private String fileURL = null; + + public VendorOrderResponseResultShipmentForms fileDescription(String fileDescription) { + this.fileDescription = fileDescription; + return this; + } + + /** + * The human readable long description for this form + * @return fileDescription + **/ + @Schema(description = "The human readable long description for this form") + public String getFileDescription() { + return fileDescription; + } + + public void setFileDescription(String fileDescription) { + this.fileDescription = fileDescription; + } + + public VendorOrderResponseResultShipmentForms fileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * The human readable name for this form + * @return fileName + **/ + @Schema(description = "The human readable name for this form") + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public VendorOrderResponseResultShipmentForms fileURL(String fileURL) { + this.fileURL = fileURL; + return this; + } + + /** + * The URL to download this form + * @return fileURL + **/ + @Schema(description = "The URL to download this form") + public String getFileURL() { + return fileURL; + } + + public void setFileURL(String fileURL) { + this.fileURL = fileURL; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderResponseResultShipmentForms vendorOrderResponseResultShipmentForms = (VendorOrderResponseResultShipmentForms) o; + return Objects.equals(this.fileDescription, vendorOrderResponseResultShipmentForms.fileDescription) && + Objects.equals(this.fileName, vendorOrderResponseResultShipmentForms.fileName) && + Objects.equals(this.fileURL, vendorOrderResponseResultShipmentForms.fileURL); + } + + @Override + public int hashCode() { + return Objects.hash(fileDescription, fileName, fileURL); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderResponseResultShipmentForms {\n"); + + sb.append(" fileDescription: ").append(toIndentedString(fileDescription)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" fileURL: ").append(toIndentedString(fileURL)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponse.java new file mode 100755 index 00000000..49a25649 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorOrderResultsResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorOrderResultsResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderResultsResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorOrderResultsResponseResult result = null; + + public VendorOrderResultsResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorOrderResultsResponse result(VendorOrderResultsResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorOrderResultsResponseResult getResult() { + return result; + } + + public void setResult(VendorOrderResultsResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderResultsResponse vendorOrderResultsResponse = (VendorOrderResultsResponse) o; + return Objects.equals(this.metadata, vendorOrderResultsResponse.metadata) && + Objects.equals(this.result, vendorOrderResultsResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderResultsResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponseResult.java new file mode 100755 index 00000000..a756812e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderResultsResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorResultFile; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * VendorOrderResultsResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderResultsResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public VendorOrderResultsResponseResult data(List data) { + this.data = data; + return this; + } + + public VendorOrderResultsResponseResult addDataItem(VendorResultFile dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderResultsResponseResult vendorOrderResultsResponseResult = (VendorOrderResultsResponseResult) o; + return Objects.equals(this.data, vendorOrderResultsResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderResultsResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponse.java new file mode 100755 index 00000000..5c68dc8e --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorOrderStatusResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorOrderStatusResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderStatusResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorOrderStatusResponseResult result = null; + + public VendorOrderStatusResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorOrderStatusResponse result(VendorOrderStatusResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorOrderStatusResponseResult getResult() { + return result; + } + + public void setResult(VendorOrderStatusResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderStatusResponse vendorOrderStatusResponse = (VendorOrderStatusResponse) o; + return Objects.equals(this.metadata, vendorOrderStatusResponse.metadata) && + Objects.equals(this.result, vendorOrderStatusResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderStatusResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponseResult.java new file mode 100755 index 00000000..42e23579 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrderStatusResponseResult.java @@ -0,0 +1,135 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * VendorOrderStatusResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrderStatusResponseResult { + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + REGISTERED("registered"), + RECEIVED("received"), + INPROGRESS("inProgress"), + COMPLETED("completed"), + REJECTED("rejected"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("status") + private StatusEnum status = null; + + public VendorOrderStatusResponseResult status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @Schema(description = "") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrderStatusResponseResult vendorOrderStatusResponseResult = (VendorOrderStatusResponseResult) o; + return Objects.equals(this.status, vendorOrderStatusResponseResult.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrderStatusResponseResult {\n"); + + sb.append(" status: ").append(toIndentedString(status)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponse.java new file mode 100755 index 00000000..1842ad77 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorOrdersResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorOrdersResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrdersResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorOrdersResponseResult result = null; + + public VendorOrdersResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorOrdersResponse result(VendorOrdersResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorOrdersResponseResult getResult() { + return result; + } + + public void setResult(VendorOrdersResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrdersResponse vendorOrdersResponse = (VendorOrdersResponse) o; + return Objects.equals(this.metadata, vendorOrdersResponse.metadata) && + Objects.equals(this.result, vendorOrdersResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrdersResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponseResult.java new file mode 100755 index 00000000..e6d157f2 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorOrdersResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * VendorOrdersResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorOrdersResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public VendorOrdersResponseResult data(List data) { + this.data = data; + return this; + } + + public VendorOrdersResponseResult addDataItem(VendorOrder dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorOrdersResponseResult vendorOrdersResponseResult = (VendorOrdersResponseResult) o; + return Objects.equals(this.data, vendorOrdersResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorOrdersResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlate.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlate.java new file mode 100755 index 00000000..df580774 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlate.java @@ -0,0 +1,168 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.PlateFormat; +import io.swagger.client.model.VendorSample; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * VendorPlate + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlate { + @SerializedName("clientPlateBarcode") + private String clientPlateBarcode = null; + + @SerializedName("clientPlateId") + private String clientPlateId = null; + + @SerializedName("sampleSubmissionFormat") + private PlateFormat sampleSubmissionFormat = null; + + @SerializedName("samples") + private List samples = null; + + public VendorPlate clientPlateBarcode(String clientPlateBarcode) { + this.clientPlateBarcode = clientPlateBarcode; + return this; + } + + /** + * (Optional) The value of the bar code attached to this plate + * @return clientPlateBarcode + **/ + @Schema(description = "(Optional) The value of the bar code attached to this plate") + public String getClientPlateBarcode() { + return clientPlateBarcode; + } + + public void setClientPlateBarcode(String clientPlateBarcode) { + this.clientPlateBarcode = clientPlateBarcode; + } + + public VendorPlate clientPlateId(String clientPlateId) { + this.clientPlateId = clientPlateId; + return this; + } + + /** + * The ID which uniquely identifies this plate to the client making the request + * @return clientPlateId + **/ + @Schema(description = "The ID which uniquely identifies this plate to the client making the request") + public String getClientPlateId() { + return clientPlateId; + } + + public void setClientPlateId(String clientPlateId) { + this.clientPlateId = clientPlateId; + } + + public VendorPlate sampleSubmissionFormat(PlateFormat sampleSubmissionFormat) { + this.sampleSubmissionFormat = sampleSubmissionFormat; + return this; + } + + /** + * Get sampleSubmissionFormat + * @return sampleSubmissionFormat + **/ + @Schema(description = "") + public PlateFormat getSampleSubmissionFormat() { + return sampleSubmissionFormat; + } + + public void setSampleSubmissionFormat(PlateFormat sampleSubmissionFormat) { + this.sampleSubmissionFormat = sampleSubmissionFormat; + } + + public VendorPlate samples(List samples) { + this.samples = samples; + return this; + } + + public VendorPlate addSamplesItem(VendorSample samplesItem) { + if (this.samples == null) { + this.samples = new ArrayList(); + } + this.samples.add(samplesItem); + return this; + } + + /** + * Get samples + * @return samples + **/ + @Schema(description = "") + public List getSamples() { + return samples; + } + + public void setSamples(List samples) { + this.samples = samples; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlate vendorPlate = (VendorPlate) o; + return Objects.equals(this.clientPlateBarcode, vendorPlate.clientPlateBarcode) && + Objects.equals(this.clientPlateId, vendorPlate.clientPlateId) && + Objects.equals(this.sampleSubmissionFormat, vendorPlate.sampleSubmissionFormat) && + Objects.equals(this.samples, vendorPlate.samples); + } + + @Override + public int hashCode() { + return Objects.hash(clientPlateBarcode, clientPlateId, sampleSubmissionFormat, samples); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlate {\n"); + + sb.append(" clientPlateBarcode: ").append(toIndentedString(clientPlateBarcode)).append("\n"); + sb.append(" clientPlateId: ").append(toIndentedString(clientPlateId)).append("\n"); + sb.append(" sampleSubmissionFormat: ").append(toIndentedString(sampleSubmissionFormat)).append("\n"); + sb.append(" samples: ").append(toIndentedString(samples)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse.java new file mode 100755 index 00000000..39e6cdfb --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse.java @@ -0,0 +1,144 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorOrderRequestPlates; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * Response of a plate submission + */ +@Schema(description = "Response of a plate submission") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlateGetResponse { + @SerializedName("clientId") + private String clientId = null; + + @SerializedName("numberOfSamples") + private Integer numberOfSamples = null; + + @SerializedName("plates") + private List plates = null; + + public VendorPlateGetResponse clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info. + * @return clientId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info.") + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public VendorPlateGetResponse numberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + return this; + } + + /** + * The total number of samples contained in this request. Used for billing and basic validation of the request. + * @return numberOfSamples + **/ + @Schema(description = "The total number of samples contained in this request. Used for billing and basic validation of the request.") + public Integer getNumberOfSamples() { + return numberOfSamples; + } + + public void setNumberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + } + + public VendorPlateGetResponse plates(List plates) { + this.plates = plates; + return this; + } + + public VendorPlateGetResponse addPlatesItem(VendorOrderRequestPlates platesItem) { + if (this.plates == null) { + this.plates = new ArrayList(); + } + this.plates.add(platesItem); + return this; + } + + /** + * Array of new plates to be submitted to a vendor + * @return plates + **/ + @Schema(description = "Array of new plates to be submitted to a vendor") + public List getPlates() { + return plates; + } + + public void setPlates(List plates) { + this.plates = plates; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlateGetResponse vendorPlateGetResponse = (VendorPlateGetResponse) o; + return Objects.equals(this.clientId, vendorPlateGetResponse.clientId) && + Objects.equals(this.numberOfSamples, vendorPlateGetResponse.numberOfSamples) && + Objects.equals(this.plates, vendorPlateGetResponse.plates); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, numberOfSamples, plates); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlateGetResponse {\n"); + + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" numberOfSamples: ").append(toIndentedString(numberOfSamples)).append("\n"); + sb.append(" plates: ").append(toIndentedString(plates)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse1.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse1.java new file mode 100755 index 00000000..c8e602f8 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateGetResponse1.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorPlateGetResponse; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorPlateGetResponse1 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlateGetResponse1 { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorPlateGetResponse result = null; + + public VendorPlateGetResponse1 metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorPlateGetResponse1 result(VendorPlateGetResponse result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorPlateGetResponse getResult() { + return result; + } + + public void setResult(VendorPlateGetResponse result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlateGetResponse1 vendorPlateGetResponse1 = (VendorPlateGetResponse1) o; + return Objects.equals(this.metadata, vendorPlateGetResponse1.metadata) && + Objects.equals(this.result, vendorPlateGetResponse1.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlateGetResponse1 {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateResponse.java new file mode 100755 index 00000000..e9892820 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlateResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorPlatesSubmissionResponse; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorPlateResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlateResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorPlatesSubmissionResponse result = null; + + public VendorPlateResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorPlateResponse result(VendorPlatesSubmissionResponse result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorPlatesSubmissionResponse getResult() { + return result; + } + + public void setResult(VendorPlatesSubmissionResponse result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlateResponse vendorPlateResponse = (VendorPlateResponse) o; + return Objects.equals(this.metadata, vendorPlateResponse.metadata) && + Objects.equals(this.result, vendorPlateResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlateResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponse.java new file mode 100755 index 00000000..ff46b0c3 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorPlatesResponseResult; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorPlatesResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlatesResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorPlatesResponseResult result = null; + + public VendorPlatesResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorPlatesResponse result(VendorPlatesResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorPlatesResponseResult getResult() { + return result; + } + + public void setResult(VendorPlatesResponseResult result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlatesResponse vendorPlatesResponse = (VendorPlatesResponse) o; + return Objects.equals(this.metadata, vendorPlatesResponse.metadata) && + Objects.equals(this.result, vendorPlatesResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlatesResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponseResult.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponseResult.java new file mode 100755 index 00000000..8aea2267 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesResponseResult.java @@ -0,0 +1,95 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorPlate; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.List; +/** + * VendorPlatesResponseResult + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlatesResponseResult { + @SerializedName("data") + private List data = new ArrayList(); + + public VendorPlatesResponseResult data(List data) { + this.data = data; + return this; + } + + public VendorPlatesResponseResult addDataItem(VendorPlate dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @Schema(required = true, description = "") + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlatesResponseResult vendorPlatesResponseResult = (VendorPlatesResponseResult) o; + return Objects.equals(this.data, vendorPlatesResponseResult.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlatesResponseResult {\n"); + + sb.append(" data: ").append(toIndentedString(data)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionRequest.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionRequest.java new file mode 100755 index 00000000..5fb116b4 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionRequest.java @@ -0,0 +1,213 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.VendorOrderRequestPlates; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * Request object structure to submit plate data to a vendor + */ +@Schema(description = "Request object structure to submit plate data to a vendor") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlatesSubmissionRequest { + @SerializedName("clientId") + private String clientId = null; + + @SerializedName("numberOfSamples") + private Integer numberOfSamples = null; + + @SerializedName("plates") + private List plates = null; + + /** + * The type of Samples being submitted + */ + @JsonAdapter(SampleTypeEnum.Adapter.class) + public enum SampleTypeEnum { + DNA("DNA"), + RNA("RNA"), + TISSUE("Tissue"); + + private String value; + + SampleTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static SampleTypeEnum fromValue(String text) { + for (SampleTypeEnum b : SampleTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SampleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SampleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SampleTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("sampleType") + private SampleTypeEnum sampleType = null; + + public VendorPlatesSubmissionRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info. + * @return clientId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies the client to the vendor. Used to connect the order to the contract, billing, and contact info.") + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public VendorPlatesSubmissionRequest numberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + return this; + } + + /** + * The total number of samples contained in this request. Used for billing and basic validation of the request. + * @return numberOfSamples + **/ + @Schema(description = "The total number of samples contained in this request. Used for billing and basic validation of the request.") + public Integer getNumberOfSamples() { + return numberOfSamples; + } + + public void setNumberOfSamples(Integer numberOfSamples) { + this.numberOfSamples = numberOfSamples; + } + + public VendorPlatesSubmissionRequest plates(List plates) { + this.plates = plates; + return this; + } + + public VendorPlatesSubmissionRequest addPlatesItem(VendorOrderRequestPlates platesItem) { + if (this.plates == null) { + this.plates = new ArrayList(); + } + this.plates.add(platesItem); + return this; + } + + /** + * Array of new plates to be submitted to a vendor + * @return plates + **/ + @Schema(description = "Array of new plates to be submitted to a vendor") + public List getPlates() { + return plates; + } + + public void setPlates(List plates) { + this.plates = plates; + } + + public VendorPlatesSubmissionRequest sampleType(SampleTypeEnum sampleType) { + this.sampleType = sampleType; + return this; + } + + /** + * The type of Samples being submitted + * @return sampleType + **/ + @Schema(description = "The type of Samples being submitted") + public SampleTypeEnum getSampleType() { + return sampleType; + } + + public void setSampleType(SampleTypeEnum sampleType) { + this.sampleType = sampleType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlatesSubmissionRequest vendorPlatesSubmissionRequest = (VendorPlatesSubmissionRequest) o; + return Objects.equals(this.clientId, vendorPlatesSubmissionRequest.clientId) && + Objects.equals(this.numberOfSamples, vendorPlatesSubmissionRequest.numberOfSamples) && + Objects.equals(this.plates, vendorPlatesSubmissionRequest.plates) && + Objects.equals(this.sampleType, vendorPlatesSubmissionRequest.sampleType); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, numberOfSamples, plates, sampleType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlatesSubmissionRequest {\n"); + + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" numberOfSamples: ").append(toIndentedString(numberOfSamples)).append("\n"); + sb.append(" plates: ").append(toIndentedString(plates)).append("\n"); + sb.append(" sampleType: ").append(toIndentedString(sampleType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionResponse.java new file mode 100755 index 00000000..dd273105 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorPlatesSubmissionResponse.java @@ -0,0 +1,87 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Response to an order request + */ +@Schema(description = "Response to an order request") +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorPlatesSubmissionResponse { + @SerializedName("submissionId") + private String submissionId = null; + + public VendorPlatesSubmissionResponse submissionId(String submissionId) { + this.submissionId = submissionId; + return this; + } + + /** + * A unique, alpha-numeric ID which identifies a set of plates which have been successfully submitted. + * @return submissionId + **/ + @Schema(description = "A unique, alpha-numeric ID which identifies a set of plates which have been successfully submitted.") + public String getSubmissionId() { + return submissionId; + } + + public void setSubmissionId(String submissionId) { + this.submissionId = submissionId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorPlatesSubmissionResponse vendorPlatesSubmissionResponse = (VendorPlatesSubmissionResponse) o; + return Objects.equals(this.submissionId, vendorPlatesSubmissionResponse.submissionId); + } + + @Override + public int hashCode() { + return Objects.hash(submissionId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorPlatesSubmissionResponse {\n"); + + sb.append(" submissionId: ").append(toIndentedString(submissionId)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorResultFile.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorResultFile.java new file mode 100755 index 00000000..e7de15f7 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorResultFile.java @@ -0,0 +1,219 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * VendorResultFile + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorResultFile { + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("clientSampleIds") + private List clientSampleIds = new ArrayList(); + + @SerializedName("fileName") + private String fileName = null; + + @SerializedName("fileType") + private String fileType = null; + + @SerializedName("fileURL") + private String fileURL = null; + + @SerializedName("md5sum") + private String md5sum = null; + + public VendorResultFile additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public VendorResultFile putAdditionalInfoItem(String key, String additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary info + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary info") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public VendorResultFile clientSampleIds(List clientSampleIds) { + this.clientSampleIds = clientSampleIds; + return this; + } + + public VendorResultFile addClientSampleIdsItem(String clientSampleIdsItem) { + this.clientSampleIds.add(clientSampleIdsItem); + return this; + } + + /** + * The list of sampleDbIds included in the file + * @return clientSampleIds + **/ + @Schema(required = true, description = "The list of sampleDbIds included in the file") + public List getClientSampleIds() { + return clientSampleIds; + } + + public void setClientSampleIds(List clientSampleIds) { + this.clientSampleIds = clientSampleIds; + } + + public VendorResultFile fileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Name of the file + * @return fileName + **/ + @Schema(required = true, description = "Name of the file") + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public VendorResultFile fileType(String fileType) { + this.fileType = fileType; + return this; + } + + /** + * Format of the file + * @return fileType + **/ + @Schema(required = true, description = "Format of the file") + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public VendorResultFile fileURL(String fileURL) { + this.fileURL = fileURL; + return this; + } + + /** + * The URL to a file with the results of a vendor analysis + * @return fileURL + **/ + @Schema(required = true, description = "The URL to a file with the results of a vendor analysis") + public String getFileURL() { + return fileURL; + } + + public void setFileURL(String fileURL) { + this.fileURL = fileURL; + } + + public VendorResultFile md5sum(String md5sum) { + this.md5sum = md5sum; + return this; + } + + /** + * MD5 Hash Check Sum for the file to confirm download without error + * @return md5sum + **/ + @Schema(description = "MD5 Hash Check Sum for the file to confirm download without error") + public String getMd5sum() { + return md5sum; + } + + public void setMd5sum(String md5sum) { + this.md5sum = md5sum; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorResultFile vendorResultFile = (VendorResultFile) o; + return Objects.equals(this.additionalInfo, vendorResultFile.additionalInfo) && + Objects.equals(this.clientSampleIds, vendorResultFile.clientSampleIds) && + Objects.equals(this.fileName, vendorResultFile.fileName) && + Objects.equals(this.fileType, vendorResultFile.fileType) && + Objects.equals(this.fileURL, vendorResultFile.fileURL) && + Objects.equals(this.md5sum, vendorResultFile.md5sum); + } + + @Override + public int hashCode() { + return Objects.hash(additionalInfo, clientSampleIds, fileName, fileType, fileURL, md5sum); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorResultFile {\n"); + + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" clientSampleIds: ").append(toIndentedString(clientSampleIds)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" fileType: ").append(toIndentedString(fileType)).append("\n"); + sb.append(" fileURL: ").append(toIndentedString(fileURL)).append("\n"); + sb.append(" md5sum: ").append(toIndentedString(md5sum)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorSample.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSample.java new file mode 100755 index 00000000..93d81473 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSample.java @@ -0,0 +1,365 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Measurement; +import io.swagger.client.model.VendorOntologyReference; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorSample + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorSample { + @SerializedName("clientSampleBarCode") + private String clientSampleBarCode = null; + + @SerializedName("clientSampleId") + private String clientSampleId = null; + + @SerializedName("column") + private String column = null; + + @SerializedName("comments") + private String comments = null; + + @SerializedName("concentration") + private Measurement concentration = null; + + @SerializedName("organismName") + private String organismName = null; + + @SerializedName("row") + private String row = null; + + @SerializedName("speciesName") + private String speciesName = null; + + @SerializedName("taxonomyOntologyReference") + private VendorOntologyReference taxonomyOntologyReference = null; + + @SerializedName("tissueType") + private String tissueType = null; + + @SerializedName("tissueTypeOntologyReference") + private VendorOntologyReference tissueTypeOntologyReference = null; + + @SerializedName("volume") + private Measurement volume = null; + + @SerializedName("well") + private String well = null; + + public VendorSample clientSampleBarCode(String clientSampleBarCode) { + this.clientSampleBarCode = clientSampleBarCode; + return this; + } + + /** + * (Optional) The value of the bar code attached to this sample + * @return clientSampleBarCode + **/ + @Schema(description = "(Optional) The value of the bar code attached to this sample") + public String getClientSampleBarCode() { + return clientSampleBarCode; + } + + public void setClientSampleBarCode(String clientSampleBarCode) { + this.clientSampleBarCode = clientSampleBarCode; + } + + public VendorSample clientSampleId(String clientSampleId) { + this.clientSampleId = clientSampleId; + return this; + } + + /** + * The ID which uniquely identifies this sample to the client making the request + * @return clientSampleId + **/ + @Schema(description = "The ID which uniquely identifies this sample to the client making the request") + public String getClientSampleId() { + return clientSampleId; + } + + public void setClientSampleId(String clientSampleId) { + this.clientSampleId = clientSampleId; + } + + public VendorSample column(String column) { + this.column = column; + return this; + } + + /** + * The Column identifier for this samples location in the plate + * @return column + **/ + @Schema(description = "The Column identifier for this samples location in the plate") + public String getColumn() { + return column; + } + + public void setColumn(String column) { + this.column = column; + } + + public VendorSample comments(String comments) { + this.comments = comments; + return this; + } + + /** + * Generic comments about this sample for the vendor + * @return comments + **/ + @Schema(description = "Generic comments about this sample for the vendor") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public VendorSample concentration(Measurement concentration) { + this.concentration = concentration; + return this; + } + + /** + * Get concentration + * @return concentration + **/ + @Schema(description = "") + public Measurement getConcentration() { + return concentration; + } + + public void setConcentration(Measurement concentration) { + this.concentration = concentration; + } + + public VendorSample organismName(String organismName) { + this.organismName = organismName; + return this; + } + + /** + * Scientific organism name + * @return organismName + **/ + @Schema(description = "Scientific organism name") + public String getOrganismName() { + return organismName; + } + + public void setOrganismName(String organismName) { + this.organismName = organismName; + } + + public VendorSample row(String row) { + this.row = row; + return this; + } + + /** + * The Row identifier for this samples location in the plate + * @return row + **/ + @Schema(description = "The Row identifier for this samples location in the plate") + public String getRow() { + return row; + } + + public void setRow(String row) { + this.row = row; + } + + public VendorSample speciesName(String speciesName) { + this.speciesName = speciesName; + return this; + } + + /** + * Scientific species name + * @return speciesName + **/ + @Schema(description = "Scientific species name") + public String getSpeciesName() { + return speciesName; + } + + public void setSpeciesName(String speciesName) { + this.speciesName = speciesName; + } + + public VendorSample taxonomyOntologyReference(VendorOntologyReference taxonomyOntologyReference) { + this.taxonomyOntologyReference = taxonomyOntologyReference; + return this; + } + + /** + * Get taxonomyOntologyReference + * @return taxonomyOntologyReference + **/ + @Schema(description = "") + public VendorOntologyReference getTaxonomyOntologyReference() { + return taxonomyOntologyReference; + } + + public void setTaxonomyOntologyReference(VendorOntologyReference taxonomyOntologyReference) { + this.taxonomyOntologyReference = taxonomyOntologyReference; + } + + public VendorSample tissueType(String tissueType) { + this.tissueType = tissueType; + return this; + } + + /** + * The type of tissue in this sample. List of accepted tissue types can be found in the Vendor Specs. + * @return tissueType + **/ + @Schema(description = "The type of tissue in this sample. List of accepted tissue types can be found in the Vendor Specs.") + public String getTissueType() { + return tissueType; + } + + public void setTissueType(String tissueType) { + this.tissueType = tissueType; + } + + public VendorSample tissueTypeOntologyReference(VendorOntologyReference tissueTypeOntologyReference) { + this.tissueTypeOntologyReference = tissueTypeOntologyReference; + return this; + } + + /** + * Get tissueTypeOntologyReference + * @return tissueTypeOntologyReference + **/ + @Schema(description = "") + public VendorOntologyReference getTissueTypeOntologyReference() { + return tissueTypeOntologyReference; + } + + public void setTissueTypeOntologyReference(VendorOntologyReference tissueTypeOntologyReference) { + this.tissueTypeOntologyReference = tissueTypeOntologyReference; + } + + public VendorSample volume(Measurement volume) { + this.volume = volume; + return this; + } + + /** + * Get volume + * @return volume + **/ + @Schema(description = "") + public Measurement getVolume() { + return volume; + } + + public void setVolume(Measurement volume) { + this.volume = volume; + } + + public VendorSample well(String well) { + this.well = well; + return this; + } + + /** + * The Well identifier for this samples location in the plate. Ussually a concatination of Row and Column. + * @return well + **/ + @Schema(description = "The Well identifier for this samples location in the plate. Ussually a concatination of Row and Column.") + public String getWell() { + return well; + } + + public void setWell(String well) { + this.well = well; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorSample vendorSample = (VendorSample) o; + return Objects.equals(this.clientSampleBarCode, vendorSample.clientSampleBarCode) && + Objects.equals(this.clientSampleId, vendorSample.clientSampleId) && + Objects.equals(this.column, vendorSample.column) && + Objects.equals(this.comments, vendorSample.comments) && + Objects.equals(this.concentration, vendorSample.concentration) && + Objects.equals(this.organismName, vendorSample.organismName) && + Objects.equals(this.row, vendorSample.row) && + Objects.equals(this.speciesName, vendorSample.speciesName) && + Objects.equals(this.taxonomyOntologyReference, vendorSample.taxonomyOntologyReference) && + Objects.equals(this.tissueType, vendorSample.tissueType) && + Objects.equals(this.tissueTypeOntologyReference, vendorSample.tissueTypeOntologyReference) && + Objects.equals(this.volume, vendorSample.volume) && + Objects.equals(this.well, vendorSample.well); + } + + @Override + public int hashCode() { + return Objects.hash(clientSampleBarCode, clientSampleId, column, comments, concentration, organismName, row, speciesName, taxonomyOntologyReference, tissueType, tissueTypeOntologyReference, volume, well); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorSample {\n"); + + sb.append(" clientSampleBarCode: ").append(toIndentedString(clientSampleBarCode)).append("\n"); + sb.append(" clientSampleId: ").append(toIndentedString(clientSampleId)).append("\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" concentration: ").append(toIndentedString(concentration)).append("\n"); + sb.append(" organismName: ").append(toIndentedString(organismName)).append("\n"); + sb.append(" row: ").append(toIndentedString(row)).append("\n"); + sb.append(" speciesName: ").append(toIndentedString(speciesName)).append("\n"); + sb.append(" taxonomyOntologyReference: ").append(toIndentedString(taxonomyOntologyReference)).append("\n"); + sb.append(" tissueType: ").append(toIndentedString(tissueType)).append("\n"); + sb.append(" tissueTypeOntologyReference: ").append(toIndentedString(tissueTypeOntologyReference)).append("\n"); + sb.append(" volume: ").append(toIndentedString(volume)).append("\n"); + sb.append(" well: ").append(toIndentedString(well)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecification.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecification.java new file mode 100755 index 00000000..e8215412 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecification.java @@ -0,0 +1,155 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.VendorContact; +import io.swagger.client.model.VendorSpecificationService; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +/** + * VendorSpecification + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorSpecification { + @SerializedName("additionalInfo") + private Map additionalInfo = null; + + @SerializedName("services") + private List services = null; + + @SerializedName("vendorContact") + private VendorContact vendorContact = null; + + public VendorSpecification additionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + public VendorSpecification putAdditionalInfoItem(String key, Object additionalInfoItem) { + if (this.additionalInfo == null) { + this.additionalInfo = new HashMap(); + } + this.additionalInfo.put(key, additionalInfoItem); + return this; + } + + /** + * Additional arbitrary information specific to a particular Vendor. Look for the Vedors specific API documentation for more details + * @return additionalInfo + **/ + @Schema(description = "Additional arbitrary information specific to a particular Vendor. Look for the Vedors specific API documentation for more details") + public Map getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public VendorSpecification services(List services) { + this.services = services; + return this; + } + + public VendorSpecification addServicesItem(VendorSpecificationService servicesItem) { + if (this.services == null) { + this.services = new ArrayList(); + } + this.services.add(servicesItem); + return this; + } + + /** + * List of platform specifications available at the vendor + * @return services + **/ + @Schema(description = "List of platform specifications available at the vendor") + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } + + public VendorSpecification vendorContact(VendorContact vendorContact) { + this.vendorContact = vendorContact; + return this; + } + + /** + * Get vendorContact + * @return vendorContact + **/ + @Schema(description = "") + public VendorContact getVendorContact() { + return vendorContact; + } + + public void setVendorContact(VendorContact vendorContact) { + this.vendorContact = vendorContact; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorSpecification vendorSpecification = (VendorSpecification) o; + return Objects.equals(this.additionalInfo, vendorSpecification.additionalInfo) && + Objects.equals(this.services, vendorSpecification.services) && + Objects.equals(this.vendorContact, vendorSpecification.vendorContact); + } + + @Override + public int hashCode() { + return Objects.hash(additionalInfo, services, vendorContact); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorSpecification {\n"); + + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" vendorContact: ").append(toIndentedString(vendorContact)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationResponse.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationResponse.java new file mode 100755 index 00000000..a5b20e31 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationResponse.java @@ -0,0 +1,112 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.annotations.SerializedName; +import io.swagger.client.model.Metadata; +import io.swagger.client.model.VendorSpecification; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * VendorSpecificationResponse + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorSpecificationResponse { + @SerializedName("metadata") + private Metadata metadata = null; + + @SerializedName("result") + private VendorSpecification result = null; + + public VendorSpecificationResponse metadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @Schema(required = true, description = "") + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public VendorSpecificationResponse result(VendorSpecification result) { + this.result = result; + return this; + } + + /** + * Get result + * @return result + **/ + @Schema(required = true, description = "") + public VendorSpecification getResult() { + return result; + } + + public void setResult(VendorSpecification result) { + this.result = result; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorSpecificationResponse vendorSpecificationResponse = (VendorSpecificationResponse) o; + return Objects.equals(this.metadata, vendorSpecificationResponse.metadata) && + Objects.equals(this.result, vendorSpecificationResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, result); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorSpecificationResponse {\n"); + + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationService.java b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationService.java new file mode 100755 index 00000000..cc3bbe75 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/VendorSpecificationService.java @@ -0,0 +1,247 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * VendorSpecificationService + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2019-08-25T02:56:46.257Z[GMT]") +public class VendorSpecificationService { + @SerializedName("serviceDescription") + private String serviceDescription = null; + + @SerializedName("serviceId") + private String serviceId = null; + + @SerializedName("serviceName") + private String serviceName = null; + + /** + * The type of markers used in this services platform + */ + @JsonAdapter(ServicePlatformMarkerTypeEnum.Adapter.class) + public enum ServicePlatformMarkerTypeEnum { + FIXED("FIXED"), + DISCOVERABLE("DISCOVERABLE"); + + private String value; + + ServicePlatformMarkerTypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + public static ServicePlatformMarkerTypeEnum fromValue(String text) { + for (ServicePlatformMarkerTypeEnum b : ServicePlatformMarkerTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ServicePlatformMarkerTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ServicePlatformMarkerTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ServicePlatformMarkerTypeEnum.fromValue(String.valueOf(value)); + } + } + } @SerializedName("servicePlatformMarkerType") + private ServicePlatformMarkerTypeEnum servicePlatformMarkerType = null; + + @SerializedName("servicePlatformName") + private String servicePlatformName = null; + + @SerializedName("specificRequirements") + private Object specificRequirements = null; + + public VendorSpecificationService serviceDescription(String serviceDescription) { + this.serviceDescription = serviceDescription; + return this; + } + + /** + * Description of the vendor platform + * @return serviceDescription + **/ + @Schema(description = "Description of the vendor platform") + public String getServiceDescription() { + return serviceDescription; + } + + public void setServiceDescription(String serviceDescription) { + this.serviceDescription = serviceDescription; + } + + public VendorSpecificationService serviceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Unique identifier for this service + * @return serviceId + **/ + @Schema(description = "Unique identifier for this service") + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public VendorSpecificationService serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The human readable name of a platform + * @return serviceName + **/ + @Schema(description = "The human readable name of a platform") + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public VendorSpecificationService servicePlatformMarkerType(ServicePlatformMarkerTypeEnum servicePlatformMarkerType) { + this.servicePlatformMarkerType = servicePlatformMarkerType; + return this; + } + + /** + * The type of markers used in this services platform + * @return servicePlatformMarkerType + **/ + @Schema(description = "The type of markers used in this services platform") + public ServicePlatformMarkerTypeEnum getServicePlatformMarkerType() { + return servicePlatformMarkerType; + } + + public void setServicePlatformMarkerType(ServicePlatformMarkerTypeEnum servicePlatformMarkerType) { + this.servicePlatformMarkerType = servicePlatformMarkerType; + } + + public VendorSpecificationService servicePlatformName(String servicePlatformName) { + this.servicePlatformName = servicePlatformName; + return this; + } + + /** + * The technology platform used by this service + * @return servicePlatformName + **/ + @Schema(description = "The technology platform used by this service") + public String getServicePlatformName() { + return servicePlatformName; + } + + public void setServicePlatformName(String servicePlatformName) { + this.servicePlatformName = servicePlatformName; + } + + public VendorSpecificationService specificRequirements(Object specificRequirements) { + this.specificRequirements = specificRequirements; + return this; + } + + /** + * Additional arbitrary requirements for a particular platform + * @return specificRequirements + **/ + @Schema(description = "Additional arbitrary requirements for a particular platform") + public Object getSpecificRequirements() { + return specificRequirements; + } + + public void setSpecificRequirements(Object specificRequirements) { + this.specificRequirements = specificRequirements; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VendorSpecificationService vendorSpecificationService = (VendorSpecificationService) o; + return Objects.equals(this.serviceDescription, vendorSpecificationService.serviceDescription) && + Objects.equals(this.serviceId, vendorSpecificationService.serviceId) && + Objects.equals(this.serviceName, vendorSpecificationService.serviceName) && + Objects.equals(this.servicePlatformMarkerType, vendorSpecificationService.servicePlatformMarkerType) && + Objects.equals(this.servicePlatformName, vendorSpecificationService.servicePlatformName) && + Objects.equals(this.specificRequirements, vendorSpecificationService.specificRequirements); + } + + @Override + public int hashCode() { + return Objects.hash(serviceDescription, serviceId, serviceName, servicePlatformMarkerType, servicePlatformName, specificRequirements); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VendorSpecificationService {\n"); + + sb.append(" serviceDescription: ").append(toIndentedString(serviceDescription)).append("\n"); + sb.append(" serviceId: ").append(toIndentedString(serviceId)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" servicePlatformMarkerType: ").append(toIndentedString(servicePlatformMarkerType)).append("\n"); + sb.append(" servicePlatformName: ").append(toIndentedString(servicePlatformName)).append("\n"); + sb.append(" specificRequirements: ").append(toIndentedString(specificRequirements)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/brapi-client/src/main/resources/swagger-generated-client/model/WSMIMEDataTypes.java b/brapi-client/src/main/resources/swagger-generated-client/model/WSMIMEDataTypes.java new file mode 100755 index 00000000..6f414017 --- /dev/null +++ b/brapi-client/src/main/resources/swagger-generated-client/model/WSMIMEDataTypes.java @@ -0,0 +1,67 @@ +/* + * BrAPI + * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing + * + * OpenAPI spec version: 1.3 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WSMIMEDataTypes + */ +@JsonAdapter(WSMIMEDataTypes.Adapter.class) +public enum WSMIMEDataTypes { + APPLICATION_JSON("application/json"), + TEXT_CSV("text/csv"), + TEXT_TSV("text/tsv"), + APPLICATION_FLAPJACK("application/flapjack"); + + private String value; + + WSMIMEDataTypes(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WSMIMEDataTypes fromValue(String text) { + for (WSMIMEDataTypes b : WSMIMEDataTypes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WSMIMEDataTypes enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WSMIMEDataTypes read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WSMIMEDataTypes.fromValue(String.valueOf(value)); + } + } +} diff --git a/brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java b/brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java new file mode 100644 index 00000000..65f64f38 --- /dev/null +++ b/brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java @@ -0,0 +1,15 @@ +package org.breedinginsight.brapi.client; + +import org.breedinginsight.brapi.client.v2.endpoints.BrAPIClient; + +public class BrAPIClientTest { + + protected String brapiTestServer; + protected BrAPIClient client; + + public BrAPIClientTest() { + brapiTestServer = "https://test-server.brapi.org/"; + client = new BrAPIClient(brapiTestServer); + } + +} diff --git a/brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java new file mode 100644 index 00000000..caedb332 --- /dev/null +++ b/brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java @@ -0,0 +1,76 @@ +package org.breedinginsight.brapi.client.v2.endpoints.modules.core; + +import lombok.SneakyThrows; +import org.breedinginsight.brapi.client.BrAPIClientTest; +import org.breedinginsight.brapi.client.v2.endpoints.modules.core.ProgramsAPI; +import org.breedinginsight.brapi.client.v2.model.Program; +import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.HttpNotFoundException; +import org.breedinginsight.brapi.client.v2.endpoints.model.request.ProgramsRequest; +import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +public class ProgramsAPITests extends BrAPIClientTest { + + //TODO: Maybe query these before tests instead of hard coding. + private String programId = "program3"; + private String externalReferenceID = "https://brapi.org/specification"; + + private ProgramsAPI programsAPI = new ProgramsAPI(this.client); + + @Test + @SneakyThrows + public void getProgramsSuccess() { + List programs = this.programsAPI.getPrograms(); + + assertEquals(true, !programs.isEmpty(), "List of programs was empty"); + } + + @Test + @SneakyThrows + public void getProgramByIDSuccess() { + Optional program = this.programsAPI.getProgramById(this.programId); + + assertEquals(true, program.isPresent(), "Program was not returned"); + } + + @Test + @SneakyThrows + public void getProgramByIdMissingID() { + + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional program = this.programsAPI.getProgramById("does not exist"); + }); + + // Check out return message is returned + String errorMsg = exception.getMessage(); + assertEquals(true, errorMsg.length() > 0, "Error message was not returned"); + } + + @Test + @SneakyThrows + public void getProgramByExternalReferenceIDSuccess() { + ProgramsRequest programsRequest = ProgramsRequest.builder() + .externalReferenceID(this.externalReferenceID) + .build(); + + List programs = this.programsAPI.getPrograms(programsRequest); + + assertEquals(true, programs.size() > 0, "List of programs was empty"); + } + + // This one fails because search parameters are not implemented yet. + @Test + @SneakyThrows + public void getProgramByExternalReferenceIDDoesNotExist() { + ProgramsRequest programsRequest = ProgramsRequest.builder() + .externalReferenceID("will not exist") + .build(); + + List programs = this.programsAPI.getPrograms(programsRequest); + + assertEquals(true, programs.size() == 0, "List of programs was not empty"); + } +} diff --git a/brapi-core-model/.gitignore b/brapi-core-model/.gitignore new file mode 100644 index 00000000..70e1a827 --- /dev/null +++ b/brapi-core-model/.gitignore @@ -0,0 +1,25 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +/target diff --git a/brapi-core-model/LICENSE b/brapi-core-model/LICENSE new file mode 100644 index 00000000..87f89622 --- /dev/null +++ b/brapi-core-model/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Breeding Insight + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/brapi-core-model/README.md b/brapi-core-model/README.md new file mode 100644 index 00000000..69836575 --- /dev/null +++ b/brapi-core-model/README.md @@ -0,0 +1,35 @@ +# brapi-core-model +BrAPI 2.0 Core Module Data Model + +See https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Core/2.0 + +To include this dependency in your project, add the following dependency: + +``` + + org.brapi + brapi-core-model + 2.0-SNAPSHOT + +``` + +### settings.xml +Currently, this package IS NOT in Maven Central, but hosted in GitHub Packages, you will need to modify your `settings.xml` file to add the following repository: + +``` + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-core-model + +``` + +You will also need to add a `server` configuration item: + +``` + + github + ${username} + ${password/token} + +``` diff --git a/brapi-core-model/pom.xml b/brapi-core-model/pom.xml new file mode 100644 index 00000000..14f7db0d --- /dev/null +++ b/brapi-core-model/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + org.brapi + brapi-core-model + 2.0-SNAPSHOT + + + 1.18.10 + + + + + com.fasterxml.jackson.core + jackson-annotations + 2.10.1 + + + + javax.validation + validation-api + 2.0.1.Final + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-core-model + + + + diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java new file mode 100755 index 00000000..03fac8ad --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java @@ -0,0 +1,54 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.constraints.NotNull; + +/** + * Contact + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiContact { + + /** + * The ID which uniquely identifies this contact MIAPPE V1.1 (DM-33) Person ID - An identifier for the data submitter. If that submitter is an individual, ORCID identifiers are recommended. + **/ + @JsonProperty("contactDbId") + @NotNull + private String contactDbId; + + /** + * The contacts email address MIAPPE V1.1 (DM-32) Person email - The electronic mail address of the person. + **/ + @JsonProperty("email") + private String email; + + /** + * The name of the institution which this contact is part of MIAPPE V1.1 (DM-35) Person affiliation - The institution the person belongs to + **/ + @JsonProperty("instituteName") + private String instituteName; + + /** + * The full name of this contact person MIAPPE V1.1 (DM-31) Person name - The name of the person (either full name or as used in scientific publications) + **/ + @JsonProperty("name") + private String name; + + /** + * The Open Researcher and Contributor ID for this contact person (orcid.org) MIAPPE V1.1 (DM-33) Person ID - An identifier for the data submitter. If that submitter is an individual, ORCID identifiers are recommended. + **/ + @JsonProperty("orcid") + private String orcid; + + /** + * The type of person this contact represents (ex: Coordinator, Scientist, PI, etc.) MIAPPE V1.1 (DM-34) Person role - Type of contribution of the person to the investigation + **/ + @JsonProperty("type") + private String type; +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java new file mode 100755 index 00000000..f6e4de6f --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java @@ -0,0 +1,51 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * A dataFile contains a URL and the relevant file metadata to represent a file + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiDataFile { + /** + * A human readable description of the file contents + **/ + @JsonProperty("fileDescription") + private String fileDescription; + + /** + * The MD5 Hash of the file contents to be used as a check sum + **/ + @JsonProperty("fileMD5Hash") + private String fileMD5Hash; + + /** + * The name of the file + **/ + @JsonProperty("fileName") + private String fileName; + + /** + * The size of the file in bytes + **/ + @JsonProperty("fileSize") + private Integer fileSize; + + /** + * The type or format of the file. Preferably MIME Type. + **/ + @JsonProperty("fileType") + private String fileType; + + /** + * The absolute URL where the file is located + **/ + @JsonProperty("fileURL") + private String fileURL; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java new file mode 100755 index 00000000..e3f35dc1 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java @@ -0,0 +1,62 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * DataLink + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiDataLink { + /** + * The structure of the data within a file. For example - VCF, table, image archive, multispectral image archives in EDAM ontology (used in Galaxy) + **/ + @JsonProperty("dataFormat") + private String dataFormat; + + /** + * The general description of this data link + **/ + @JsonProperty("description") + private String description; + + /** + * The MIME type of the file (ie text/csv, application/excel, application/zip). + **/ + @JsonProperty("fileFormat") + private String fileFormat; + + /** + * The name of the external data link MIAPPE V1.1 (DM-38) Data file description - Description of the format of the data file. May be a standard file format name, or a description of organization of the data in a tabular file. + **/ + @JsonProperty("name") + private String name; + + /** + * The description of the origin or ownership of this linked data. Could be a formal reference to software, method, or workflow. + **/ + @JsonProperty("provenance") + private String provenance; + + /** + * The general type of data. For example- Genotyping, Phenotyping raw data, Phenotyping reduced data, Environmental, etc + **/ + @JsonProperty("scientificType") + private String scientificType; + + /** + * MIAPPE V1.1 (DM-37) Data file link - Link to the data file (or digital object) in a public database or in a persistent institutional repository; or identifier of the data file when submitted together with the MIAPPE submission. + **/ + @JsonProperty("url") + private String url; + + /** + * MIAPPE V1.1 (DM-39) Data file version - The version of the dataset (the actual data). + **/ + @JsonProperty("version") + private String version; +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java new file mode 100755 index 00000000..10696941 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java @@ -0,0 +1,30 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.time.LocalDate; + +/** + * TrialNewRequestDatasetAuthorships + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiDatasetAuthorships { + @JsonProperty("datasetPUI") + private String datasetPUI; + + @JsonProperty("license") + private String license; + + @JsonProperty("publicReleaseDate") + private LocalDate publicReleaseDate; + + @JsonProperty("submissionDate") + private LocalDate submissionDate; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java new file mode 100755 index 00000000..e97ee3fa --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java @@ -0,0 +1,36 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * EnvironmentParameter + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiEnvironmentParameter { + @JsonProperty("description") + private String description; + + @JsonProperty("parameterName") + private String parameterName; + + @JsonProperty("parameterPUI") + private String parameterPUI; + + @JsonProperty("unit") + private String unit; + + @JsonProperty("unitPUI") + private String unitPUI; + + @JsonProperty("value") + private String value; + + @JsonProperty("valuePUI") + private String valuePUI; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java new file mode 100755 index 00000000..ac673b9c --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * The experimental and statistical design full description plus a category PUI taken from crop research ontology or agronomy ontology + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiExperimentalDesign { + @JsonProperty("PUI") + private String PUI; + + @JsonProperty("description") + private String description; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java new file mode 100755 index 00000000..29b6875a --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java @@ -0,0 +1,24 @@ +package org.brapi.v2.core.model; + +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI. + */ +@EqualsAndHashCode +@ToString +public class BrApiExternalReferences extends ArrayList { + + public BrApiExternalReferences() { + super(); + } + + public BrApiExternalReferences(Collection c) { + super(c); + } + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java new file mode 100755 index 00000000..4f3ab63c --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * ExternalReferencesInner + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiExternalReferencesInner { + @JsonProperty("referenceID") + private Object referenceID; + + @JsonProperty("referenceSource") + private String referenceSource; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java new file mode 100755 index 00000000..e4ef0633 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * One geometry as defined by GeoJSON (RFC 7946). All coordinates are decimal values on the WGS84 geographic coordinate reference system. Copied from RFC 7946 Section 3.1.1 A position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element. + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiGeoJSON { + @JsonProperty("geometry") + private BrApiOneOfGeoJSONGeometry geometry; + + @JsonProperty("type") + private String type = "Feature"; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java new file mode 100755 index 00000000..9cb07749 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * Short description of the facility in which the study was carried out. + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiGrowthFacility { + @JsonProperty("PUI") + private String PUI; + + @JsonProperty("description") + private String description; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java new file mode 100755 index 00000000..b6f9b405 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java @@ -0,0 +1,23 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.time.OffsetDateTime; + +/** + * The date and time when this study was last modified + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiLastUpdate { + @JsonProperty("timestamp") + private OffsetDateTime timestamp; + + @JsonProperty("version") + private String version; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java new file mode 100755 index 00000000..b68548bd --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java @@ -0,0 +1,15 @@ +package org.brapi.v2.core.model; + +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.ArrayList; + +/** + * An array of at least four positions where the first equals the last + */ +@EqualsAndHashCode +@ToString +public class BrApiLinearRing extends ArrayList { + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java new file mode 100755 index 00000000..bee0c615 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java @@ -0,0 +1,76 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.Map; + +/** + * Location + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiLocation { + @JsonProperty("locationDbId") + private String locationDbId; + + @JsonProperty("abbreviation") + private String abbreviation; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("coordinateDescription") + private String coordinateDescription; + + @JsonProperty("coordinateUncertainty") + private String coordinateUncertainty; + + @JsonProperty("coordinates") + private BrApiGeoJSON coordinates; + + @JsonProperty("countryCode") + private String countryCode; + + @JsonProperty("countryName") + private String countryName; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("environmentType") + private String environmentType; + + @JsonProperty("exposure") + private String exposure; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("instituteAddress") + private String instituteAddress; + + @JsonProperty("instituteName") + private String instituteName; + + @JsonProperty("locationName") + private String locationName; + + @JsonProperty("locationType") + private String locationType; + + @JsonProperty("siteStatus") + private String siteStatus; + + @JsonProperty("slope") + private String slope; + + @JsonProperty("topography") + private String topography; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java new file mode 100755 index 00000000..44e79b47 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java @@ -0,0 +1,17 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * Model202AcceptedSearchResponseResult + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiModel202AcceptedSearchResponseResult { + @JsonProperty("searchResultsDbId") + private String searchResultsDbId; +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java new file mode 100755 index 00000000..d3b5162b --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java @@ -0,0 +1,9 @@ +package org.brapi.v2.core.model; + + +/** +* OneOfGeoJSONGeometry +*/ +public interface BrApiOneOfGeoJSONGeometry { + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java new file mode 100755 index 00000000..5f2192a9 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java @@ -0,0 +1,9 @@ +package org.brapi.v2.core.model; + + +/** +* OneOfGeoJSONSearchAreaGeometry +*/ +public interface BrApiOneOfGeoJSONSearchAreaGeometry { + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java new file mode 100755 index 00000000..bf3b8105 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java @@ -0,0 +1,31 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.List; + +/** + * MIAPPE V1.1 (DM-85) Variable accession number - Accession number of the variable in the Crop Ontology (DM-87) Trait accession number - Accession number of the trait in a suitable controlled vocabulary (Crop Ontology, Trait Ontology). (DM-89) Method accession number - Accession number of the method in a suitable controlled vocabulary (Crop Ontology, Trait Ontology). (DM-93) Scale accession number - Accession number of the scale in a suitable controlled vocabulary (Crop Ontology). + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiOntologyReference { + @JsonProperty("documentationLinks") + @Valid + private List documentationLinks; + + @JsonProperty("ontologyDbId") + private String ontologyDbId; + + @JsonProperty("ontologyName") + private String ontologyName; + + @JsonProperty("version") + private String version; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java new file mode 100755 index 00000000..c1ef706d --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java @@ -0,0 +1,30 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * OntologyReferenceDocumentationLinks + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiOntologyReferenceDocumentationLinks { + @JsonProperty("URL") + private String URL; + + @JsonProperty("type") + private TypeEnum type; + + /** + * Gets or Sets type + */ + public enum TypeEnum { + OBO, + RDF, + WEBPAGE; + } + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java new file mode 100755 index 00000000..65821d09 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java @@ -0,0 +1,52 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.Map; + +/** + * Person + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiPerson { + @JsonProperty("personDbId") + private String personDbId; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("description") + private String description; + + @JsonProperty("emailAddress") + private String emailAddress; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("mailingAddress") + private String mailingAddress; + + @JsonProperty("middleName") + private String middleName; + + @JsonProperty("phoneNumber") + private String phoneNumber; + + @JsonProperty("userID") + private String userID; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java new file mode 100755 index 00000000..da4f050c --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * Copied from RFC 7946 Section 3.1.1 A position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element. + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiPointGeometry implements BrApiOneOfGeoJSONSearchAreaGeometry, BrApiOneOfGeoJSONGeometry { + @JsonProperty("coordinates") + private BrApiPosition coordinates; + + @JsonProperty("type") + private String type = "Point"; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java new file mode 100755 index 00000000..89df982b --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java @@ -0,0 +1,14 @@ +package org.brapi.v2.core.model; + +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.ArrayList; + +/** + * An array of linear rings + */ +@EqualsAndHashCode +@ToString +public class BrApiPolygon extends ArrayList { +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java new file mode 100755 index 00000000..6281fc3a --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java @@ -0,0 +1,21 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * An array of Linear Rings. Each Linear Ring is an array of Points. A Point is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element. + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiPolygonGeometry implements BrApiOneOfGeoJSONSearchAreaGeometry, BrApiOneOfGeoJSONGeometry { + @JsonProperty("coordinates") + private BrApiPolygon coordinates; + + @JsonProperty("type") + private String type = "Polygon"; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java new file mode 100755 index 00000000..46758069 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java @@ -0,0 +1,16 @@ +package org.brapi.v2.core.model; + +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.ArrayList; + +/** + * A single position + */ +@EqualsAndHashCode +@ToString +public class BrApiPosition extends ArrayList { + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java new file mode 100755 index 00000000..91151b21 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -0,0 +1,53 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.Map; + +/** + * Program + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiProgram { + @JsonProperty("programDbId") + private String programDbId; + + @JsonProperty("abbreviation") + private String abbreviation; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("commonCropName") + @NotNull + private String commonCropName; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("externalReferences") + @Valid + private BrApiExternalReferences externalReferences; + + @JsonProperty("leadPersonDbId") + private String leadPersonDbId; + + @JsonProperty("leadPersonName") + private String leadPersonName; + + @JsonProperty("objective") + private String objective; + + @JsonProperty("programName") + @NotNull + private String programName; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java new file mode 100755 index 00000000..605cc243 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java @@ -0,0 +1,20 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * TrialNewRequestPublications + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiRequestPublications { + @JsonProperty("publicationPUI") + private String publicationPUI; + + @JsonProperty("publicationReference") + private String publicationReference; +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java new file mode 100755 index 00000000..dd954ee4 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java @@ -0,0 +1,27 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.constraints.NotNull; + +/** + * Season + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiSeason { + @JsonProperty("season") + private String season; + + @JsonProperty("seasonDbId") + @NotNull + private String seasonDbId; + + @JsonProperty("year") + private Integer year; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java new file mode 100755 index 00000000..6b5ede0b --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java @@ -0,0 +1,44 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * ServerInfo + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiServerInfo { + @JsonProperty("calls") + @Valid + private List calls = new ArrayList(); + + @JsonProperty("contactEmail") + private String contactEmail; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("location") + private String location; + + @JsonProperty("organizationName") + private String organizationName; + + @JsonProperty("organizationURL") + private String organizationURL; + + @JsonProperty("serverDescription") + private String serverDescription; + + @JsonProperty("serverName") + private String serverName; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java new file mode 100755 index 00000000..dd2ab1d9 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java @@ -0,0 +1,79 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * Service + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiService { + @JsonProperty("dataTypes") + @Valid + private List dataTypes; + + @JsonProperty("methods") + @Valid + private List methods = new ArrayList(); + + @JsonProperty("service") + private String service; + + @JsonProperty("versions") + @Valid + private List versions = new ArrayList(); + + /** + * Gets or Sets methods + */ + public enum MethodsEnum { + GET, + POST, + PUT, + DELETE; + } + + /** + * Gets or Sets versions + */ + public enum VersionsEnum { + _0("2.0"), + + _1("2.1"), + + _2("2.2"); + + private String value; + + VersionsEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VersionsEnum fromValue(String text) { + for (VersionsEnum b : VersionsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java new file mode 100755 index 00000000..eba92d71 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -0,0 +1,104 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Study + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiStudy { + @JsonProperty("studyDbId") + private String studyDbId; + + @JsonProperty("active") + private Boolean active; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("commonCropName") + private String commonCropName; + + @JsonProperty("contacts") + @Valid + private List contacts; + + @JsonProperty("culturalPractices") + private String culturalPractices; + + @JsonProperty("dataLinks") + @Valid + private List dataLinks; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("endDate") + private OffsetDateTime endDate; + + @JsonProperty("environmentParameters") + @Valid + private List environmentParameters; + + @JsonProperty("experimentalDesign") + private BrApiExperimentalDesign experimentalDesign; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("growthFacility") + private BrApiGrowthFacility growthFacility; + + @JsonProperty("lastUpdate") + private BrApiLastUpdate lastUpdate; + + @JsonProperty("license") + private String license; + + @JsonProperty("locationDbId") + private String locationDbId; + + @JsonProperty("locationName") + private String locationName; + + @JsonProperty("observationUnitsDescription") + private String observationUnitsDescription; + + @JsonProperty("seasons") + @Valid + private List seasons; + + @JsonProperty("startDate") + private OffsetDateTime startDate; + + @JsonProperty("studyDescription") + private String studyDescription; + + @JsonProperty("studyName") + private String studyName; + + @JsonProperty("studyPUI") + private String studyPUI; + + @JsonProperty("studyType") + private String studyType; + + @JsonProperty("trialDbId") + private String trialDbId; + + @JsonProperty("trialName") + private String trialName; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java new file mode 100755 index 00000000..089aa8b7 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java @@ -0,0 +1,72 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; + +/** + * Trial + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiTrial { + @JsonProperty("trialDbId") + private String trialDbId; + + @JsonProperty("active") + private Boolean active; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("commonCropName") + private String commonCropName; + + @JsonProperty("contacts") + @Valid + private List contacts; + + @JsonProperty("datasetAuthorships") + @Valid + private List datasetAuthorships; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("endDate") + private LocalDate endDate; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("programDbId") + private String programDbId; + + @JsonProperty("programName") + private String programName; + + @JsonProperty("publications") + @Valid + private List publications; + + @JsonProperty("startDate") + private LocalDate startDate; + + @JsonProperty("trialDescription") + private String trialDescription; + + @JsonProperty("trialName") + private String trialName; + + @JsonProperty("trialPUI") + private String trialPUI; + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java new file mode 100755 index 00000000..fb1165d5 --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java @@ -0,0 +1,36 @@ +package org.brapi.v2.core.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets WSMIMEDataTypes + */ +public enum BrApiWSMIMEDataTypes { + APPLICATION_JSON("application/json"), + TEXT_CSV("text/csv"), + TEXT_TSV("text/tsv"), + APPLICATION_FLAPJACK("application/flapjack"); + + private String value; + + BrApiWSMIMEDataTypes(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BrApiWSMIMEDataTypes fromValue(String text) { + for (BrApiWSMIMEDataTypes b : BrApiWSMIMEDataTypes.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/brapi-genotype-model/README.md b/brapi-genotype-model/README.md new file mode 100644 index 00000000..aa67d3a5 --- /dev/null +++ b/brapi-genotype-model/README.md @@ -0,0 +1 @@ +BrAPI genotype module models. \ No newline at end of file diff --git a/brapi-germplasm-model/README.md b/brapi-germplasm-model/README.md new file mode 100644 index 00000000..ea6bdad3 --- /dev/null +++ b/brapi-germplasm-model/README.md @@ -0,0 +1 @@ +BrAPI germplasm module models. \ No newline at end of file diff --git a/brapi-pheno-model/.gitignore b/brapi-pheno-model/.gitignore new file mode 100644 index 00000000..670d5fec --- /dev/null +++ b/brapi-pheno-model/.gitignore @@ -0,0 +1,25 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +/target \ No newline at end of file diff --git a/brapi-pheno-model/LICENSE b/brapi-pheno-model/LICENSE new file mode 100644 index 00000000..87f89622 --- /dev/null +++ b/brapi-pheno-model/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Breeding Insight + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/brapi-pheno-model/README.md b/brapi-pheno-model/README.md new file mode 100644 index 00000000..461af05e --- /dev/null +++ b/brapi-pheno-model/README.md @@ -0,0 +1,82 @@ +# brapi-pheno-model +BrAPI 2.0 Phenotyping Module Data Model + +See https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Phenotyping/2.0 + +To include this dependency in your project, add the following dependency: + +``` + + org.brapi + brapi-pheno-model + 2.0-SNAPSHOT + +``` + +### settings.xml +Currently, this package ***IS NOT*** in Maven Central, but hosted in GitHub Packages, you will need to modify your `settings.xml` file to add the following repository: + +``` + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-pheno-model + +``` + +You will also need to add a `server` configuration item: + +``` + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + +``` + +`GITHUB_ACTOR` - your GitHub username +`GITHUB_TOKEN` - You can generate a token for authenticating to GitHub's package manager by following these instructions: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line. +*Note: your token needs to at least have `read:package` rights. + +An example `settings.xml` file: + +```xml + + + + github + + + + + github + + + central + https://repo1.maven.org/maven2 + true + true + + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-pheno-model + + + + + + + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + + + +``` + +If you don't want to modify your global `settings.xml`, you can create one to live in your code, then when running maven commands, include the `--settings` flag, ex: `mvn clean install --settings settings.xml` \ No newline at end of file diff --git a/brapi-pheno-model/pom.xml b/brapi-pheno-model/pom.xml new file mode 100644 index 00000000..ccac17c8 --- /dev/null +++ b/brapi-pheno-model/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + org.brapi + brapi-pheno-model + 2.0-SNAPSHOT + + + 1.18.10 + + + + + org.brapi + brapi-core-model + 2.0-SNAPSHOT + + + + com.fasterxml.jackson.core + jackson-annotations + 2.10.1 + + + + javax.validation + validation-api + 2.0.1.Final + + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-pheno-model + + + + diff --git a/brapi-pheno-model/settings.xml b/brapi-pheno-model/settings.xml new file mode 100644 index 00000000..737451f0 --- /dev/null +++ b/brapi-pheno-model/settings.xml @@ -0,0 +1,36 @@ + + + + github + + + + + github + + + central + https://repo1.maven.org/maven2 + true + true + + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi-core-model + + + + + + + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + + + diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java new file mode 100755 index 00000000..09afbc11 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java @@ -0,0 +1,51 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Event + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiEvent { + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("date") + @Valid + private List date; + + @JsonProperty("eventDbId") + private String eventDbId; + + @JsonProperty("eventDescription") + private String eventDescription; + + @JsonProperty("eventParameters") + @Valid + private List eventParameters; + + @JsonProperty("eventType") + private String eventType; + + @JsonProperty("eventTypeDbId") + private String eventTypeDbId; + + @JsonProperty("observationUnitDbIds") + @Valid + private List observationUnitDbIds; + + @JsonProperty("studyDbId") + private String studyDbId; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java new file mode 100755 index 00000000..45b82010 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java @@ -0,0 +1,24 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * EventEventParameters + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiEventParameters { + @JsonProperty("key") + private String key; + + @JsonProperty("rdfValue") + private String rdfValue; + + @JsonProperty("value") + private String value; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java new file mode 100755 index 00000000..8b345b78 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java @@ -0,0 +1,76 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiGeoJSON; + +import javax.validation.Valid; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Image + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiImage { + @JsonProperty("imageDbId") + private String imageDbId; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("copyright") + private String copyright; + + @JsonProperty("description") + private String description; + + @JsonProperty("descriptiveOntologyTerms") + @Valid + private List descriptiveOntologyTerms; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("imageFileName") + private String imageFileName; + + @JsonProperty("imageFileSize") + private Integer imageFileSize; + + @JsonProperty("imageHeight") + private Integer imageHeight; + + @JsonProperty("imageLocation") + private BrApiGeoJSON imageLocation; + + @JsonProperty("imageName") + private String imageName; + + @JsonProperty("imageTimeStamp") + private OffsetDateTime imageTimeStamp; + + @JsonProperty("imageURL") + private String imageURL; + + @JsonProperty("imageWidth") + private Integer imageWidth; + + @JsonProperty("mimeType") + private String mimeType; + + @JsonProperty("observationDbIds") + @Valid + private List observationDbIds; + + @JsonProperty("observationUnitDbId") + private String observationUnitDbId; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java new file mode 100755 index 00000000..c8569e74 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java @@ -0,0 +1,48 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiOntologyReference; + +import javax.validation.Valid; +import java.util.Map; + +/** + * Method + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiMethod { + @JsonProperty("methodDbId") + private String methodDbId; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("bibliographicalReference") + private String bibliographicalReference; + + @JsonProperty("description") + private String description; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("formula") + private String formula; + + @JsonProperty("methodClass") + private String methodClass; + + @JsonProperty("methodName") + private String methodName; + + @JsonProperty("ontologyReference") + private BrApiOntologyReference ontologyReference; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java new file mode 100755 index 00000000..7d83bbf8 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java @@ -0,0 +1,77 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiSeason; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * Observation + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservation { + @JsonProperty("observationDbId") + private String observationDbId; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("collector") + @NotNull + private String collector; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("germplasmDbId") + @NotNull + private String germplasmDbId; + + @JsonProperty("germplasmName") + private String germplasmName; + + @JsonProperty("observationTimeStamp") + @NotNull + private OffsetDateTime observationTimeStamp; + + @JsonProperty("observationUnitDbId") + @NotNull + private String observationUnitDbId; + + @JsonProperty("observationUnitName") + private String observationUnitName; + + @JsonProperty("observationVariableDbId") + @NotNull + private String observationVariableDbId; + + @JsonProperty("observationVariableName") + private String observationVariableName; + + @JsonProperty("season") + @NotNull + private BrApiSeason season; + + @JsonProperty("studyDbId") + @NotNull + private String studyDbId; + + @JsonProperty("uploadedBy") + @NotNull + private String uploadedBy; + + @JsonProperty("value") + @NotNull + private String value; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java new file mode 100644 index 00000000..1a5c5c72 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java @@ -0,0 +1,37 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * observation levels available in this database + */ +public enum BrApiObservationLevel { + FIELD("field"), + PLOT("plot"), + SUBPLOT("subplot"), + PLANT("plant"), + SAMPLE("sample"); + + private String value; + + BrApiObservationLevel(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BrApiObservationLevel fromValue(String text) { + for (BrApiObservationLevel b : BrApiObservationLevel.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java new file mode 100755 index 00000000..2151fa54 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java @@ -0,0 +1,34 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.List; + +/** + * ObservationTable + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationTable { + @JsonProperty("data") + @Valid + private List> data; + + @JsonProperty("headerRow") + @Valid + private List headerRow; + + @JsonProperty("observationVariableDbIds") + @Valid + private List observationVariableDbIds; + + @JsonProperty("observationVariableNames") + @Valid + private List observationVariableNames; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java new file mode 100755 index 00000000..3c46efd7 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java @@ -0,0 +1,21 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * ObservationTreatment + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationTreatment { + @JsonProperty("factor") + private String factor; + + @JsonProperty("modality") + private String modality; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java new file mode 100755 index 00000000..5e11fa59 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java @@ -0,0 +1,85 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; + +/** + * ObservationUnit + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationUnit { + @JsonProperty("observationUnitDbId") + private String observationUnitDbId; + + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("germplasmDbId") + private String germplasmDbId; + + @JsonProperty("germplasmName") + private String germplasmName; + + @JsonProperty("locationDbId") + private String locationDbId; + + @JsonProperty("locationName") + private String locationName; + + @JsonProperty("observationLevel") + private BrApiObservationLevel observationLevel; + + @JsonProperty("observationUnitName") + private String observationUnitName; + + @JsonProperty("observationUnitPUI") + private String observationUnitPUI; + + @JsonProperty("observationUnitPosition") + private BrApiObservationUnitPosition observationUnitPosition; + + @JsonProperty("plantNumber") + private String plantNumber; + + @JsonProperty("plotNumber") + private String plotNumber; + + @JsonProperty("programDbId") + private String programDbId; + + @JsonProperty("programName") + private String programName; + + @JsonProperty("seedLotDbId") + private String seedLotDbId; + + @JsonProperty("studyDbId") + private String studyDbId; + + @JsonProperty("studyName") + private String studyName; + + @JsonProperty("treatments") + @Valid + private List treatments; + + @JsonProperty("trialDbId") + private String trialDbId; + + @JsonProperty("trialName") + private String trialName; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java new file mode 100755 index 00000000..6f8a697f --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java @@ -0,0 +1,64 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiGeoJSON; + +/** + * All positional and layout information related to this Observation Unit MIAPPE V1.1 (DM-73) Spatial distribution - Type and value of a spatial coordinate (georeference or relative) or level of observation (plot 45, subblock 7, block 2) provided as a key-value pair of the form type:value. Levels of observation must be consistent with those listed in the Study section. + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationUnitPosition { + @JsonProperty("blockNumber") + private String blockNumber; + + @JsonProperty("entryNumber") + private String entryNumber; + + /** + * The type of entry for this observation unit. ex. \"CHECK\", \"TEST\", \"FILLER\" + */ + public enum EntryTypeEnum { + CHECK, + TEST, + FILLER; + } + @JsonProperty("entryType") + private EntryTypeEnum entryType; + + @JsonProperty("geoCoordinates") + private BrApiGeoJSON geoCoordinates; + + @JsonProperty("positionCoordinateX") + private String positionCoordinateX; + + /** + * The type of positional coordinate used. Must be one of the following values LONGITUDE - ISO 6709 standard, WGS84 geodetic datum. See 'Location Coordinate Encoding' for details LATITUDE - ISO 6709 standard, WGS84 geodetic datum. See 'Location Coordinate Encoding' for details PLANTED_ROW - The physical planted row number PLANTED_INDIVIDUAL - The physical counted number, could be independant or within a planted row GRID_ROW - The row index number of a square grid overlay GRID_COL - The column index number of a square grid overlay MEASURED_ROW - The distance in meters from a defined 0-th row MEASURED_COL - The distance in meters from a defined 0-th column + */ + public enum PositionCoordinateType { + LONGITUDE, + LATITUDE, + PLANTED_ROW, + PLANTED_INDIVIDUAL, + GRID_ROW, + GRID_COL, + MEASURED_ROW, + MEASURED_COL; + } + @JsonProperty("positionCoordinateXType") + private PositionCoordinateType positionCoordinateXType; + + @JsonProperty("positionCoordinateY") + private String positionCoordinateY; + + @JsonProperty("positionCoordinateYType") + private PositionCoordinateType positionCoordinateYType; + + @JsonProperty("replicate") + private String replicate; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java new file mode 100755 index 00000000..debc1250 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java @@ -0,0 +1,30 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.List; + +/** + * ObservationUnitTable + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationUnitTable { + @JsonProperty("data") + @Valid + private List> data; + + @JsonProperty("headerRow") + @Valid + private List headerRow; + + @JsonProperty("observationVariables") + @Valid + private List observationVariables; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java new file mode 100755 index 00000000..e5b135ee --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java @@ -0,0 +1,21 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * ObservationUnitTableObservationVariables + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationUnitTableObservationVariables { + @JsonProperty("observationVariableDbId") + private String observationVariableDbId; + + @JsonProperty("observationVariableName") + private String observationVariableName; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java new file mode 100755 index 00000000..be733dbe --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java @@ -0,0 +1,21 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * ObservationVariable + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiObservationVariable extends BrApiVariable { + @JsonProperty("observationVariableDbId") + private String observationVariableDbId; + + @JsonProperty("observationVariableName") + private String observationVariableName; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java new file mode 100755 index 00000000..1afa99da --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java @@ -0,0 +1,46 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.Map; + +/** + * Ontology + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiOntology { + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("authors") + private String authors; + + @JsonProperty("copyright") + private String copyright; + + @JsonProperty("description") + private String description; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("licence") + private String licence; + + @JsonProperty("ontologyDbId") + private String ontologyDbId; + + @JsonProperty("ontologyName") + private String ontologyName; + + @JsonProperty("version") + private String version; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java new file mode 100755 index 00000000..72a47e5b --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java @@ -0,0 +1,38 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiOntologyReference; + +/** + * Scale + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiScale { + @JsonProperty("scaleDbId") + private String scaleDbId; + + @JsonProperty("dataType") + private BrApiTraitDataType dataType; + + @JsonProperty("decimalPlaces") + private Integer decimalPlaces; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("ontologyReference") + private BrApiOntologyReference ontologyReference; + + @JsonProperty("scaleName") + private String scaleName; + + @JsonProperty("validValues") + private BrApiScaleValidValues validValues; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java new file mode 100755 index 00000000..830167bc --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java @@ -0,0 +1,21 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * ScaleBaseClassValidValuesCategories + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiScaleCategories { + @JsonProperty("label") + private String label; + + @JsonProperty("value") + private String value; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java new file mode 100755 index 00000000..fb3862ae --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java @@ -0,0 +1,28 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.validation.Valid; +import java.util.List; + +/** + * ScaleBaseClassValidValues + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiScaleValidValues { + @JsonProperty("categories") + @Valid + private List categories; + + @JsonProperty("max") + private Integer max; + + @JsonProperty("min") + private Integer min; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java new file mode 100755 index 00000000..2fc85b81 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java @@ -0,0 +1,58 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiOntologyReference; + +import javax.validation.Valid; +import java.util.List; + +/** + * TraitBaseClass + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiTrait { + @JsonProperty("traitDbId") + private String traitDbId; + + @JsonProperty("alternativeAbbreviations") + @Valid + private List alternativeAbbreviations; + + @JsonProperty("attribute") + private String attribute; + + @JsonProperty("entity") + private String entity; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("mainAbbreviation") + private String mainAbbreviation; + + @JsonProperty("ontologyReference") + private BrApiOntologyReference ontologyReference; + + @JsonProperty("status") + private String status; + + @JsonProperty("synonyms") + @Valid + private List synonyms; + + @JsonProperty("traitClass") + private String traitClass; + + @JsonProperty("traitDescription") + private String traitDescription; + + @JsonProperty("traitName") + private String traitName; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java new file mode 100755 index 00000000..92ea6f82 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java @@ -0,0 +1,39 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + *

Class of the scale, entries can be

\"Code\" - This scale class is exceptionally used to express complex traits. Code is a nominal scale that combines the expressions of the different traits composing the complex trait. For example a severity trait might be expressed by a 2 digit and 2 character code. The first 2 digits are the percentage of the plant covered by a fungus and the 2 characters refer to the delay in development, e.g. \"75VD\" means \"75 %\" of the plant is infected and the plant is very delayed.

\"Date\" - The date class is for events expressed in a time format, See ISO 8601

\"Duration\" - The Duration class is for time elapsed between two events expressed in a time format, e.g. days, hours, months

\"Nominal\" - Categorical scale that can take one of a limited and fixed number of categories. There is no intrinsic ordering to the categories

\"Numerical\" - Numerical scales express the trait with real numbers. The numerical scale defines the unit e.g. centimeter, ton per hectare, branches

\"Ordinal\" - Ordinal scales are scales composed of ordered categories

\"Text\" - A free text is used to express the trait.

+ */ +public enum BrApiTraitDataType { + CODE("Code"), + DATE("Date"), + DURATION("Duration"), + NOMINAL("Nominal"), + NUMERICAL("Numerical"), + ORDINAL("Ordinal"), + TEXT("Text"); + + private String value; + + BrApiTraitDataType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BrApiTraitDataType fromValue(String text) { + for (BrApiTraitDataType b : BrApiTraitDataType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java new file mode 100755 index 00000000..d48fd90d --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -0,0 +1,76 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiOntologyReference; + +import javax.validation.Valid; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Variable + */ +@Data +@SuperBuilder +@NoArgsConstructor +public class BrApiVariable { + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + + @JsonProperty("commonCropName") + private String commonCropName; + + @JsonProperty("contextOfUse") + @Valid + private List contextOfUse; + + @JsonProperty("defaultValue") + private String defaultValue; + + @JsonProperty("documentationURL") + private String documentationURL; + + @JsonProperty("externalReferences") + private BrApiExternalReferences externalReferences; + + @JsonProperty("growthStage") + private String growthStage; + + @JsonProperty("institution") + private String institution; + + @JsonProperty("language") + private String language; + + @JsonProperty("method") + private BrApiMethod method; + + @JsonProperty("ontologyReference") + private BrApiOntologyReference ontologyReference; + + @JsonProperty("scale") + private BrApiScale scale; + + @JsonProperty("scientist") + private String scientist; + + @JsonProperty("status") + private String status; + + @JsonProperty("submissionTimestamp") + private OffsetDateTime submissionTimestamp; + + @JsonProperty("synonyms") + @Valid + private List synonyms; + + @JsonProperty("trait") + private BrApiTrait trait; + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java new file mode 100644 index 00000000..854fbc82 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java @@ -0,0 +1,46 @@ +package org.brapi.v2.phenotyping.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * valid header fields + */ +public enum HeaderRowName { + OBSERVATIONTIMESTAMP("observationTimeStamp"), + STUDYDBID("studyDbId"), + STUDYNAME("studyName"), + GERMPLASMDBID("germplasmDbId"), + GERMPLASMNAME("germplasmName"), + OBSERVATIONUNITDBID("observationUnitDbId"), + OBSERVATIONUNITNAME("observationUnitName"), + PLOTNUMBER("plotNumber"), + PLANTNUMBER("plantNumber"), + BLOCKNUMBER("blockNumber"), + ENTRYNUMBER("entryNumber"), + REPLICATE("replicate"), + POSITIONCOORDINATEX("positionCoordinateX"), + POSITIONCOORDINATEY("positionCoordinateY"); + + private String value; + + HeaderRowName(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static HeaderRowName fromValue(String text) { + for (HeaderRowName b : HeaderRowName.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} From b6f76fa6adefc6980dbab58c350af0a0153f12f6 Mon Sep 17 00:00:00 2001 From: Chris T Date: Fri, 10 Apr 2020 15:21:49 -0400 Subject: [PATCH 02/71] set up module structure --- .github/workflows/package-deploy.yml | 27 +++++++++++++++++++++++++++ brapi-client/pom.xml | 13 ++++++++++++- brapi-core-model/pom.xml | 6 ++++++ pom.xml | 21 +++++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/package-deploy.yml create mode 100644 pom.xml diff --git a/.github/workflows/package-deploy.yml b/.github/workflows/package-deploy.yml new file mode 100644 index 00000000..058f327b --- /dev/null +++ b/.github/workflows/package-deploy.yml @@ -0,0 +1,27 @@ +name: Java CI + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 12 + uses: actions/setup-java@v1.3.0 + with: + java-version: 12 + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy + env: + GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password + © 2020 GitHub, Inc. \ No newline at end of file diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml index 0a9102ab..a62a67d7 100644 --- a/brapi-client/pom.xml +++ b/brapi-client/pom.xml @@ -5,7 +5,13 @@ 4.0.0 org.breedinginsight brapi-client - 1.0-SNAPSHOT + 2.0-SNAPSHOT + + + org.brapi + brapi + 2.0-SNAPSHOT + 8 @@ -43,6 +49,11 @@ test + + org.brapi + brapi-core-model + 2.0-SNAPSHOT + diff --git a/brapi-core-model/pom.xml b/brapi-core-model/pom.xml index 14f7db0d..fbbccbd4 100644 --- a/brapi-core-model/pom.xml +++ b/brapi-core-model/pom.xml @@ -8,6 +8,12 @@ brapi-core-model 2.0-SNAPSHOT + + org.brapi + brapi + 2.0-SNAPSHOT + + 1.18.10 diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..15c5ad3d --- /dev/null +++ b/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + org.brapi + brapi + 2.0-SNAPSHOT + + brapi + http://www.breedinginsight.org + pom + + + brapi-core-model + brapi-pheno-model + brapi-client + + + From 3f941c5ef8a30be6d817d44f41685f10ea03faf8 Mon Sep 17 00:00:00 2001 From: Chris T Date: Fri, 10 Apr 2020 15:22:48 -0400 Subject: [PATCH 03/71] remove copy and paste error --- .github/workflows/package-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/package-deploy.yml b/.github/workflows/package-deploy.yml index 058f327b..6baf10a5 100644 --- a/.github/workflows/package-deploy.yml +++ b/.github/workflows/package-deploy.yml @@ -23,5 +23,4 @@ jobs: - name: Publish to GitHub Packages Apache Maven run: mvn deploy env: - GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password - © 2020 GitHub, Inc. \ No newline at end of file + GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password \ No newline at end of file From 89a4b1d9da94f49c9ebc0e3f1bb643e86714e350 Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 13 Apr 2020 09:33:30 -0400 Subject: [PATCH 04/71] move models into brapi-core-model --- .../client/v2}/BrAPIClient.java | 15 +++---- .../client/v2}/BrAPIEndpoint.java | 2 +- .../client/v2}/ResponseHandlerFunction.java | 4 +- .../client/v2}/model/BrAPIRequest.java | 2 +- .../org/brapi/client/v2/model/HttpMethod.java | 5 +++ .../v2}/model/exceptions/APIException.java | 2 +- .../exceptions/HttpBadRequestException.java | 2 +- .../v2}/model/exceptions/HttpException.java | 2 +- .../exceptions/HttpForbiddenException.java | 2 +- .../exceptions/HttpInternalServerError.java | 2 +- .../exceptions/HttpNotFoundException.java | 2 +- .../exceptions/HttpUnauthorizedException.java | 2 +- .../modules/core/BrAPICoreEndpoints_V2.java | 2 +- .../client/v2}/modules/core/ProgramsAPI.java | 41 ++++++++++--------- .../genotype/BrAPIGenotypeEndpoints_V2.java | 4 ++ .../germplasm/BrAPIGermplasmEndpoints_V2.java | 4 ++ .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 ++ .../client/v2/endpoints/model/HttpMethod.java | 5 --- .../genotype/BrAPIGenotypeEndpoints_V2.java | 4 -- .../germplasm/BrAPIGermplasmEndpoints_V2.java | 4 -- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 -- .../client/v2/model/ExternalReference.java | 19 --------- .../brapi/client/v2/model/Program.java | 27 ------------ .../client/v2}/BrAPIClientTest.java | 4 +- .../v2}/modules/core/ProgramsAPITests.java | 24 ++++++----- brapi-core-model/.gitignore | 1 + ...Inner.java => BrApiExternalReference.java} | 2 +- .../core/model/BrApiExternalReferences.java | 24 ----------- .../brapi/v2/core/model/BrApiLocation.java | 3 +- .../org/brapi/v2/core/model/BrApiPerson.java | 3 +- .../org/brapi/v2/core/model/BrApiProgram.java | 3 +- .../org/brapi/v2/core/model/BrApiStudy.java | 2 +- .../org/brapi/v2/core/model/BrApiTrial.java | 2 +- .../v2/core}/model/request/BaseRequest.java | 2 +- .../core}/model/request/ProgramsRequest.java | 2 +- .../core}/model/response/BrAPIResponse.java | 2 +- .../v2/core}/model/response/DataResponse.java | 6 +-- .../v2/core}/model/response/Metadata.java | 2 +- .../model/response/MetadataPagination.java | 2 +- .../brapi/v2/core}/model/response/Status.java | 2 +- brapi-pheno-model/.gitignore | 3 +- .../v2/phenotyping/model/BrApiImage.java | 4 +- .../v2/phenotyping/model/BrApiMethod.java | 5 ++- .../phenotyping/model/BrApiObservation.java | 5 ++- .../model/BrApiObservationUnit.java | 4 +- .../v2/phenotyping/model/BrApiScale.java | 6 ++- .../v2/phenotyping/model/BrApiTrait.java | 4 +- .../v2/phenotyping/model/BrApiVariable.java | 4 +- pom.xml | 13 ++++++ 49 files changed, 125 insertions(+), 169 deletions(-) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/BrAPIClient.java (92%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/BrAPIEndpoint.java (82%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/ResponseHandlerFunction.java (60%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/BrAPIRequest.java (84%) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/APIException.java (88%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpBadRequestException.java (67%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpException.java (63%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpForbiddenException.java (67%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpInternalServerError.java (67%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpNotFoundException.java (66%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/model/exceptions/HttpUnauthorizedException.java (67%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/modules/core/BrAPICoreEndpoints_V2.java (84%) rename brapi-client/src/main/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/modules/core/ProgramsAPI.java (53%) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java delete mode 100644 brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java rename brapi-client/src/test/java/org/{breedinginsight/brapi/client => brapi/client/v2}/BrAPIClientTest.java (70%) rename brapi-client/src/test/java/org/{breedinginsight/brapi/client/v2/endpoints => brapi/client/v2}/modules/core/ProgramsAPITests.java (69%) rename brapi-core-model/src/main/java/org/brapi/v2/core/model/{BrApiExternalReferencesInner.java => BrApiExternalReference.java} (89%) delete mode 100755 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/request/BaseRequest.java (86%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/request/ProgramsRequest.java (94%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/response/BrAPIResponse.java (95%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/response/DataResponse.java (89%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/response/Metadata.java (96%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/response/MetadataPagination.java (96%) rename {brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints => brapi-core-model/src/main/java/org/brapi/v2/core}/model/response/Status.java (95%) diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java similarity index 92% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java rename to brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index 02076c1c..ed94e63a 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints; +package org.brapi.client.v2; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -12,10 +12,11 @@ import okhttp3.MediaType; import okhttp3.internal.http.HttpMethod; import lombok.experimental.Accessors; -import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.APIException; -import org.breedinginsight.brapi.client.v2.endpoints.model.BrAPIRequest; -import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.*; -import org.breedinginsight.brapi.client.v2.endpoints.model.response.Metadata; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.exceptions.*; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.*; +import org.brapi.v2.core.model.response.Metadata; import java.io.File; import java.io.IOException; @@ -47,7 +48,7 @@ public void execute(BrAPIRequest request) throws HttpException, APIException { /** * Execute a request to the BrAPI service, and process the response via the {@link ResponseHandlerFunction} * @param request - * @param responseHandler User defined function to handle the result section of the {@link org.breedinginsight.brapi.client.v2.endpoints.model.response.BrAPIResponse} + * @param responseHandler User defined function to handle the result section of the {@link org.brapi.brapi-core-model.v2.model.response.BrAPIResponse} * @param Object that the user expects. {@link ResponseHandlerFunction} must return this type. * @return * @throws APIException @@ -120,7 +121,7 @@ public RequestBody serialize(Object obj, String contentType) throws APIException /** * Actual code to execute a request to the BrAPI service, and process the response via the {@link ResponseHandlerFunction} * @param request - * @param responseHandler User defined function to handle the result section of the {@link org.breedinginsight.brapi.client.v2.endpoints.model.response.BrAPIResponse} + * @param responseHandler User defined function to handle the result section of the {@link org.brapi.brapi-core-model.v2.model.response.BrAPIResponse} * @param Object that the user expects. {@link ResponseHandlerFunction} must return this type. * @return * @throws APIException diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java similarity index 82% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java rename to brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java index d849106e..54d36c05 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/BrAPIEndpoint.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints; +package org.brapi.client.v2; import lombok.AccessLevel; import lombok.Getter; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java b/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java similarity index 60% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java rename to brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java index 7137d2de..0c2a3f14 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/ResponseHandlerFunction.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java @@ -1,8 +1,8 @@ -package org.breedinginsight.brapi.client.v2.endpoints; +package org.brapi.client.v2; import com.google.gson.Gson; import com.google.gson.JsonElement; -import org.breedinginsight.brapi.client.v2.endpoints.model.response.Metadata; +import org.brapi.v2.core.model.response.Metadata; @FunctionalInterface public interface ResponseHandlerFunction { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java b/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java similarity index 84% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java index 96b8d55d..22267f88 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/BrAPIRequest.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model; +package org.brapi.client.v2.model; import lombok.Builder; import lombok.Getter; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java b/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java new file mode 100644 index 00000000..9777af87 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java @@ -0,0 +1,5 @@ +package org.brapi.client.v2.model; + +public enum HttpMethod { + GET, POST, PUT, DELETE +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java similarity index 88% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java index 07713352..37063c14 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/APIException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class APIException extends Exception { public APIException() { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java similarity index 67% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java index 1eb5758f..d09088b3 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpBadRequestException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpBadRequestException extends HttpException { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java similarity index 63% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java index b7316ff9..93ae49b3 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpException extends Exception { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java similarity index 67% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java index d1e836c2..59fae944 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpForbiddenException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpForbiddenException extends HttpException { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java similarity index 67% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java index 89c9a0ad..dea7a8fe 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpInternalServerError.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpInternalServerError extends HttpException { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java similarity index 66% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java index b5d39422..cdcba352 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpNotFoundException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpNotFoundException extends HttpException { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java similarity index 67% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java rename to brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java index 506453e9..6dd0d39c 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/exceptions/HttpUnauthorizedException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.exceptions; +package org.brapi.client.v2.model.exceptions; public class HttpUnauthorizedException extends HttpException { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java similarity index 84% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java rename to brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java index cb125482..a9c3c4f8 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/BrAPICoreEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.core; +package org.brapi.client.v2.modules.core; public class BrAPICoreEndpoints_V2 { diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java similarity index 53% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java rename to brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index 01bcdc79..ba2f3afb 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -1,27 +1,28 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.core; +package org.brapi.client.v2.modules.core; import com.google.gson.reflect.TypeToken; -import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.APIException; -import org.breedinginsight.brapi.client.v2.endpoints.model.BrAPIRequest; -import org.breedinginsight.brapi.client.v2.endpoints.model.HttpMethod; -import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.*; -import org.breedinginsight.brapi.client.v2.endpoints.model.response.DataResponse; -import org.breedinginsight.brapi.client.v2.endpoints.BrAPIClient; -import org.breedinginsight.brapi.client.v2.endpoints.BrAPIEndpoint; -import org.breedinginsight.brapi.client.v2.model.Program; -import org.breedinginsight.brapi.client.v2.endpoints.model.request.ProgramsRequest; - -import javax.swing.text.html.Option; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.*; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; + import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import java.util.Optional; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.request.ProgramsRequest; +import org.brapi.v2.core.model.response.DataResponse; + public class ProgramsAPI extends BrAPIEndpoint { public ProgramsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List getPrograms(ProgramsRequest programFilter) throws HttpException, APIException { + public List getPrograms(ProgramsRequest programFilter) throws HttpException, APIException { // Check if our values are passed in and raise error if not if (programFilter == null) { @@ -37,16 +38,16 @@ public List getPrograms(ProgramsRequest programFilter) throws HttpExcep .method(HttpMethod.GET) .build(); - List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { - Type resultGsonType = new TypeToken>() {}.getType(); - DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); return dataResponse.data(); }).orElse(new ArrayList<>()); return searchResult; } - public List getPrograms() throws HttpException, APIException { + public List getPrograms() throws HttpException, APIException { try { return getPrograms(null); } catch (APIException e){ @@ -54,7 +55,7 @@ public List getPrograms() throws HttpException, APIException { } } - public Optional getProgramById(String programID) throws HttpException, APIException { + public Optional getProgramById(String programID) throws HttpException, APIException { // Check if our values are passed in and raise error if not if (programID == null) { @@ -69,8 +70,8 @@ public Optional getProgramById(String programID) throws HttpException, .method(HttpMethod.GET) .build(); - Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { - Program resultResponse = gson.fromJson(resultJson, Program.class); + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiProgram resultResponse = gson.fromJson(resultJson, BrApiProgram.class); return Optional.of(resultResponse); }).orElse(Optional.empty()); diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java new file mode 100644 index 00000000..f78be2c1 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.brapi.client.v2.modules.genotype; + +public class BrAPIGenotypeEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java new file mode 100644 index 00000000..9e753ce2 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.brapi.client.v2.modules.germplasm; + +public class BrAPIGermplasmEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java new file mode 100644 index 00000000..d143f363 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -0,0 +1,4 @@ +package org.brapi.client.v2.modules.phenotype; + +public class BrAPIPhenotypeEndpoints_V2 { +} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java deleted file mode 100644 index b8b29577..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/HttpMethod.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model; - -public enum HttpMethod { - GET, POST, PUT, DELETE -} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java deleted file mode 100644 index c2a8e18a..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/genotype/BrAPIGenotypeEndpoints_V2.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.genotype; - -public class BrAPIGenotypeEndpoints_V2 { -} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java deleted file mode 100644 index 3cef40b0..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/germplasm/BrAPIGermplasmEndpoints_V2.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.germplasm; - -public class BrAPIGermplasmEndpoints_V2 { -} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java deleted file mode 100644 index 3b791a92..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.phenotype; - -public class BrAPIPhenotypeEndpoints_V2 { -} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java deleted file mode 100644 index c46ae089..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/ExternalReference.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.breedinginsight.brapi.client.v2.model; - -import lombok.Builder; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.Setter; -import lombok.experimental.Accessors; - -@Getter -@Setter -@Builder -@Accessors(fluent = true) -@RequiredArgsConstructor -public class ExternalReference { - - private final String referenceID; - private final String referenceSource; - -} diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java b/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java deleted file mode 100644 index 3bbc0dda..00000000 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/model/Program.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.breedinginsight.brapi.client.v2.model; - -import lombok.Builder; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.Setter; -import lombok.experimental.Accessors; - -import java.util.List; - -@Getter -@Setter -@Builder -@Accessors(fluent = true) -@RequiredArgsConstructor -public class Program { - - private final String abbreviation; - private final String commonCropName; - private final String documentationUrl; - private final List externalReferences; - private final String leadPersonDbId; - private final String leadPersonName; - private final String objective; - private final String programDbId; - private final String programName; -} diff --git a/brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java b/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java similarity index 70% rename from brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java rename to brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java index 65f64f38..85b43cc6 100644 --- a/brapi-client/src/test/java/org/breedinginsight/brapi/client/BrAPIClientTest.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java @@ -1,6 +1,6 @@ -package org.breedinginsight.brapi.client; +package org.brapi.client.v2; -import org.breedinginsight.brapi.client.v2.endpoints.BrAPIClient; +import org.brapi.client.v2.BrAPIClient; public class BrAPIClientTest { diff --git a/brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java similarity index 69% rename from brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java rename to brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index caedb332..74926bab 100644 --- a/brapi-client/src/test/java/org/breedinginsight/brapi/client/v2/endpoints/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -1,12 +1,12 @@ -package org.breedinginsight.brapi.client.v2.endpoints.modules.core; +package org.brapi.client.v2.modules.core; import lombok.SneakyThrows; -import org.breedinginsight.brapi.client.BrAPIClientTest; -import org.breedinginsight.brapi.client.v2.endpoints.modules.core.ProgramsAPI; -import org.breedinginsight.brapi.client.v2.model.Program; -import org.breedinginsight.brapi.client.v2.endpoints.model.exceptions.HttpNotFoundException; -import org.breedinginsight.brapi.client.v2.endpoints.model.request.ProgramsRequest; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.v2.core.model.request.ProgramsRequest; import org.junit.jupiter.api.Test; + import java.util.List; import java.util.Optional; @@ -23,7 +23,7 @@ public class ProgramsAPITests extends BrAPIClientTest { @Test @SneakyThrows public void getProgramsSuccess() { - List programs = this.programsAPI.getPrograms(); + List programs = this.programsAPI.getPrograms(); assertEquals(true, !programs.isEmpty(), "List of programs was empty"); } @@ -31,9 +31,11 @@ public void getProgramsSuccess() { @Test @SneakyThrows public void getProgramByIDSuccess() { - Optional program = this.programsAPI.getProgramById(this.programId); + Optional program = this.programsAPI.getProgramById(this.programId); assertEquals(true, program.isPresent(), "Program was not returned"); + + //TODO: Check the response was parsed correctly. } @Test @@ -41,7 +43,7 @@ public void getProgramByIDSuccess() { public void getProgramByIdMissingID() { HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { - Optional program = this.programsAPI.getProgramById("does not exist"); + Optional program = this.programsAPI.getProgramById("does not exist"); }); // Check out return message is returned @@ -56,7 +58,7 @@ public void getProgramByExternalReferenceIDSuccess() { .externalReferenceID(this.externalReferenceID) .build(); - List programs = this.programsAPI.getPrograms(programsRequest); + List programs = this.programsAPI.getPrograms(programsRequest); assertEquals(true, programs.size() > 0, "List of programs was empty"); } @@ -69,7 +71,7 @@ public void getProgramByExternalReferenceIDDoesNotExist() { .externalReferenceID("will not exist") .build(); - List programs = this.programsAPI.getPrograms(programsRequest); + List programs = this.programsAPI.getPrograms(programsRequest); assertEquals(true, programs.size() == 0, "List of programs was not empty"); } diff --git a/brapi-core-model/.gitignore b/brapi-core-model/.gitignore index 70e1a827..3bd2ff81 100644 --- a/brapi-core-model/.gitignore +++ b/brapi-core-model/.gitignore @@ -23,3 +23,4 @@ hs_err_pid* /target +*.iml diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java similarity index 89% rename from brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java index 4f3ab63c..c470678c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferencesInner.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java @@ -11,7 +11,7 @@ @Data @SuperBuilder @NoArgsConstructor -public class BrApiExternalReferencesInner { +public class BrApiExternalReference { @JsonProperty("referenceID") private Object referenceID; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java deleted file mode 100755 index 29b6875a..00000000 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReferences.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.brapi.v2.core.model; - -import lombok.EqualsAndHashCode; -import lombok.ToString; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * An array of external reference ids. These are references to this piece of data in an external system. Could be a simple string or a URI. - */ -@EqualsAndHashCode -@ToString -public class BrApiExternalReferences extends ArrayList { - - public BrApiExternalReferences() { - super(); - } - - public BrApiExternalReferences(Collection c) { - super(c); - } - -} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java index bee0c615..3808d2f2 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java @@ -6,6 +6,7 @@ import lombok.experimental.SuperBuilder; import javax.validation.Valid; +import java.util.List; import java.util.Map; /** @@ -50,7 +51,7 @@ public class BrApiLocation { private String exposure; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("instituteAddress") private String instituteAddress; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java index 65821d09..d41b4f25 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java @@ -6,6 +6,7 @@ import lombok.experimental.SuperBuilder; import javax.validation.Valid; +import java.util.List; import java.util.Map; /** @@ -29,7 +30,7 @@ public class BrApiPerson { private String emailAddress; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("firstName") private String firstName; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index 91151b21..aa6ee16d 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -7,6 +7,7 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; +import java.util.List; import java.util.Map; /** @@ -35,7 +36,7 @@ public class BrApiProgram { @JsonProperty("externalReferences") @Valid - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("leadPersonDbId") private String leadPersonDbId; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java index eba92d71..6fb0f8f8 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -56,7 +56,7 @@ public class BrApiStudy { private BrApiExperimentalDesign experimentalDesign; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("growthFacility") private BrApiGrowthFacility growthFacility; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java index 089aa8b7..9f34eb88 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java @@ -45,7 +45,7 @@ public class BrApiTrial { private LocalDate endDate; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("programDbId") private String programDbId; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java similarity index 86% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java index a8836baa..7300be70 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/BaseRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.request; +package org.brapi.v2.core.model.request; import java.util.HashMap; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java similarity index 94% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java index fceca97a..0852642d 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/request/ProgramsRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java @@ -1,4 +1,4 @@ -package org.breedinginsight.brapi.client.v2.endpoints.model.request; +package org.brapi.v2.core.model.request; import lombok.*; import lombok.experimental.Accessors; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java similarity index 95% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java index 06543daa..900b0c3e 100755 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/BrAPIResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package org.breedinginsight.brapi.client.v2.endpoints.model.response; +package org.brapi.v2.core.model.response; import lombok.*; import lombok.experimental.Accessors; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java similarity index 89% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java index c7b72cd1..d8eaa9d5 100644 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/DataResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package org.breedinginsight.brapi.client.v2.endpoints.model.response; +package org.brapi.v2.core.model.response; -import com.google.gson.annotations.SerializedName; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; import lombok.experimental.Accessors; @@ -29,7 +29,7 @@ @EqualsAndHashCode @ToString public class DataResponse { - @SerializedName(value="data", alternate={"observations", "test"}) + @JsonProperty("data") private List data; } diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java similarity index 96% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java index 034a21dc..7da8a28f 100755 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Metadata.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package org.breedinginsight.brapi.client.v2.endpoints.model.response; +package org.brapi.v2.core.model.response; import lombok.*; import lombok.experimental.Accessors; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java similarity index 96% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java index a3f7104e..49b8cf68 100755 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/MetadataPagination.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package org.breedinginsight.brapi.client.v2.endpoints.model.response; +package org.brapi.v2.core.model.response; import lombok.*; import lombok.experimental.Accessors; diff --git a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java similarity index 95% rename from brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java rename to brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java index b6b7ee7d..04fabd5c 100755 --- a/brapi-client/src/main/java/org/breedinginsight/brapi/client/v2/endpoints/model/response/Status.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package org.breedinginsight.brapi.client.v2.endpoints.model.response; +package org.brapi.v2.core.model.response; import lombok.*; import lombok.experimental.Accessors; diff --git a/brapi-pheno-model/.gitignore b/brapi-pheno-model/.gitignore index 670d5fec..3bd2ff81 100644 --- a/brapi-pheno-model/.gitignore +++ b/brapi-pheno-model/.gitignore @@ -22,4 +22,5 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -/target \ No newline at end of file +/target +*.iml diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java index 8b345b78..12acdcaa 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiGeoJSON; import javax.validation.Valid; @@ -37,7 +37,7 @@ public class BrApiImage { private List descriptiveOntologyTerms; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("imageFileName") private String imageFileName; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java index c8569e74..3174e622 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java @@ -4,10 +4,11 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import javax.validation.Valid; +import java.util.List; import java.util.Map; /** @@ -31,7 +32,7 @@ public class BrApiMethod { private String description; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("formula") private String formula; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java index 7d83bbf8..0b105f47 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java @@ -4,12 +4,13 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiSeason; import javax.validation.Valid; import javax.validation.constraints.NotNull; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -31,7 +32,7 @@ public class BrApiObservation { private String collector; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("germplasmDbId") @NotNull diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java index 5e11fa59..388f85b7 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import javax.validation.Valid; import java.util.List; @@ -25,7 +25,7 @@ public class BrApiObservationUnit { private Map additionalInfo; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("germplasmDbId") private String germplasmDbId; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java index 72a47e5b..5c00de97 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java @@ -4,9 +4,11 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; +import java.util.List; + /** * Scale */ @@ -24,7 +26,7 @@ public class BrApiScale { private Integer decimalPlaces; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("ontologyReference") private BrApiOntologyReference ontologyReference; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java index 2fc85b81..094bd047 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import javax.validation.Valid; @@ -31,7 +31,7 @@ public class BrApiTrait { private String entity; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("mainAbbreviation") private String mainAbbreviation; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java index d48fd90d..3aa7d810 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -4,7 +4,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.BrApiExternalReferences; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import javax.validation.Valid; @@ -37,7 +37,7 @@ public class BrApiVariable { private String documentationURL; @JsonProperty("externalReferences") - private BrApiExternalReferences externalReferences; + private List externalReferences; @JsonProperty("growthStage") private String growthStage; diff --git a/pom.xml b/pom.xml index 15c5ad3d..ed11f4ea 100644 --- a/pom.xml +++ b/pom.xml @@ -12,10 +12,23 @@ http://www.breedinginsight.org pom + + 5.6.1 + + brapi-core-model brapi-pheno-model brapi-client + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + From 669e6abcfb939f2809ccb7aac5120f9cb44e3aae Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 13 Apr 2020 09:42:03 -0400 Subject: [PATCH 05/71] Add parsing check for programs --- .../client/v2/modules/core/ProgramsAPITests.java | 16 +++++++++++++++- .../org/brapi/v2/core/model/BrApiProgram.java | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 74926bab..2b3b2325 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -35,7 +35,21 @@ public void getProgramByIDSuccess() { assertEquals(true, program.isPresent(), "Program was not returned"); - //TODO: Check the response was parsed correctly. + // Check the response was parsed correctly. + BrApiProgram brApiProgram = program.get(); + assertEquals(true, brApiProgram.getAbbreviation() != null, "Abbreviation was not populated"); + assertEquals(true, brApiProgram.getAdditionalInfo() != null, "Additional Info was not populated"); + assertEquals(true, brApiProgram.getAdditionalInfo().size() > 0, "Additional Info had no entries"); + assertEquals(true, brApiProgram.getCommonCropName() != null, "Common crop name was not populated"); + assertEquals(true, brApiProgram.getDocumentationURL() != null, "Documentation url was not populated"); + assertEquals(true, brApiProgram.getExternalReferences() != null, "External references were not populated"); + assertEquals(true, brApiProgram.getExternalReferences().get(0).getReferenceSource() != null, "Reference source was not populated"); + assertEquals(true, brApiProgram.getExternalReferences().get(0).getReferenceID() != null, "Reference Id was not populated"); + assertEquals(true, brApiProgram.getLeadPersonDbId() != null, "Lead person id was not populated"); + assertEquals(true, brApiProgram.getLeadPersonName() != null, "Lead person name were not populated"); + assertEquals(true, brApiProgram.getObjective() != null, "Objective was not populated"); + assertEquals(true, brApiProgram.getProgramDbId() != null, "Program DbId was not populated"); + assertEquals(true, brApiProgram.getProgramName() != null, "Program name was not populated"); } @Test diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index aa6ee16d..b8004c77 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +import lombok.Getter; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; From e927d38bc00b887ebe61a7a8145f1e52dd49662a Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 13 Apr 2020 15:25:01 -0400 Subject: [PATCH 06/71] added distributionManagement tag in parent pom --- brapi-core-model/pom.xml | 8 -------- brapi-pheno-model/pom.xml | 8 -------- pom.xml | 8 ++++++++ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/brapi-core-model/pom.xml b/brapi-core-model/pom.xml index fbbccbd4..c273c2be 100644 --- a/brapi-core-model/pom.xml +++ b/brapi-core-model/pom.xml @@ -52,12 +52,4 @@ - - - github - GitHub Breeding Insight Apache Maven Packages - https://maven.pkg.github.com/Breeding-Insight/brapi-core-model - - - diff --git a/brapi-pheno-model/pom.xml b/brapi-pheno-model/pom.xml index ccac17c8..922a0d96 100644 --- a/brapi-pheno-model/pom.xml +++ b/brapi-pheno-model/pom.xml @@ -52,12 +52,4 @@ - - - github - GitHub Breeding Insight Apache Maven Packages - https://maven.pkg.github.com/Breeding-Insight/brapi-pheno-model - - - diff --git a/pom.xml b/pom.xml index ed11f4ea..66fdcbbc 100644 --- a/pom.xml +++ b/pom.xml @@ -31,4 +31,12 @@ + + + github + GitHub Breeding Insight Apache Maven Packages + https://maven.pkg.github.com/Breeding-Insight/brapi + + + From 5101e33a9e42348617940fa235c2c907cc52187d Mon Sep 17 00:00:00 2001 From: Chris Tucker Date: Mon, 13 Apr 2020 15:30:21 -0400 Subject: [PATCH 07/71] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..87f89622 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Breeding Insight + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From cb0476af5ded3870df35d0d0d1fd9825209722f7 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 14 Apr 2020 09:19:15 -0400 Subject: [PATCH 08/71] moving maven configurations into parent pom --- brapi-client/pom.xml | 42 +++------------------------------------ brapi-core-model/pom.xml | 32 ++--------------------------- brapi-pheno-model/pom.xml | 39 ++++++++---------------------------- pom.xml | 28 ++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 100 deletions(-) diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml index a62a67d7..76c1fb28 100644 --- a/brapi-client/pom.xml +++ b/brapi-client/pom.xml @@ -3,9 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.breedinginsight + brapi-client - 2.0-SNAPSHOT org.brapi @@ -14,12 +13,8 @@ - 8 4.1.0 - 1.18.8 2.8.5 - 5.6.1 - 3.0.0-M4 @@ -28,48 +23,17 @@ okhttp ${okhttp.version} - - - org.projectlombok - lombok - ${lombok.version} - provided - - com.google.code.gson gson ${gson.version} - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} - test - - org.brapi brapi-core-model - 2.0-SNAPSHOT + ${parent.version} - - - - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-surefire-plugin - ${mvnsurefire.version} - - - + \ No newline at end of file diff --git a/brapi-core-model/pom.xml b/brapi-core-model/pom.xml index c273c2be..ad2f1fc5 100644 --- a/brapi-core-model/pom.xml +++ b/brapi-core-model/pom.xml @@ -4,9 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.brapi brapi-core-model - 2.0-SNAPSHOT org.brapi @@ -14,42 +12,16 @@ 2.0-SNAPSHOT - - 1.18.10 - - com.fasterxml.jackson.core jackson-annotations - 2.10.1 + ${jackson.annotations.version} - javax.validation validation-api - 2.0.1.Final - - - - org.projectlombok - lombok - ${lombok.version} - provided + ${javax.validation.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - diff --git a/brapi-pheno-model/pom.xml b/brapi-pheno-model/pom.xml index 922a0d96..6c422ffc 100644 --- a/brapi-pheno-model/pom.xml +++ b/brapi-pheno-model/pom.xml @@ -4,52 +4,29 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.brapi brapi-pheno-model - 2.0-SNAPSHOT - - 1.18.10 - + + org.brapi + brapi + 2.0-SNAPSHOT + org.brapi brapi-core-model - 2.0-SNAPSHOT + ${parent.version} - com.fasterxml.jackson.core jackson-annotations - 2.10.1 + ${jackson.annotations.version} - javax.validation validation-api - 2.0.1.Final - - - - org.projectlombok - lombok - ${lombok.version} - provided + ${javax.validation.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - diff --git a/pom.xml b/pom.xml index 66fdcbbc..c2e9ea59 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,12 @@ pom + 8 + 1.18.8 5.6.1 + 3.0.0-M4 + 2.10.1 + 2.0.1.Final @@ -29,6 +34,12 @@ ${junit.jupiter.version} test + + org.projectlombok + lombok + ${lombok.version} + provided + @@ -39,4 +50,21 @@ + + + + maven-compiler-plugin + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${mvnsurefire.version} + + + + From 600c9b832f21cabb44be1ce7fa9da1968f1f9c74 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 14 Apr 2020 09:20:10 -0400 Subject: [PATCH 09/71] change workflow build java version --- .github/workflows/package-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-deploy.yml b/.github/workflows/package-deploy.yml index 6baf10a5..883d9595 100644 --- a/.github/workflows/package-deploy.yml +++ b/.github/workflows/package-deploy.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 12 + - name: Set up JDK 8 uses: actions/setup-java@v1.3.0 with: - java-version: 12 + java-version: 8 - name: Build with Maven run: mvn -B package --file pom.xml From b56eb4b59ff9293d4379994f866c9118b64da691 Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 13 Apr 2020 15:14:08 -0400 Subject: [PATCH 10/71] create program method --- .../client/v2/modules/core/ProgramsAPI.java | 39 +++++++++++++- .../v2/modules/core/ProgramsAPITests.java | 51 ++++++++++++++++++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index ba2f3afb..eadb2ce3 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -5,7 +5,6 @@ import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.client.v2.model.BrAPIRequest; import org.brapi.client.v2.model.HttpMethod; -import org.brapi.client.v2.model.exceptions.*; import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.BrAPIEndpoint; @@ -78,4 +77,42 @@ public Optional getProgramById(String programID) throws HttpExcept return searchResult; } + public List createPrograms(List brApiPrograms) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (brApiPrograms.stream().anyMatch(program -> program.getProgramDbId() != null)) { + throw new APIException("BrAPI program must not have an existing programDbId."); + } + + // Build our request + String endpoint = String.format(BrAPICoreEndpoints_V2.getProgramsPath()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiPrograms) + .method(HttpMethod.POST) + .build(); + + List createdProgram = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdProgram; + } + + public Optional createProgram(BrApiProgram brApiProgram) throws HttpException, APIException { + List brApiPrograms = new ArrayList<>(); + brApiPrograms.add(brApiProgram); + List createdPrograms = createPrograms(brApiPrograms); + + if (createdPrograms.size() > 0){ + return Optional.of(createdPrograms.get(0)); + } + else { + return Optional.empty(); + } + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 2b3b2325..d8bb0522 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -6,7 +6,10 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.v2.core.model.request.ProgramsRequest; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.provider.NullAndEmptySource; +import javax.swing.text.html.Option; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -77,7 +80,6 @@ public void getProgramByExternalReferenceIDSuccess() { assertEquals(true, programs.size() > 0, "List of programs was empty"); } - // This one fails because search parameters are not implemented yet. @Test @SneakyThrows public void getProgramByExternalReferenceIDDoesNotExist() { @@ -89,4 +91,51 @@ public void getProgramByExternalReferenceIDDoesNotExist() { assertEquals(true, programs.size() == 0, "List of programs was not empty"); } + + @Test + @SneakyThrows + public void createProgramSuccess() { + + BrApiProgram brApiProgram = BrApiProgram.builder() + .programName("new test program") + .build(); + + Optional createdProgram = this.programsAPI.createProgram(brApiProgram); + + assertEquals(true, createdProgram.isPresent()); + //TODO: Test that program Id and program name are in return object + } + + @Test + @SneakyThrows + public void createMultipleProgramsSuccess() { + + BrApiProgram brApiProgram1 = BrApiProgram.builder() + .programName("new test program") + .build(); + BrApiProgram brApiProgram2 = BrApiProgram.builder() + .programName("new test program") + .build(); + List brApiPrograms = new ArrayList<>(); + brApiPrograms.add(brApiProgram1); + brApiPrograms.add(brApiProgram2); + + List createdPrograms = this.programsAPI.createPrograms(brApiPrograms); + + assertEquals(true, createdPrograms.size() > 0); + //TODO: Test that program Id and program name are in return objects + } + + @Test + @SneakyThrows + public void createProgramIdPresentFailure() { + + } + + @Test + @SneakyThrows + public void createProgramEmptyProgramSuccess() { + + } + } From 28f808e797e9f8cbe5d651ee003e93843cb08432 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 14 Apr 2020 09:35:31 -0400 Subject: [PATCH 11/71] finished tests for create programs --- .../v2/modules/core/ProgramsAPITests.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index d8bb0522..c88911d1 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -1,6 +1,7 @@ package org.brapi.client.v2.modules.core; import lombok.SneakyThrows; +import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiProgram; import org.brapi.client.v2.BrAPIClientTest; @@ -103,7 +104,9 @@ public void createProgramSuccess() { Optional createdProgram = this.programsAPI.createProgram(brApiProgram); assertEquals(true, createdProgram.isPresent()); - //TODO: Test that program Id and program name are in return object + BrApiProgram program = createdProgram.get(); + assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); + assertEquals(true, program.getProgramName() != null, "Program Name was not parsed properly"); } @Test @@ -111,10 +114,10 @@ public void createProgramSuccess() { public void createMultipleProgramsSuccess() { BrApiProgram brApiProgram1 = BrApiProgram.builder() - .programName("new test program") + .programName("test1") .build(); BrApiProgram brApiProgram2 = BrApiProgram.builder() - .programName("new test program") + .programName("test2") .build(); List brApiPrograms = new ArrayList<>(); brApiPrograms.add(brApiProgram1); @@ -122,20 +125,36 @@ public void createMultipleProgramsSuccess() { List createdPrograms = this.programsAPI.createPrograms(brApiPrograms); - assertEquals(true, createdPrograms.size() > 0); - //TODO: Test that program Id and program name are in return objects + assertEquals(true, createdPrograms.size() == 2); + assertEquals("test1", createdPrograms.get(0).getProgramName(), "Sent name and returned program name does not match"); + assertEquals(true, createdPrograms.get(0).getProgramDbId() != null, "Program Id was not parsed properly"); + assertEquals("test2", createdPrograms.get(1).getProgramName(), "Sent name and returned program name does not match"); + assertEquals(true, createdPrograms.get(1).getProgramDbId() != null, "Program Id was not parsed properly"); } @Test @SneakyThrows public void createProgramIdPresentFailure() { + BrApiProgram brApiProgram = BrApiProgram.builder() + .programName("new test program") + .programDbId("id1123") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional createdProgram = this.programsAPI.createProgram(brApiProgram); + }); } @Test @SneakyThrows public void createProgramEmptyProgramSuccess() { + BrApiProgram brApiProgram = new BrApiProgram(); + Optional createdProgram = this.programsAPI.createProgram(brApiProgram); + assertEquals(true, createdProgram.isPresent()); + BrApiProgram program = createdProgram.get(); + assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); } } From 1309046c84bd94e02d4d4e90bf506543fe3a2fdc Mon Sep 17 00:00:00 2001 From: Chris T Date: Thu, 16 Apr 2020 07:28:11 -0400 Subject: [PATCH 12/71] minor fixes to programs api --- .../src/main/java/org/brapi/client/v2/BrAPIClient.java | 2 +- .../java/org/brapi/client/v2/modules/core/ProgramsAPI.java | 6 +++--- .../org/brapi/client/v2/modules/core/ProgramsAPITests.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index ed94e63a..1bbda9aa 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -175,7 +175,7 @@ else if (response.code() == 404){ else if (response.code() == 500) { throw new HttpInternalServerError(response.body().string()); } - if(response.isSuccessful()) { + else if(response.isSuccessful()) { // If a callback function was passed. Run it now. if (responseHandler.isPresent()) { try (ResponseBody body = response.body()) { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index eadb2ce3..786fe0f6 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -29,7 +29,7 @@ public List getPrograms(ProgramsRequest programFilter) throws Http } // Build our request - String endpoint = String.format(BrAPICoreEndpoints_V2.getProgramsPath()); + String endpoint = BrAPICoreEndpoints_V2.getProgramsPath(); BrAPIRequest request = BrAPIRequest.builder() .target(endpoint) .parameter("dataType", "application/json") @@ -85,7 +85,7 @@ public List createPrograms(List brApiPrograms) throw } // Build our request - String endpoint = String.format(BrAPICoreEndpoints_V2.getProgramsPath()); + String endpoint = BrAPICoreEndpoints_V2.getProgramsPath(); BrAPIRequest request = BrAPIRequest.builder() .target(endpoint) .parameter("dataType", "application/json") @@ -107,7 +107,7 @@ public Optional createProgram(BrApiProgram brApiProgram) throws Ht brApiPrograms.add(brApiProgram); List createdPrograms = createPrograms(brApiPrograms); - if (createdPrograms.size() > 0){ + if (createdPrograms.size() == 1){ return Optional.of(createdPrograms.get(0)); } else { diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index c88911d1..a12a7092 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -106,7 +106,7 @@ public void createProgramSuccess() { assertEquals(true, createdProgram.isPresent()); BrApiProgram program = createdProgram.get(); assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); - assertEquals(true, program.getProgramName() != null, "Program Name was not parsed properly"); + assertEquals("new test program", program.getProgramName() , "Program Name was not parsed properly"); } @Test From 839a308ef05c913d88b0e6b9eee684411e2b5b02 Mon Sep 17 00:00:00 2001 From: Chris T Date: Wed, 15 Apr 2020 12:33:24 -0400 Subject: [PATCH 13/71] create method. Stub out tests --- .../client/v2/modules/core/ProgramsAPI.java | 23 +++++++++++++++++++ .../v2/modules/core/ProgramsAPITests.java | 17 ++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index 786fe0f6..28fa4018 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -115,4 +115,27 @@ public Optional createProgram(BrApiProgram brApiProgram) throws Ht } } + public Optional updateProgram(BrApiProgram brApiProgram) throws HttpException, APIException { + + if (brApiProgram.getProgramDbId() == null){ + throw new APIException("BrAPI program must have an existing programDbId."); + } + + // Build our request + String endpoint = BrAPICoreEndpoints_V2.getProgramsByIdPath(brApiProgram.getProgramDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiProgram) + .method(HttpMethod.PUT) + .build(); + + Optional updatedProgram = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiProgram resultResponse = gson.fromJson(resultJson, BrApiProgram.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updatedProgram; + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index a12a7092..9c2b856b 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -157,4 +157,21 @@ public void createProgramEmptyProgramSuccess() { assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); } + @Test + @SneakyThrows + public void updateProgramSuccess() { + // Check that it is a success and all data matches + } + + @Test + @SneakyThrows + public void updateProgramBadId() { + // Check that it throws a 404 + } + + @Test + @SneakyThrows + public void updateProgramMissingId() { + // Check that it throws an APIException + } } From 1bc2527b277899c85a75c4a476389058d7487bcf Mon Sep 17 00:00:00 2001 From: Chris T Date: Thu, 16 Apr 2020 08:48:03 -0400 Subject: [PATCH 14/71] add tests for update program --- .../v2/modules/core/ProgramsAPITests.java | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 9c2b856b..dc2b8653 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -6,7 +6,7 @@ import org.brapi.v2.core.model.BrApiProgram; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.v2.core.model.request.ProgramsRequest; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import org.junit.jupiter.params.provider.NullAndEmptySource; import javax.swing.text.html.Option; @@ -16,11 +16,14 @@ import static org.junit.jupiter.api.Assertions.*; +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class ProgramsAPITests extends BrAPIClientTest { //TODO: Maybe query these before tests instead of hard coding. private String programId = "program3"; private String externalReferenceID = "https://brapi.org/specification"; + private BrApiProgram createdProgram; private ProgramsAPI programsAPI = new ProgramsAPI(this.client); @@ -148,30 +151,59 @@ public void createProgramIdPresentFailure() { @Test @SneakyThrows + @Order(1) public void createProgramEmptyProgramSuccess() { BrApiProgram brApiProgram = new BrApiProgram(); Optional createdProgram = this.programsAPI.createProgram(brApiProgram); assertEquals(true, createdProgram.isPresent()); BrApiProgram program = createdProgram.get(); + this.createdProgram = program; assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); } @Test @SneakyThrows + @Order(2) public void updateProgramSuccess() { + BrApiProgram program = this.createdProgram; + program.setProgramName("updated_name"); + program.setObjective("planting stuff"); + // Check that it is a success and all data matches + Optional updatedProgramResult = this.programsAPI.updateProgram(program); + + assertEquals(true, updatedProgramResult.isPresent(), "Program was not returned"); + BrApiProgram updatedProgram = updatedProgramResult.get(); + assertEquals("updated_name", updatedProgram.getProgramName(), "Program name was not parsed correctly"); + assertEquals("planting stuff", updatedProgram.getObjective(), "Program name was not parsed correctly"); + } @Test @SneakyThrows public void updateProgramBadId() { // Check that it throws a 404 + BrApiProgram program = this.createdProgram; + program.setProgramDbId("i_do_not_exist"); + + // Check that it is a success and all data matches + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional updatedProgramResult = this.programsAPI.updateProgram(program); + }); } @Test @SneakyThrows public void updateProgramMissingId() { // Check that it throws an APIException + BrApiProgram brApiProgram = BrApiProgram.builder() + .programName("new test program") + .build(); + + // Check that it is a success and all data matches + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedProgramResult = this.programsAPI.updateProgram(brApiProgram); + }); } } From 6fff994cb417bc4f71edd02836da643ad6f52824 Mon Sep 17 00:00:00 2001 From: Chris T Date: Fri, 17 Apr 2020 10:09:48 -0400 Subject: [PATCH 15/71] added units tests for BrAPIClient and ProgramsAPI --- brapi-client/pom.xml | 12 ++ .../java/org/brapi/client/v2/BrAPIClient.java | 18 +-- .../brapi/client/v2/MockedBrAPIClient.java | 48 ++++++++ .../v2/modules/BrAPIClientUnitTests.java | 103 ++++++++++++++++++ .../v2/modules/core/ProgramAPIUnitTests.java | 96 ++++++++++++++++ .../v2/modules/core/ProgramsAPITests.java | 2 - 6 files changed, 270 insertions(+), 9 deletions(-) create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml index 76c1fb28..87ad290d 100644 --- a/brapi-client/pom.xml +++ b/brapi-client/pom.xml @@ -28,6 +28,18 @@ gson ${gson.version} + + org.mockito + mockito-core + 3.2.4 + test + + + org.mockito + mockito-inline + 2.13.0 + test + org.brapi brapi-core-model diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index 1bbda9aa..522dcb43 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -26,6 +26,7 @@ @Accessors(fluent=true) public class BrAPIClient { + @Getter private final String brapiURI; @Getter private final Gson gson; @@ -157,7 +158,7 @@ private Optional execute(BrAPIRequest request, Optional { + List programs = this.programsAPI.getPrograms(); + }); + } + + @Test + @SneakyThrows + public void brapiClientBadRequestStatus() { + + mockedBrAPIClient.mockHttpClientResponse(400, ""); + HttpBadRequestException exception = assertThrows(HttpBadRequestException.class, () -> { + List programs = this.programsAPI.getPrograms(); + }); + } + + @Test + @SneakyThrows + public void brapiClientUnauthorizedStatus() { + + mockedBrAPIClient.mockHttpClientResponse(401, ""); + HttpUnauthorizedException exception = assertThrows(HttpUnauthorizedException.class, () -> { + List programs = this.programsAPI.getPrograms(); + }); + } + + @Test + @SneakyThrows + public void brapiClientForbiddenStatus() { + + mockedBrAPIClient.mockHttpClientResponse(403, ""); + HttpForbiddenException exception = assertThrows(HttpForbiddenException.class, () -> { + List programs = this.programsAPI.getPrograms(); + }); + } + + @Test + @SneakyThrows + public void brapiClientInternalServerErrorStatus() { + + mockedBrAPIClient.mockHttpClientResponse(500, ""); + HttpInternalServerError exception = assertThrows(HttpInternalServerError.class, () -> { + List programs = this.programsAPI.getPrograms(); + }); + } + + @Test + @SneakyThrows + public void brapiClientEmptyBody() { + + mockedBrAPIClient.mockHttpClientResponse(200, ""); + + String endpoint = BrAPICoreEndpoints_V2.getProgramsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .method(HttpMethod.GET) + .build(); + + BrAPIClient brAPIClient = mockedBrAPIClient.getBrAPIClient(); + Boolean response = brAPIClient.execute(request, (metadata, resultJson, gson) -> false).orElse(true); + + // Make sure our response handler was actually called + assertEquals(true, response != null, "Response handler was not called"); + assertEquals(true, response, "orElse was not entered properly."); + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java new file mode 100644 index 00000000..b101b2d1 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java @@ -0,0 +1,96 @@ +package org.brapi.client.v2.modules.core; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.MockedBrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.core.model.BrApiProgram; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class ProgramAPIUnitTests { + + ProgramsAPI programsAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + programsAPI = new ProgramsAPI(brAPIClient); + } + + @Test + @SneakyThrows + public void getProgramsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiPrograms = programsAPI.getPrograms(); + + assertEquals(0, brApiPrograms.size(), "List size is greater than 1"); + } + + @Test + @SneakyThrows + public void getProgramByIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiProgram = programsAPI.getProgramById("test"); + + assertEquals(true, !brApiProgram.isPresent(), "BrAPI program was not empty"); + } + + @Test + @SneakyThrows + public void createProgramsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiPrograms = new ArrayList<>(); + BrApiProgram brApiProgram = BrApiProgram.builder() + .programName("test") + .build(); + brApiPrograms.add(brApiProgram); + List createdBrAPIPrograms = programsAPI.createPrograms(brApiPrograms); + + assertEquals(0, createdBrAPIPrograms.size(), "List size is greater than 1"); + } + + @Test + @SneakyThrows + public void createProgramEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + BrApiProgram brApiProgram = BrApiProgram.builder() + .programName("test") + .build(); + Optional brApiPrograms = programsAPI.createProgram(brApiProgram); + + assertEquals(true, !brApiPrograms.isPresent(), "BrAPI program was not empty"); + } + + @Test + @SneakyThrows + public void updateProgramEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + BrApiProgram brApiProgram = BrApiProgram.builder() + .programDbId("test") + .build(); + Optional brApiPrograms = programsAPI.updateProgram(brApiProgram); + + assertEquals(true, !brApiPrograms.isPresent(), "BrAPI program was not empty"); + } +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index dc2b8653..e25e5f27 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -7,9 +7,7 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.v2.core.model.request.ProgramsRequest; import org.junit.jupiter.api.*; -import org.junit.jupiter.params.provider.NullAndEmptySource; -import javax.swing.text.html.Option; import java.util.ArrayList; import java.util.List; import java.util.Optional; From 75aee3d2fd3cdadace7ac891d97ab5c5546d249a Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 21 Apr 2020 07:17:12 -0400 Subject: [PATCH 16/71] changes from pull request review --- .../main/java/org/brapi/client/v2/BrAPIClient.java | 14 +++----------- .../brapi/client/v2/modules/core/ProgramsAPI.java | 14 +++++++------- .../org/brapi/client/v2/MockedBrAPIClient.java | 1 - .../client/v2/modules/BrAPIClientUnitTests.java | 3 --- .../v2/modules/core/ProgramAPIUnitTests.java | 5 ++--- .../client/v2/modules/core/ProgramsAPITests.java | 9 +++++---- 6 files changed, 17 insertions(+), 29 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index 522dcb43..c374c0e5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -4,18 +4,11 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import lombok.Getter; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import okhttp3.RequestBody; -import okhttp3.MediaType; -import okhttp3.internal.http.HttpMethod; import lombok.experimental.Accessors; +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; import org.brapi.client.v2.model.BrAPIRequest; import org.brapi.client.v2.model.exceptions.*; -import org.brapi.client.v2.model.exceptions.APIException; -import org.brapi.client.v2.model.exceptions.*; import org.brapi.v2.core.model.response.Metadata; import java.io.File; @@ -24,11 +17,10 @@ import java.util.function.Function; import java.util.stream.Collectors; +@Getter @Accessors(fluent=true) public class BrAPIClient { - @Getter private final String brapiURI; - @Getter private final Gson gson; private String authToken; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index 28fa4018..6b8af683 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -1,20 +1,20 @@ package org.brapi.client.v2.modules.core; import com.google.gson.reflect.TypeToken; -import org.brapi.client.v2.model.exceptions.APIException; -import org.brapi.client.v2.model.exceptions.HttpException; -import org.brapi.client.v2.model.BrAPIRequest; -import org.brapi.client.v2.model.HttpMethod; import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.request.ProgramsRequest; +import org.brapi.v2.core.model.response.DataResponse; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.v2.core.model.request.ProgramsRequest; -import org.brapi.v2.core.model.response.DataResponse; public class ProgramsAPI extends BrAPIEndpoint { diff --git a/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java b/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java index 78f50b92..b71caaeb 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java @@ -4,7 +4,6 @@ import lombok.SneakyThrows; import okhttp3.*; import org.brapi.client.v2.model.BrAPIRequest; -import org.brapi.v2.core.model.BrApiProgram; import org.mockito.Mock; import org.mockito.MockitoAnnotations; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java index 6469eb79..84432c32 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java @@ -10,16 +10,13 @@ import org.brapi.client.v2.modules.core.ProgramsAPI; import org.brapi.v2.core.model.BrApiProgram; import org.junit.jupiter.api.*; -import org.mockito.MockitoAnnotations; import java.util.List; -import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class BrAPIClientUnitTests { private ProgramsAPI programsAPI; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java index b101b2d1..18d4ba38 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java @@ -2,7 +2,6 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClient; -import org.brapi.client.v2.MockedBrAPIClient; import org.brapi.client.v2.ResponseHandlerFunction; import org.brapi.client.v2.model.BrAPIRequest; import org.brapi.v2.core.model.BrApiProgram; @@ -40,7 +39,7 @@ public void getProgramsEmptyBody() { .thenReturn(Optional.empty()); List brApiPrograms = programsAPI.getPrograms(); - assertEquals(0, brApiPrograms.size(), "List size is greater than 1"); + assertEquals(0, brApiPrograms.size(), "List size is greater than 0"); } @Test @@ -65,7 +64,7 @@ public void createProgramsEmptyBody() { brApiPrograms.add(brApiProgram); List createdBrAPIPrograms = programsAPI.createPrograms(brApiPrograms); - assertEquals(0, createdBrAPIPrograms.size(), "List size is greater than 1"); + assertEquals(0, createdBrAPIPrograms.size(), "List size is greater than 0"); } @Test diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index e25e5f27..1c20fe6f 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -1,10 +1,10 @@ package org.brapi.client.v2.modules.core; import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.client.v2.BrAPIClientTest; import org.brapi.v2.core.model.request.ProgramsRequest; import org.junit.jupiter.api.*; @@ -12,7 +12,8 @@ import java.util.List; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @@ -107,7 +108,7 @@ public void createProgramSuccess() { assertEquals(true, createdProgram.isPresent()); BrApiProgram program = createdProgram.get(); assertEquals(true, program.getProgramDbId() != null, "Program Id was not parsed properly"); - assertEquals("new test program", program.getProgramName() , "Program Name was not parsed properly"); + assertEquals("new test program", program.getProgramName(), "Program Name was not parsed properly"); } @Test @@ -174,7 +175,7 @@ public void updateProgramSuccess() { assertEquals(true, updatedProgramResult.isPresent(), "Program was not returned"); BrApiProgram updatedProgram = updatedProgramResult.get(); assertEquals("updated_name", updatedProgram.getProgramName(), "Program name was not parsed correctly"); - assertEquals("planting stuff", updatedProgram.getObjective(), "Program name was not parsed correctly"); + assertEquals("planting stuff", updatedProgram.getObjective(), "Program objective was not parsed correctly"); } From c670d85286180ed034d560ce2bac8d7befdc7579 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 21 Apr 2020 13:45:40 -0400 Subject: [PATCH 17/71] update body check to .equals --- brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index c374c0e5..1d6b8470 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -174,7 +174,7 @@ else if(response.isSuccessful()) { try (ResponseBody body = response.body()) { if(body != null) { String bodyString = body.string(); - if (bodyString != ""){ + if (!bodyString.equals("")){ JsonObject responseJson = gson.fromJson(bodyString, JsonObject.class); JsonElement resultJson = responseJson.get("result"); Metadata metadata = gson.fromJson(responseJson.get("metadata"), Metadata.class); From 84975dbe9c72f4a9cc68867505bd6ba4096ba025 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 21 Apr 2020 07:18:56 -0400 Subject: [PATCH 18/71] changes from pull request review --- .../java/org/brapi/client/v2/modules/core/ProgramsAPITests.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 1c20fe6f..69874f42 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -186,7 +186,6 @@ public void updateProgramBadId() { BrApiProgram program = this.createdProgram; program.setProgramDbId("i_do_not_exist"); - // Check that it is a success and all data matches HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { Optional updatedProgramResult = this.programsAPI.updateProgram(program); }); @@ -200,7 +199,6 @@ public void updateProgramMissingId() { .programName("new test program") .build(); - // Check that it is a success and all data matches APIException exception = assertThrows(APIException.class, () -> { Optional updatedProgramResult = this.programsAPI.updateProgram(brApiProgram); }); From a1b5d336d322f91c012ca66036a086b958cbb817 Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 27 Apr 2020 13:56:46 -0400 Subject: [PATCH 19/71] read traits --- brapi-client/pom.xml | 5 ++ .../client/v2/modules/core/ProgramsAPI.java | 6 +-- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 8 +++ .../v2/modules/phenotype/TraitsAPI.java | 52 +++++++++++++++++++ .../v2/modules/phenotype/TraitsAPITests.java | 46 ++++++++++++++++ .../modules/phenotype/TraitsAPIUnitTests.java | 47 +++++++++++++++++ .../v2/phenotyping/model/BrApiTrait.java | 5 ++ .../model/request/TraitsRequest.java | 37 +++++++++++++ 8 files changed, 201 insertions(+), 5 deletions(-) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml index 87ad290d..768d0776 100644 --- a/brapi-client/pom.xml +++ b/brapi-client/pom.xml @@ -45,6 +45,11 @@ brapi-core-model ${parent.version} + + org.brapi + brapi-pheno-model + ${parent.version} + diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index 6b8af683..e1565577 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -47,11 +47,7 @@ public List getPrograms(ProgramsRequest programFilter) throws Http } public List getPrograms() throws HttpException, APIException { - try { - return getPrograms(null); - } catch (APIException e){ - throw new APIException(e.getMessage()); - } + return getPrograms(null); } public Optional getProgramById(String programID) throws HttpException, APIException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index d143f363..50d49373 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -1,4 +1,12 @@ package org.brapi.client.v2.modules.phenotype; public class BrAPIPhenotypeEndpoints_V2 { + + public static String getRootPath() { + return "/brapi/v2"; + } + + public static String getTraitsPath() { + return getRootPath() + "/traits"; + } } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java new file mode 100644 index 00000000..5977b2b3 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -0,0 +1,52 @@ +package org.brapi.client.v2.modules.phenotype; + +import com.google.gson.reflect.TypeToken; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiTrait; +import org.brapi.v2.phenotyping.model.request.TraitsRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +public class TraitsAPI extends BrAPIEndpoint { + + public TraitsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } + + public List getTraits(TraitsRequest traitsRequest) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (traitsRequest == null) { + traitsRequest = new TraitsRequest(); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getTraitsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(traitsRequest.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getTraits() throws HttpException, APIException { + return getTraits(null); + } +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java new file mode 100644 index 00000000..9941d1fb --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -0,0 +1,46 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.modules.core.ProgramsAPI; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.request.ProgramsRequest; +import org.brapi.v2.phenotyping.model.BrApiTrait; +import org.brapi.v2.phenotyping.model.request.TraitsRequest; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestMethodOrder; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public class TraitsAPITests extends BrAPIClientTest { + + private TraitsAPI traitsAPI = new TraitsAPI(this.client); + private String externalReferenceID = "https://brapi.org/specification"; + + @Test + @SneakyThrows + void getTraitsSuccess() { + List traits = this.traitsAPI.getTraits(); + + assertEquals(true, !traits.isEmpty(), "List of programs was empty"); + } + + @Test + @SneakyThrows + void getTraitsByExternalReferenceIdSuccess() { + TraitsRequest traitsRequest = TraitsRequest.builder() + .externalReferenceID(this.externalReferenceID) + .build(); + + List traits = this.traitsAPI.getTraits(traitsRequest); + + assertEquals(true, traits.size() > 0, "List of programs was empty"); + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java new file mode 100644 index 00000000..c5e3e85f --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java @@ -0,0 +1,47 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.modules.core.ProgramsAPI; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.BrApiTrial; +import org.brapi.v2.phenotyping.model.BrApiTrait; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class TraitsAPIUnitTests { + + TraitsAPI traitsAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + traitsAPI = new TraitsAPI(brAPIClient); + } + + @Test + @SneakyThrows + void getTraitsEmtpyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiTraits = traitsAPI.getTraits(); + + assertEquals(0, brApiTraits.size(), "List size is greater than 0"); + } + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java index 094bd047..eb216120 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java @@ -9,6 +9,7 @@ import javax.validation.Valid; import java.util.List; +import java.util.Map; /** * TraitBaseClass @@ -27,6 +28,10 @@ public class BrApiTrait { @JsonProperty("attribute") private String attribute; + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + @JsonProperty("entity") private String entity; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java new file mode 100644 index 00000000..ba5edf54 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java @@ -0,0 +1,37 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.*; +import lombok.experimental.Accessors; +import org.brapi.v2.core.model.request.BaseRequest; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class TraitsRequest extends BaseRequest { + + private String traitDbId; + private String observationVariableDbId; + private String externalReferenceID; + private String externalReferenceSource; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + if (page != null) params.put("page", page.toString()); + if (pageSize != null) params.put("pageSize", pageSize.toString()); + if (traitDbId != null) params.put("traitDbId", traitDbId); + if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); + if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); + if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); + + return params; + + } +} From 6d7be65498e301b9d5ad6217bcad86dbb6dc63bd Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 27 Apr 2020 15:14:44 -0400 Subject: [PATCH 20/71] read single trait --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 5 ++++ .../v2/modules/phenotype/TraitsAPI.java | 24 +++++++++++++++++++ .../v2/modules/phenotype/TraitsAPITests.java | 20 ++++++++++++++++ .../modules/phenotype/TraitsAPIUnitTests.java | 10 ++++++++ 4 files changed, 59 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 50d49373..bf10018f 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -9,4 +9,9 @@ public static String getRootPath() { public static String getTraitsPath() { return getRootPath() + "/traits"; } + + public static String getTraitsByIdPath(String traitId) { + return String.format(getRootPath() + "/traits/%s", traitId); + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index 5977b2b3..200cc9d5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -15,6 +15,7 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class TraitsAPI extends BrAPIEndpoint { @@ -49,4 +50,27 @@ public List getTraits(TraitsRequest traitsRequest) throws HttpExcept public List getTraits() throws HttpException, APIException { return getTraits(null); } + + public Optional getTraitById(String traitId) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (traitId == null) { + throw new APIException("Must specify traitId for the getTraitById endpoint."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getTraitsByIdPath(traitId); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiTrait resultResponse = gson.fromJson(resultJson, BrApiTrait.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 9941d1fb..c4426645 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -2,6 +2,8 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.client.v2.modules.core.ProgramsAPI; import org.brapi.v2.core.model.BrApiProgram; import org.brapi.v2.core.model.request.ProgramsRequest; @@ -13,8 +15,10 @@ import org.junit.jupiter.api.TestMethodOrder; import java.util.List; +import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @@ -22,6 +26,7 @@ public class TraitsAPITests extends BrAPIClientTest { private TraitsAPI traitsAPI = new TraitsAPI(this.client); private String externalReferenceID = "https://brapi.org/specification"; + public String traitId = "trait_attribute1"; @Test @SneakyThrows @@ -43,4 +48,19 @@ void getTraitsByExternalReferenceIdSuccess() { assertEquals(true, traits.size() > 0, "List of programs was empty"); } + @Test + @SneakyThrows + void getTraitByIdSuccess() { + Optional traits = this.traitsAPI.getTraitById(traitId); + + assertEquals(true, traits.isPresent(), "An empty optional was returned"); + } + + @Test + @SneakyThrows + public void getTraitByIdMissingID() { + APIException exception = assertThrows(APIException.class, () -> { + Optional traits = this.traitsAPI.getTraitById(null); + }); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java index c5e3e85f..36cdc5ca 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java @@ -44,4 +44,14 @@ void getTraitsEmtpyBody() { assertEquals(0, brApiTraits.size(), "List size is greater than 0"); } + @Test + @SneakyThrows + void getTraitsByIdEmtpyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiTrait = traitsAPI.getTraitById("test"); + + assertEquals(false, brApiTrait.isPresent(), "Empty optional was not returned."); + } + } From 5b861c62d5e47c115cb5746010a933b61c6deca4 Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 27 Apr 2020 15:23:58 -0400 Subject: [PATCH 21/71] fuller get trait by id test --- .../v2/modules/phenotype/TraitsAPITests.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index c4426645..a8035de8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -51,9 +51,28 @@ void getTraitsByExternalReferenceIdSuccess() { @Test @SneakyThrows void getTraitByIdSuccess() { - Optional traits = this.traitsAPI.getTraitById(traitId); + Optional optionalBrApiTrait = this.traitsAPI.getTraitById(traitId); - assertEquals(true, traits.isPresent(), "An empty optional was returned"); + assertEquals(true, optionalBrApiTrait.isPresent(), "An empty optional was returned"); + BrApiTrait trait = optionalBrApiTrait.get(); + assertEquals(true, trait.getTraitDbId() != null, "TraitDbId was not parsed properly."); + assertEquals(true, trait.getAlternativeAbbreviations() != null, "Alternative Abbreviations were not parsed properly."); + //TODO: Test alternative abbreviations + assertEquals(true, trait.getAttribute() != null, "Attribute was not parsed properly."); + assertEquals(true, trait.getAdditionalInfo() != null, "Additional Info was not parsed properly."); + //TODO: Test additional info + assertEquals(true, trait.getEntity() != null, "Entity was not parsed properly."); + assertEquals(true, trait.getExternalReferences() != null, "External References were not parsed properly."); + //TODO: Test external references + assertEquals(true, trait.getMainAbbreviation() != null, "Main abbreviations were not parsed properly."); + assertEquals(true, trait.getOntologyReference() != null, "Ontology reference was not parsed properly."); + //TODO: Test ontology reference + assertEquals(true, trait.getStatus() != null, "Status was not parsed properly."); + assertEquals(true, trait.getSynonyms() != null, "Synonyms were not parsed properly."); + //TODO: Test synonyms + assertEquals(true, trait.getTraitClass() != null, "Trait class was not parsed properly."); + assertEquals(true, trait.getTraitDescription() != null, "Trait description was not parsed properly."); + assertEquals(true, trait.getTraitName() != null, "Trait name was not parsed properly."); } @Test From 7fe36d5f9d172fe9d06b169733b7dd945b52e61d Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 27 Apr 2020 16:17:51 -0400 Subject: [PATCH 22/71] create traits endpoints --- .../v2/modules/phenotype/TraitsAPI.java | 39 +++++++++ .../v2/modules/phenotype/TraitsAPITests.java | 84 +++++++++++++++++-- .../modules/phenotype/TraitsAPIUnitTests.java | 10 +++ 3 files changed, 124 insertions(+), 9 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index 200cc9d5..d864dc0a 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -7,6 +7,7 @@ import org.brapi.client.v2.model.HttpMethod; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.client.v2.modules.core.BrAPICoreEndpoints_V2; import org.brapi.v2.core.model.BrApiProgram; import org.brapi.v2.core.model.response.DataResponse; import org.brapi.v2.phenotyping.model.BrApiTrait; @@ -73,4 +74,42 @@ public Optional getTraitById(String traitId) throws HttpException, A return searchResult; } + + public List createTraits(List brApiTraits) throws HttpException, APIException { + + // Check if our values are passed in and raise error if not + if (brApiTraits.stream().anyMatch(program -> program.getTraitDbId() != null)) { + throw new APIException("BrAPI program must not have an existing programDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getTraitsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiTraits) + .method(HttpMethod.POST) + .build(); + + List createdTrait = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdTrait; + } + + public Optional createTrait(BrApiTrait brApiTrait) throws HttpException, APIException { + List brApiTraits = new ArrayList<>(); + brApiTraits.add(brApiTrait); + List createdTraits = createTraits(brApiTraits); + + if (createdTraits.size() == 1){ + return Optional.of(createdTraits.get(0)); + } + else { + return Optional.empty(); + } + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index a8035de8..521e071b 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -3,17 +3,12 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; -import org.brapi.client.v2.model.exceptions.HttpNotFoundException; -import org.brapi.client.v2.modules.core.ProgramsAPI; -import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.v2.core.model.request.ProgramsRequest; +import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.*; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -25,7 +20,7 @@ public class TraitsAPITests extends BrAPIClientTest { private TraitsAPI traitsAPI = new TraitsAPI(this.client); - private String externalReferenceID = "https://brapi.org/specification"; + private String externalReferenceID = "test"; public String traitId = "trait_attribute1"; @Test @@ -38,6 +33,7 @@ void getTraitsSuccess() { @Test @SneakyThrows + @Order(2) void getTraitsByExternalReferenceIdSuccess() { TraitsRequest traitsRequest = TraitsRequest.builder() .externalReferenceID(this.externalReferenceID) @@ -82,4 +78,74 @@ public void getTraitByIdMissingID() { Optional traits = this.traitsAPI.getTraitById(null); }); } + + @Test + @SneakyThrows + public void createTraitsMultipleSuccess() { + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitName("new test trait1") + .build(); + BrApiTrait brApiTrait2 = BrApiTrait.builder() + .traitName("new test trait2") + .build(); + List traits = new ArrayList<>(); + traits.add(brApiTrait); + traits.add(brApiTrait2); + + List createdTraits = this.traitsAPI.createTraits(traits); + + assertEquals(true, createdTraits.size() == 2); + assertEquals(true, createdTraits.get(0).getTraitDbId() != null, "Program Id was not parsed properly"); + + assertEquals("new test trait1", createdTraits.get(0).getTraitName(), "Program Name was not parsed properly"); + assertEquals("new test trait2", createdTraits.get(1).getTraitName(), "Program Name was not parsed properly"); + } + + @Test + @SneakyThrows + @Order(1) + public void createTraitSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitName("new test trait") + .externalReferences(externalReferences) + .build(); + + Optional createdTrait = this.traitsAPI.createTrait(brApiTrait); + + assertEquals(true, createdTrait.isPresent()); + BrApiTrait trait = createdTrait.get(); + assertEquals("new test trait", trait.getTraitName(), "Program Name was not parsed properly"); + } + + @Test + @SneakyThrows + public void createTraitIdPresent(){ + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional traits = this.traitsAPI.createTrait(brApiTrait); + }); + } + + @Test + @SneakyThrows + public void createTraitsMultipleIdPresent(){ + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitDbId("test") + .build(); + BrApiTrait brApiTrait1 = new BrApiTrait(); + List brApiTraits = new ArrayList<>(); + brApiTraits.add(brApiTrait); + brApiTraits.add(brApiTrait1); + + APIException exception = assertThrows(APIException.class, () -> { + List traits = this.traitsAPI.createTraits(brApiTraits); + }); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java index 36cdc5ca..ce673225 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java @@ -54,4 +54,14 @@ void getTraitsByIdEmtpyBody() { assertEquals(false, brApiTrait.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void createTraitsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiTrait = traitsAPI.createTrait(new BrApiTrait()); + + assertEquals(false, brApiTrait.isPresent(), "Empty optional was not returned."); + } + } From c4e722bbd8411a1b823c67255d2e0ba766d93471 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 28 Apr 2020 09:06:10 -0400 Subject: [PATCH 23/71] update trait --- .../v2/modules/phenotype/TraitsAPI.java | 23 +++++++++++ .../v2/modules/phenotype/TraitsAPITests.java | 38 ++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index d864dc0a..3644257f 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -112,4 +112,27 @@ public Optional createTrait(BrApiTrait brApiTrait) throws HttpExcept return Optional.empty(); } } + + public Optional updateTrait(BrApiTrait brApiTrait) throws HttpException, APIException { + + if (brApiTrait.getTraitDbId() == null){ + throw new APIException("BrAPI program must have an existing programDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getTraitsByIdPath(brApiTrait.getTraitDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiTrait) + .method(HttpMethod.PUT) + .build(); + + Optional updatedProgram = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiTrait resultResponse = gson.fromJson(resultJson, BrApiTrait.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updatedProgram; + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 521e071b..913135ac 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -4,6 +4,7 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiProgram; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; import org.junit.jupiter.api.*; @@ -21,7 +22,7 @@ public class TraitsAPITests extends BrAPIClientTest { private TraitsAPI traitsAPI = new TraitsAPI(this.client); private String externalReferenceID = "test"; - public String traitId = "trait_attribute1"; + private BrApiTrait createdTrait; @Test @SneakyThrows @@ -46,8 +47,9 @@ void getTraitsByExternalReferenceIdSuccess() { @Test @SneakyThrows + @Order(3) void getTraitByIdSuccess() { - Optional optionalBrApiTrait = this.traitsAPI.getTraitById(traitId); + Optional optionalBrApiTrait = this.traitsAPI.getTraitById(createdTrait.getTraitDbId()); assertEquals(true, optionalBrApiTrait.isPresent(), "An empty optional was returned"); BrApiTrait trait = optionalBrApiTrait.get(); @@ -120,6 +122,7 @@ public void createTraitSuccess() { assertEquals(true, createdTrait.isPresent()); BrApiTrait trait = createdTrait.get(); assertEquals("new test trait", trait.getTraitName(), "Program Name was not parsed properly"); + this.createdTrait = trait; } @Test @@ -148,4 +151,35 @@ public void createTraitsMultipleIdPresent(){ List traits = this.traitsAPI.createTraits(brApiTraits); }); } + + @Test + @SneakyThrows + @Order(4) + public void updateTraitSuccess() { + BrApiTrait trait = this.createdTrait; + trait.setTraitName("updated_name"); + trait.setTraitDescription("recording stuff"); + + // Check that it is a success and all data matches + Optional updatedTraitResult = this.traitsAPI.updateTrait(trait); + + assertEquals(true, updatedTraitResult.isPresent(), "Program was not returned"); + BrApiTrait updatedTrait = updatedTraitResult.get(); + assertEquals("updated_name", updatedTrait.getTraitName(), "Program name was not parsed correctly"); + assertEquals("recording stuff", updatedTrait.getTraitDescription(), "Program objective was not parsed correctly"); + + } + + @Test + @SneakyThrows + public void updateProgramMissingId() { + // Check that it throws an APIException + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitName("new test trait") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedProgramResult = this.traitsAPI.updateTrait(brApiTrait); + }); + } } From 56bfa38770650c0111e331ab1817bd026432bfe5 Mon Sep 17 00:00:00 2001 From: Chris T Date: Tue, 28 Apr 2020 11:31:26 -0400 Subject: [PATCH 24/71] import and tests cleanup --- .../v2/modules/phenotype/TraitsAPI.java | 2 -- .../v2/modules/phenotype/TraitsAPITests.java | 32 ++++++++++++------- .../modules/phenotype/TraitsAPIUnitTests.java | 3 -- .../org/brapi/v2/core/model/BrApiProgram.java | 1 - .../org/brapi/v2/core/model/BrApiStudy.java | 1 - 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index 3644257f..3e524be4 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -7,8 +7,6 @@ import org.brapi.client.v2.model.HttpMethod; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpException; -import org.brapi.client.v2.modules.core.BrAPICoreEndpoints_V2; -import org.brapi.v2.core.model.BrApiProgram; import org.brapi.v2.core.model.response.DataResponse; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 913135ac..909d39c5 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -4,14 +4,11 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.v2.core.model.BrApiExternalReference; -import org.brapi.v2.core.model.BrApiProgram; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; import org.junit.jupiter.api.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; +import java.util.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -54,20 +51,19 @@ void getTraitByIdSuccess() { assertEquals(true, optionalBrApiTrait.isPresent(), "An empty optional was returned"); BrApiTrait trait = optionalBrApiTrait.get(); assertEquals(true, trait.getTraitDbId() != null, "TraitDbId was not parsed properly."); - assertEquals(true, trait.getAlternativeAbbreviations() != null, "Alternative Abbreviations were not parsed properly."); - //TODO: Test alternative abbreviations + assertEquals(true, trait.getAlternativeAbbreviations() != null, "Alternative Abbreviations was not parsed properly."); + assertEquals(true, trait.getAlternativeAbbreviations().size() > 0, "Alternative abbreviations was not parsed properly."); assertEquals(true, trait.getAttribute() != null, "Attribute was not parsed properly."); assertEquals(true, trait.getAdditionalInfo() != null, "Additional Info was not parsed properly."); - //TODO: Test additional info + assertEquals(true, trait.getAdditionalInfo().size() > 0, "Additional Info was not parsed properly."); assertEquals(true, trait.getEntity() != null, "Entity was not parsed properly."); assertEquals(true, trait.getExternalReferences() != null, "External References were not parsed properly."); - //TODO: Test external references + assertEquals(true, trait.getExternalReferences().get(0).getReferenceID() != null, "External Reference was not parsed properly."); assertEquals(true, trait.getMainAbbreviation() != null, "Main abbreviations were not parsed properly."); assertEquals(true, trait.getOntologyReference() != null, "Ontology reference was not parsed properly."); - //TODO: Test ontology reference assertEquals(true, trait.getStatus() != null, "Status was not parsed properly."); assertEquals(true, trait.getSynonyms() != null, "Synonyms were not parsed properly."); - //TODO: Test synonyms + assertEquals(true, trait.getSynonyms().size() > 0, "Synonyms were not parsed properly."); assertEquals(true, trait.getTraitClass() != null, "Trait class was not parsed properly."); assertEquals(true, trait.getTraitDescription() != null, "Trait description was not parsed properly."); assertEquals(true, trait.getTraitName() != null, "Trait name was not parsed properly."); @@ -112,9 +108,22 @@ public void createTraitSuccess() { .build(); List externalReferences = new ArrayList<>(); externalReferences.add(brApiExternalReference); + List alternativeAbbreviations = new ArrayList<>(); + alternativeAbbreviations.add("test abbrev"); + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); BrApiTrait brApiTrait = BrApiTrait.builder() - .traitName("new test trait") + .alternativeAbbreviations(alternativeAbbreviations) + .attribute("test") + .additionalInfo(additionalInfo) + .entity("trait") .externalReferences(externalReferences) + .mainAbbreviation("trait") + .status("trait") + .synonyms(alternativeAbbreviations) + .traitClass("test") + .traitDescription("a trait for things") + .traitName("new test trait") .build(); Optional createdTrait = this.traitsAPI.createTrait(brApiTrait); @@ -159,6 +168,7 @@ public void updateTraitSuccess() { BrApiTrait trait = this.createdTrait; trait.setTraitName("updated_name"); trait.setTraitDescription("recording stuff"); + trait.setOntologyReference(null); // Check that it is a success and all data matches Optional updatedTraitResult = this.traitsAPI.updateTrait(trait); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java index ce673225..8b5dc085 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java @@ -4,9 +4,6 @@ import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.ResponseHandlerFunction; import org.brapi.client.v2.model.BrAPIRequest; -import org.brapi.client.v2.modules.core.ProgramsAPI; -import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.v2.core.model.BrApiTrial; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index b8004c77..aa6ee16d 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; -import lombok.Getter; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java index 6fb0f8f8..a7a736f0 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -1,7 +1,6 @@ package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; From 4a84ecffef678a73a12f3e182f1ae3b812775d52 Mon Sep 17 00:00:00 2001 From: Chris T Date: Thu, 30 Apr 2020 09:48:04 -0400 Subject: [PATCH 25/71] updates from pull request review --- .../v2/modules/phenotype/TraitsAPI.java | 7 +- .../v2/modules/core/ProgramsAPITests.java | 15 ++ .../v2/modules/phenotype/TraitsAPITests.java | 139 ++++++++++-------- .../v2/core/model/request/BaseRequest.java | 7 + .../core/model/request/ProgramsRequest.java | 6 +- .../model/request/TraitsRequest.java | 6 +- 6 files changed, 107 insertions(+), 73 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index 3e524be4..d279bf90 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -22,7 +22,6 @@ public class TraitsAPI extends BrAPIEndpoint { public List getTraits(TraitsRequest traitsRequest) throws HttpException, APIException { - // Check if our values are passed in and raise error if not if (traitsRequest == null) { traitsRequest = new TraitsRequest(); } @@ -52,7 +51,6 @@ public List getTraits() throws HttpException, APIException { public Optional getTraitById(String traitId) throws HttpException, APIException { - // Check if our values are passed in and raise error if not if (traitId == null) { throw new APIException("Must specify traitId for the getTraitById endpoint."); } @@ -75,9 +73,8 @@ public Optional getTraitById(String traitId) throws HttpException, A public List createTraits(List brApiTraits) throws HttpException, APIException { - // Check if our values are passed in and raise error if not if (brApiTraits.stream().anyMatch(program -> program.getTraitDbId() != null)) { - throw new APIException("BrAPI program must not have an existing programDbId."); + throw new APIException("BrAPI trait must not have an existing traitDbId."); } // Build our request @@ -114,7 +111,7 @@ public Optional createTrait(BrApiTrait brApiTrait) throws HttpExcept public Optional updateTrait(BrApiTrait brApiTrait) throws HttpException, APIException { if (brApiTrait.getTraitDbId() == null){ - throw new APIException("BrAPI program must have an existing programDbId."); + throw new APIException("BrAPI trait must have an existing traitDbId."); } // Build our request diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 69874f42..85c6149e 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -5,6 +5,7 @@ import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.request.BaseRequest; import org.brapi.v2.core.model.request.ProgramsRequest; import org.junit.jupiter.api.*; @@ -29,11 +30,25 @@ public class ProgramsAPITests extends BrAPIClientTest { @Test @SneakyThrows public void getProgramsSuccess() { + List programs = this.programsAPI.getPrograms(); assertEquals(true, !programs.isEmpty(), "List of programs was empty"); } + @Test + @SneakyThrows + public void getProgramsPageFilter() { + ProgramsRequest baseRequest = ProgramsRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List programs = this.programsAPI.getPrograms(baseRequest); + + assertEquals(true, programs.size() == 1, "More than one program was returned"); + } + @Test @SneakyThrows public void getProgramByIDSuccess() { diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 909d39c5..baeebb74 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -4,6 +4,8 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiProgram; +import org.brapi.v2.core.model.request.ProgramsRequest; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; import org.junit.jupiter.api.*; @@ -21,6 +23,68 @@ public class TraitsAPITests extends BrAPIClientTest { private String externalReferenceID = "test"; private BrApiTrait createdTrait; + @Test + @SneakyThrows + public void createTraitIdPresent(){ + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional traits = this.traitsAPI.createTrait(brApiTrait); + }); + } + + @Test + @SneakyThrows + public void createTraitsMultipleIdPresent(){ + BrApiTrait brApiTrait = BrApiTrait.builder() + .traitDbId("test") + .build(); + BrApiTrait brApiTrait1 = new BrApiTrait(); + List brApiTraits = new ArrayList<>(); + brApiTraits.add(brApiTrait); + brApiTraits.add(brApiTrait1); + + APIException exception = assertThrows(APIException.class, () -> { + List traits = this.traitsAPI.createTraits(brApiTraits); + }); + } + + @Test + @SneakyThrows + @Order(1) + public void createTraitSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + List alternativeAbbreviations = new ArrayList<>(); + alternativeAbbreviations.add("test abbrev"); + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); + BrApiTrait brApiTrait = BrApiTrait.builder() + .alternativeAbbreviations(alternativeAbbreviations) + .attribute("test") + .additionalInfo(additionalInfo) + .entity("trait") + .externalReferences(externalReferences) + .mainAbbreviation("trait") + .status("trait") + .synonyms(alternativeAbbreviations) + .traitClass("test") + .traitDescription("a trait for things") + .traitName("new test trait") + .build(); + + Optional createdTrait = this.traitsAPI.createTrait(brApiTrait); + + assertEquals(true, createdTrait.isPresent()); + BrApiTrait trait = createdTrait.get(); + assertEquals("new test trait", trait.getTraitName(), "Program Name was not parsed properly"); + this.createdTrait = trait; + } + @Test @SneakyThrows void getTraitsSuccess() { @@ -29,6 +93,19 @@ void getTraitsSuccess() { assertEquals(true, !traits.isEmpty(), "List of programs was empty"); } + @Test + @SneakyThrows + void getTraitsPageFilter() { + TraitsRequest baseRequest = TraitsRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List traits = this.traitsAPI.getTraits(baseRequest); + + assertEquals(true, traits.size() == 1, "More than one trait was returned"); + } + @Test @SneakyThrows @Order(2) @@ -99,68 +176,6 @@ public void createTraitsMultipleSuccess() { assertEquals("new test trait2", createdTraits.get(1).getTraitName(), "Program Name was not parsed properly"); } - @Test - @SneakyThrows - @Order(1) - public void createTraitSuccess() { - BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() - .referenceID(externalReferenceID) - .build(); - List externalReferences = new ArrayList<>(); - externalReferences.add(brApiExternalReference); - List alternativeAbbreviations = new ArrayList<>(); - alternativeAbbreviations.add("test abbrev"); - Map additionalInfo = new HashMap<>(); - additionalInfo.put("test", "test"); - BrApiTrait brApiTrait = BrApiTrait.builder() - .alternativeAbbreviations(alternativeAbbreviations) - .attribute("test") - .additionalInfo(additionalInfo) - .entity("trait") - .externalReferences(externalReferences) - .mainAbbreviation("trait") - .status("trait") - .synonyms(alternativeAbbreviations) - .traitClass("test") - .traitDescription("a trait for things") - .traitName("new test trait") - .build(); - - Optional createdTrait = this.traitsAPI.createTrait(brApiTrait); - - assertEquals(true, createdTrait.isPresent()); - BrApiTrait trait = createdTrait.get(); - assertEquals("new test trait", trait.getTraitName(), "Program Name was not parsed properly"); - this.createdTrait = trait; - } - - @Test - @SneakyThrows - public void createTraitIdPresent(){ - BrApiTrait brApiTrait = BrApiTrait.builder() - .traitDbId("test") - .build(); - APIException exception = assertThrows(APIException.class, () -> { - Optional traits = this.traitsAPI.createTrait(brApiTrait); - }); - } - - @Test - @SneakyThrows - public void createTraitsMultipleIdPresent(){ - BrApiTrait brApiTrait = BrApiTrait.builder() - .traitDbId("test") - .build(); - BrApiTrait brApiTrait1 = new BrApiTrait(); - List brApiTraits = new ArrayList<>(); - brApiTraits.add(brApiTrait); - brApiTraits.add(brApiTrait1); - - APIException exception = assertThrows(APIException.class, () -> { - List traits = this.traitsAPI.createTraits(brApiTraits); - }); - } - @Test @SneakyThrows @Order(4) diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java index 7300be70..5c1440a2 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java @@ -1,9 +1,16 @@ package org.brapi.v2.core.model.request; +import lombok.*; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + import java.util.HashMap; import java.util.Map; +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor public abstract class BaseRequest { protected Integer page; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java index 0852642d..1d8332cf 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java @@ -2,13 +2,14 @@ import lombok.*; import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; import java.util.HashMap; import java.util.Map; @Getter @Setter -@Builder +@SuperBuilder @NoArgsConstructor @AllArgsConstructor @Accessors(fluent=true) @@ -25,8 +26,7 @@ public Map constructParameters() { Map params = new HashMap<>(); - if (page != null) params.put("page", page.toString()); - if (pageSize != null) params.put("pageSize", pageSize.toString()); + params.putAll(super.constructParameters()); if (commonCropName != null) params.put("commonCropName", commonCropName); if (programDbId != null) params.put("programDbId", programDbId); if (programName != null) params.put("programName", programName); diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java index ba5edf54..b886c98f 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java @@ -2,6 +2,7 @@ import lombok.*; import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; import org.brapi.v2.core.model.request.BaseRequest; import java.util.HashMap; @@ -9,7 +10,7 @@ @Getter @Setter -@Builder +@SuperBuilder @NoArgsConstructor @AllArgsConstructor @Accessors(fluent=true) @@ -24,8 +25,7 @@ public Map constructParameters() { Map params = new HashMap<>(); - if (page != null) params.put("page", page.toString()); - if (pageSize != null) params.put("pageSize", pageSize.toString()); + params.putAll(super.constructParameters()); if (traitDbId != null) params.put("traitDbId", traitDbId); if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); From 1925f13816a91c6172f936e1e62f61dab2fa739e Mon Sep 17 00:00:00 2001 From: Chris T Date: Mon, 4 May 2020 08:02:56 -0400 Subject: [PATCH 26/71] changes from pull request --- .../java/org/brapi/client/v2/BrAPIEndpoints_V2.java | 8 ++++++++ .../v2/modules/core/BrAPICoreEndpoints_V2.java | 6 ++---- .../brapi/client/v2/modules/core/ProgramsAPI.java | 7 ++++--- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 6 ++---- .../client/v2/modules/phenotype/TraitsAPI.java | 13 +++++++------ .../client/v2/modules/phenotype/TraitsAPITests.java | 6 +++--- 6 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java new file mode 100644 index 00000000..fcfd2467 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java @@ -0,0 +1,8 @@ +package org.brapi.client.v2; + +public abstract class BrAPIEndpoints_V2 { + + public static String getRootPath() { + return "/brapi/v2"; + } +} diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java index a9c3c4f8..ab6b1849 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java @@ -1,10 +1,8 @@ package org.brapi.client.v2.modules.core; -public class BrAPICoreEndpoints_V2 { +import org.brapi.client.v2.BrAPIEndpoints_V2; - public static String getRootPath() { - return "/brapi/v2"; - } +public class BrAPICoreEndpoints_V2 extends BrAPIEndpoints_V2 { public static String getProgramsPath() { return getRootPath() + "/programs"; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index e1565577..011aa682 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -11,6 +11,7 @@ import org.brapi.v2.core.model.request.ProgramsRequest; import org.brapi.v2.core.model.response.DataResponse; +import javax.validation.constraints.NotNull; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; @@ -21,11 +22,11 @@ public class ProgramsAPI extends BrAPIEndpoint { public ProgramsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List getPrograms(ProgramsRequest programFilter) throws HttpException, APIException { + public List getPrograms(@NotNull ProgramsRequest programFilter) throws HttpException, APIException { // Check if our values are passed in and raise error if not if (programFilter == null) { - programFilter = new ProgramsRequest(); + throw new IllegalArgumentException("Programs request cannot be null"); } // Build our request @@ -47,7 +48,7 @@ public List getPrograms(ProgramsRequest programFilter) throws Http } public List getPrograms() throws HttpException, APIException { - return getPrograms(null); + return getPrograms(new ProgramsRequest()); } public Optional getProgramById(String programID) throws HttpException, APIException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index bf10018f..9790fb43 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -1,10 +1,8 @@ package org.brapi.client.v2.modules.phenotype; -public class BrAPIPhenotypeEndpoints_V2 { +import org.brapi.client.v2.BrAPIEndpoints_V2; - public static String getRootPath() { - return "/brapi/v2"; - } +public class BrAPIPhenotypeEndpoints_V2 extends BrAPIEndpoints_V2 { public static String getTraitsPath() { return getRootPath() + "/traits"; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index d279bf90..0e5c3a89 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -11,6 +11,7 @@ import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; +import javax.validation.constraints.NotNull; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; @@ -20,10 +21,10 @@ public class TraitsAPI extends BrAPIEndpoint { public TraitsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List getTraits(TraitsRequest traitsRequest) throws HttpException, APIException { + public List getTraits(@NotNull TraitsRequest traitsRequest) throws HttpException, APIException { if (traitsRequest == null) { - traitsRequest = new TraitsRequest(); + throw new IllegalArgumentException("Traits request cannot be null"); } // Build our request @@ -46,7 +47,7 @@ public List getTraits(TraitsRequest traitsRequest) throws HttpExcept } public List getTraits() throws HttpException, APIException { - return getTraits(null); + return getTraits(new TraitsRequest()); } public Optional getTraitById(String traitId) throws HttpException, APIException { @@ -73,7 +74,7 @@ public Optional getTraitById(String traitId) throws HttpException, A public List createTraits(List brApiTraits) throws HttpException, APIException { - if (brApiTraits.stream().anyMatch(program -> program.getTraitDbId() != null)) { + if (brApiTraits.stream().anyMatch(trait -> trait.getTraitDbId() != null)) { throw new APIException("BrAPI trait must not have an existing traitDbId."); } @@ -123,11 +124,11 @@ public Optional updateTrait(BrApiTrait brApiTrait) throws HttpExcept .method(HttpMethod.PUT) .build(); - Optional updatedProgram = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Optional updateTrait = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { BrApiTrait resultResponse = gson.fromJson(resultJson, BrApiTrait.class); return Optional.of(resultResponse); }).orElse(Optional.empty()); - return updatedProgram; + return updateTrait; } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index baeebb74..37d43183 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -137,7 +137,7 @@ void getTraitByIdSuccess() { assertEquals(true, trait.getExternalReferences() != null, "External References were not parsed properly."); assertEquals(true, trait.getExternalReferences().get(0).getReferenceID() != null, "External Reference was not parsed properly."); assertEquals(true, trait.getMainAbbreviation() != null, "Main abbreviations were not parsed properly."); - assertEquals(true, trait.getOntologyReference() != null, "Ontology reference was not parsed properly."); + //assertEquals(true, trait.getOntologyReference() != null, "Ontology reference was not parsed properly."); assertEquals(true, trait.getStatus() != null, "Status was not parsed properly."); assertEquals(true, trait.getSynonyms() != null, "Synonyms were not parsed properly."); assertEquals(true, trait.getSynonyms().size() > 0, "Synonyms were not parsed properly."); @@ -190,8 +190,8 @@ public void updateTraitSuccess() { assertEquals(true, updatedTraitResult.isPresent(), "Program was not returned"); BrApiTrait updatedTrait = updatedTraitResult.get(); - assertEquals("updated_name", updatedTrait.getTraitName(), "Program name was not parsed correctly"); - assertEquals("recording stuff", updatedTrait.getTraitDescription(), "Program objective was not parsed correctly"); + assertEquals(trait.getTraitName(), updatedTrait.getTraitName(), "Program name was not parsed correctly"); + assertEquals(trait.getTraitDescription(), updatedTrait.getTraitDescription(), "Program objective was not parsed correctly"); } From 8f22f6f0af63f579856b5b45b328d2704e5acb1e Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 12:20:43 -0400 Subject: [PATCH 27/71] Added create method --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 ++ .../v2/modules/phenotype/MethodsAPI.java | 61 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 9790fb43..e162fe2d 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -12,4 +12,8 @@ public static String getTraitsByIdPath(String traitId) { return String.format(getRootPath() + "/traits/%s", traitId); } + public static String getMethodsPath() { + return getRootPath() + "/methods"; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java new file mode 100644 index 00000000..0ae87ae9 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -0,0 +1,61 @@ +package org.brapi.client.v2.modules.phenotype; + +import com.google.gson.reflect.TypeToken; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiMethod; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class MethodsAPI extends BrAPIEndpoint { + + public MethodsAPI(BrAPIClient brAPIClient) { + super(brAPIClient); + } + + public List createMethods(List brApiMethods) throws HttpException, APIException { + + if (brApiMethods.stream().anyMatch(trait -> trait.getMethodDbId() != null)) { + throw new APIException("BrAPI method must not have an existing methodDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiMethods) + .method(HttpMethod.POST) + .build(); + + List createdMethod = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdMethod; + } + + public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + List brApiMethods = new ArrayList<>(); + brApiMethods.add(brApiMethod); + List createdMethods = createMethods(brApiMethods); + + if (createdMethods.size() == 1){ + return Optional.of(createdMethods.get(0)); + } + else { + return Optional.empty(); + } + } + +} From 19b25e36233dba0fe926859bca2e784069e06c2d Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 15:03:17 -0400 Subject: [PATCH 28/71] Added create method tests --- .../v2/modules/phenotype/MethodsAPITests.java | 121 ++++++++++++++++++ .../phenotype/MethodsAPIUnitTests.java | 42 ++++++ 2 files changed, 163 insertions(+) create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java new file mode 100644 index 00000000..2c3969b9 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -0,0 +1,121 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiOntologyReference; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.junit.jupiter.api.*; + +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class MethodsAPITests extends BrAPIClientTest { + + private MethodsAPI methodsAPI = new MethodsAPI(this.client); + private String externalReferenceID = "test"; + // depends on this existing in test db until we can create our own + // don't have GET /ontologies yet either + private String validOntologyDbId = "ontology_attribute1"; + + @Test + public void createMethodIdPresent() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional method = this.methodsAPI.createMethod(brApiMethod); + }); + } + + @Test + public void createMethodMultipleIdPresent() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodDbId("test") + .build(); + BrApiMethod brApiMethod1 = new BrApiMethod(); + List brApiMethods = new ArrayList<>(); + brApiMethods.add(brApiMethod); + brApiMethods.add(brApiMethod1); + + APIException exception = assertThrows(APIException.class, () -> { + List methods = this.methodsAPI.createMethods(brApiMethods); + }); + } + + @Test + @SneakyThrows + public void createMethodSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .referenceSource("test") + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + + BrApiOntologyReference brApiOntologyReference = BrApiOntologyReference.builder() + .ontologyDbId(validOntologyDbId) + .ontologyName("Ontology.org") + .version("17") + .build(); + + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); + BrApiMethod brApiMethod = BrApiMethod.builder() + .additionalInfo(additionalInfo) + .externalReferences(externalReferences) + .ontologyReference(brApiOntologyReference) + .bibliographicalReference("test bib") + .description("test method description") + .formula("test = test + 1") + .methodClass("test class") + .methodName("new test method") + .build(); + + Optional createdMethod = this.methodsAPI.createMethod(brApiMethod); + + assertTrue(createdMethod.isPresent()); + BrApiMethod method = createdMethod.get(); + + assertFalse(method.getMethodDbId() == null, "Method id missing"); + methodAssertEquals(brApiMethod, method); + } + + private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { + assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Method additionalInfo mismatch"); + assertEquals(expected.getMethodName(), actual.getMethodName(), "Method name mismatch"); + assertEquals(expected.getBibliographicalReference(), actual.getBibliographicalReference(), "Method bibliographical mismatch"); + assertEquals(expected.getOntologyReference(), actual.getOntologyReference(), "Method ontology reference mismatch"); + assertEquals(expected.getDescription(), actual.getDescription(), "Method description mismatch"); + assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Method external reference mismatch"); + assertEquals(expected.getFormula(), actual.getFormula(), "Method formula mismatch"); + assertEquals(expected.getMethodClass(), actual.getMethodClass(), "Method class mismatch"); + } + + @Test + @SneakyThrows + public void createMethodsMultipleSuccess() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodName("new test method1") + .build(); + BrApiMethod brApiMethod2 = BrApiMethod.builder() + .methodName("new test method2") + .build(); + List methods = new ArrayList<>(); + methods.add(brApiMethod); + methods.add(brApiMethod2); + + List createdMethods = this.methodsAPI.createMethods(methods); + + assertEquals(true, createdMethods.size() == 2); + assertEquals(true, createdMethods.get(0).getMethodDbId() != null, "Method id missing"); + assertEquals(true, createdMethods.get(1).getMethodDbId() != null, "Method id missing"); + + assertEquals(brApiMethod.getMethodName(), createdMethods.get(0).getMethodName(), "Method name mismatch"); + assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java new file mode 100644 index 00000000..b1ca8c69 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -0,0 +1,42 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class MethodsAPIUnitTests { + + MethodsAPI methodsAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + methodsAPI = new MethodsAPI(brAPIClient); + } + + @Test + @SneakyThrows + void createTraitsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.createMethod(new BrApiMethod()); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } +} From b6d1454c3251c2d011f6d75f7bdf082c7b7e31de Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 15:49:55 -0400 Subject: [PATCH 29/71] Updated some missed names --- .../java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java | 2 +- .../brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 0ae87ae9..d70ca8a3 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -23,7 +23,7 @@ public MethodsAPI(BrAPIClient brAPIClient) { public List createMethods(List brApiMethods) throws HttpException, APIException { - if (brApiMethods.stream().anyMatch(trait -> trait.getMethodDbId() != null)) { + if (brApiMethods.stream().anyMatch(method -> method.getMethodDbId() != null)) { throw new APIException("BrAPI method must not have an existing methodDbId."); } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index b1ca8c69..fce6325a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -32,7 +32,7 @@ public void setUp() { @Test @SneakyThrows - void createTraitsEmptyBody() { + void createMethodsEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); Optional brApiMethod = methodsAPI.createMethod(new BrApiMethod()); From 51ee6bd1f90f90165e64a68a13e26c304c0c2f36 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 13 May 2020 11:50:30 -0400 Subject: [PATCH 30/71] Added get methods api and tests --- .../v2/modules/phenotype/MethodsAPI.java | 30 +++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 64 +++++++++++++++++-- .../phenotype/MethodsAPIUnitTests.java | 11 ++++ .../v2/modules/phenotype/TraitsAPITests.java | 2 - .../model/request/MethodsRequest.java | 33 ++++++++++ .../request/ObservationVariablesRequest.java | 39 +++++++++++ .../model/request/TraitsRequest.java | 9 +-- 7 files changed, 172 insertions(+), 16 deletions(-) create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index d70ca8a3..50fe7725 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -9,6 +9,7 @@ import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.v2.core.model.response.DataResponse; import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.request.MethodsRequest; import java.lang.reflect.Type; import java.util.ArrayList; @@ -58,4 +59,33 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } + public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { + + if (methodsRequest == null) { + throw new IllegalArgumentException("Methods request cannot be null"); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(methodsRequest.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getMethods() throws HttpException, APIException { + return getMethods(new MethodsRequest()); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 2c3969b9..eb0370a0 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -6,6 +6,7 @@ import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.request.MethodsRequest; import org.junit.jupiter.api.*; import java.util.*; @@ -13,10 +14,12 @@ import static org.junit.jupiter.api.Assertions.*; @TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class MethodsAPITests extends BrAPIClientTest { private MethodsAPI methodsAPI = new MethodsAPI(this.client); - private String externalReferenceID = "test"; + private String externalReferenceID = "testId"; + private String externalReferenceSource = "testSource"; // depends on this existing in test db until we can create our own // don't have GET /ontologies yet either private String validOntologyDbId = "ontology_attribute1"; @@ -27,7 +30,7 @@ public void createMethodIdPresent() { .methodDbId("test") .build(); APIException exception = assertThrows(APIException.class, () -> { - Optional method = this.methodsAPI.createMethod(brApiMethod); + Optional method = methodsAPI.createMethod(brApiMethod); }); } @@ -42,16 +45,17 @@ public void createMethodMultipleIdPresent() { brApiMethods.add(brApiMethod1); APIException exception = assertThrows(APIException.class, () -> { - List methods = this.methodsAPI.createMethods(brApiMethods); + List methods = methodsAPI.createMethods(brApiMethods); }); } @Test + @Order(1) @SneakyThrows public void createMethodSuccess() { BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() .referenceID(externalReferenceID) - .referenceSource("test") + .referenceSource(externalReferenceSource) .build(); List externalReferences = new ArrayList<>(); externalReferences.add(brApiExternalReference); @@ -75,7 +79,7 @@ public void createMethodSuccess() { .methodName("new test method") .build(); - Optional createdMethod = this.methodsAPI.createMethod(brApiMethod); + Optional createdMethod = methodsAPI.createMethod(brApiMethod); assertTrue(createdMethod.isPresent()); BrApiMethod method = createdMethod.get(); @@ -108,7 +112,7 @@ public void createMethodsMultipleSuccess() { methods.add(brApiMethod); methods.add(brApiMethod2); - List createdMethods = this.methodsAPI.createMethods(methods); + List createdMethods = methodsAPI.createMethods(methods); assertEquals(true, createdMethods.size() == 2); assertEquals(true, createdMethods.get(0).getMethodDbId() != null, "Method id missing"); @@ -118,4 +122,52 @@ public void createMethodsMultipleSuccess() { assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); } + @Test + @SneakyThrows + void getMethodsSuccess() { + List methods = methodsAPI.getMethods(); + + assertEquals(true, !methods.isEmpty(), "List of methods was empty"); + } + + @Test + @SneakyThrows + void getMethodsPageFilter() { + MethodsRequest baseRequest = MethodsRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List methods = methodsAPI.getMethods(baseRequest); + + assertEquals(true, methods.size() == 1, "More than one method was returned"); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodsByExternalReferenceIdSuccess() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceID(externalReferenceID) + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + + assertEquals(true, methods.size() > 0, "List of methods was empty"); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodsByExternalReferenceSourceSuccess() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceSource(externalReferenceSource) + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + + assertEquals(true, methods.size() > 0, "List of methods was empty"); + } + + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index fce6325a..87c39a7a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -11,6 +11,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import java.util.List; import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -39,4 +40,14 @@ void createMethodsEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } + + @Test + @SneakyThrows + void getMethodsEmtpyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiMethods = methodsAPI.getMethods(); + + assertEquals(0, brApiMethods.size(), "List size is greater than 0"); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 37d43183..f962bda8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -4,8 +4,6 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.v2.core.model.BrApiExternalReference; -import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.v2.core.model.request.ProgramsRequest; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; import org.junit.jupiter.api.*; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java new file mode 100644 index 00000000..731fd2d9 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java @@ -0,0 +1,33 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class MethodsRequest extends ObservationVariablesRequest { + + private String methodDbId; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (methodDbId != null) params.put("methodDbId", methodDbId); + + return params; + + } +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java new file mode 100644 index 00000000..98d92b71 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java @@ -0,0 +1,39 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.request.BaseRequest; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class ObservationVariablesRequest extends BaseRequest { + + protected String observationVariableDbId; + protected String externalReferenceID; + protected String externalReferenceSource; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); + if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); + if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); + + return params; + + } + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java index b886c98f..6ce4ffab 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java @@ -3,7 +3,6 @@ import lombok.*; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.request.BaseRequest; import java.util.HashMap; import java.util.Map; @@ -14,12 +13,9 @@ @NoArgsConstructor @AllArgsConstructor @Accessors(fluent=true) -public class TraitsRequest extends BaseRequest { +public class TraitsRequest extends ObservationVariablesRequest { private String traitDbId; - private String observationVariableDbId; - private String externalReferenceID; - private String externalReferenceSource; public Map constructParameters() { @@ -27,9 +23,6 @@ public Map constructParameters() { params.putAll(super.constructParameters()); if (traitDbId != null) params.put("traitDbId", traitDbId); - if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); - if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); - if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); return params; From 4f475427dc7b3e45825e1640187588a44176aae0 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 09:44:33 -0400 Subject: [PATCH 31/71] Added get specific method api and tests --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 6 +- .../v2/modules/phenotype/MethodsAPI.java | 41 ++++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 62 ++++++++++++++++++- .../phenotype/MethodsAPIUnitTests.java | 25 +++++++- 4 files changed, 131 insertions(+), 3 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index e162fe2d..bdcef4d9 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -9,11 +9,15 @@ public static String getTraitsPath() { } public static String getTraitsByIdPath(String traitId) { - return String.format(getRootPath() + "/traits/%s", traitId); + return getTraitsPath() + "/" + traitId; } public static String getMethodsPath() { return getRootPath() + "/methods"; } + public static String getMethodsByIdPath(String methodId) { + return getMethodsPath() + "/" + methodId; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 50fe7725..8ab6cbbd 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -88,4 +88,45 @@ public List getMethods() throws HttpException, APIException { return getMethods(new MethodsRequest()); } + public Optional getMethodById(String methodId) throws HttpException, APIException { + + if (methodId == null) { + throw new APIException("Must specify methodId for the getMethodById endpoint."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(methodId); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiMethod resultResponse = gson.fromJson(resultJson, BrApiMethod.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } + + // returns first result if there are multiple matches + public Optional getMethodByExternalReferenceId(String externalReferenceId) throws HttpException, APIException { + + if (externalReferenceId == null) { + throw new APIException("Must specify externalReferenceId for the getMethodByExternalReferenceId endpoint."); + } + + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceID(externalReferenceId) + .build(); + + List searchResult = getMethods(methodsRequest); + + if (searchResult.isEmpty()) { + return Optional.empty(); + } + + return Optional.of(searchResult.get(0)); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index eb0370a0..0c670860 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -3,6 +3,7 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.BrApiMethod; @@ -20,6 +21,8 @@ public class MethodsAPITests extends BrAPIClientTest { private MethodsAPI methodsAPI = new MethodsAPI(this.client); private String externalReferenceID = "testId"; private String externalReferenceSource = "testSource"; + private BrApiMethod createdMethod; + // depends on this existing in test db until we can create our own // don't have GET /ontologies yet either private String validOntologyDbId = "ontology_attribute1"; @@ -86,13 +89,17 @@ public void createMethodSuccess() { assertFalse(method.getMethodDbId() == null, "Method id missing"); methodAssertEquals(brApiMethod, method); + + this.createdMethod = method; } private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Method additionalInfo mismatch"); assertEquals(expected.getMethodName(), actual.getMethodName(), "Method name mismatch"); assertEquals(expected.getBibliographicalReference(), actual.getBibliographicalReference(), "Method bibliographical mismatch"); - assertEquals(expected.getOntologyReference(), actual.getOntologyReference(), "Method ontology reference mismatch"); + assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Method ontology dbId mismatch"); + assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Method ontology name mismatch"); + assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Method ontology version mismatch"); assertEquals(expected.getDescription(), actual.getDescription(), "Method description mismatch"); assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Method external reference mismatch"); assertEquals(expected.getFormula(), actual.getFormula(), "Method formula mismatch"); @@ -169,5 +176,58 @@ void getMethodsByExternalReferenceSourceSuccess() { assertEquals(true, methods.size() > 0, "List of methods was empty"); } + @Test + public void getMethodByIdMissingId() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.getMethodById(null); + }); + } + + @Test + public void getMethodByExternalReferenceIdMissingId() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.getMethodByExternalReferenceId(null); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodByIdSuccess() { + Optional optionalBrApiMethod = methodsAPI.getMethodById(createdMethod.getMethodDbId()); + + assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); + BrApiMethod method = optionalBrApiMethod.get(); + assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); + methodAssertEquals(createdMethod, method); + } + + @Test + @SneakyThrows + void getMethodByIdInvalid() { + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional method = methodsAPI.getMethodById("badMethodId"); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodByExternalReferenceIdSuccess() { + + Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId(externalReferenceID); + + assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); + BrApiMethod method = optionalBrApiMethod.get(); + assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); + methodAssertEquals(createdMethod, method); + } + + @Test + @SneakyThrows + void getMethodByExternalReferenceIdInvalid() { + Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId("badExternalReferenceId"); + assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 87c39a7a..40e268eb 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -43,11 +43,34 @@ void createMethodsEmptyBody() { @Test @SneakyThrows - void getMethodsEmtpyBody() { + void getMethodsEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); List brApiMethods = methodsAPI.getMethods(); assertEquals(0, brApiMethods.size(), "List size is greater than 0"); } + + @Test + @SneakyThrows + void getMethodsByIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.getMethodById("test"); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + + @Test + @SneakyThrows + void getMethodsByExternalReferenceIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.getMethodByExternalReferenceId("test"); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + + + } From a1074f3bdeb08e81a97aca34ed40511587d96e99 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 10:42:45 -0400 Subject: [PATCH 32/71] Added update method api and tests --- .../v2/modules/phenotype/MethodsAPI.java | 29 +++++++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 36 +++++++++++++++++++ .../phenotype/MethodsAPIUnitTests.java | 15 ++++++++ 3 files changed, 80 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 8ab6cbbd..f7dc5f41 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -59,6 +59,33 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } + public Optional updateMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + + if (brApiMethod == null) { + throw new APIException("BrAPI method cannot be null"); + } + + if (brApiMethod.getMethodDbId() == null){ + throw new APIException("BrAPI method must have an existing methodDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(brApiMethod.getMethodDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiMethod) + .method(HttpMethod.PUT) + .build(); + + Optional updateMethod = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiMethod resultResponse = gson.fromJson(resultJson, BrApiMethod.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updateMethod; + } + public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { if (methodsRequest == null) { @@ -129,4 +156,6 @@ public Optional getMethodByExternalReferenceId(String externalRefer return Optional.of(searchResult.get(0)); } + + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 0c670860..632bcd92 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -230,4 +230,40 @@ void getMethodByExternalReferenceIdInvalid() { assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); } + @Test + @SneakyThrows + @Order(2) + public void updateMethodSuccess() { + BrApiMethod method = this.createdMethod; + method.setMethodName("updated_name"); + method.setDescription("updated_description"); + + // Check that it is a success and all data matches + Optional updatedMethodResult = this.methodsAPI.updateMethod(method); + + assertEquals(true, updatedMethodResult.isPresent(), "Method was not returned"); + BrApiMethod updatedMethod = updatedMethodResult.get(); + methodAssertEquals(method, updatedMethod); + } + + @Test + @SneakyThrows + public void updateMethodMissingId() { + // Check that it throws an APIException + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodName("new test method") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedMethodResult = this.methodsAPI.updateMethod(brApiMethod); + }); + } + + @Test + public void updateMethodNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = this.methodsAPI.updateMethod(null); + }); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 40e268eb..69a1a5a7 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -41,6 +41,21 @@ void createMethodsEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void updateMethodsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + + BrApiMethod method = BrApiMethod.builder() + .methodDbId("test") + .build(); + + Optional brApiMethod = methodsAPI.updateMethod(method); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + @Test @SneakyThrows void getMethodsEmptyBody() { From 97b5d7eebededcc5d48b121cdef58bfbeb6de10d Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 11:18:01 -0400 Subject: [PATCH 33/71] Added null and empty checks for create methods --- .../v2/modules/phenotype/MethodsAPI.java | 13 ++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index f7dc5f41..b2293af5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -24,6 +24,14 @@ public MethodsAPI(BrAPIClient brAPIClient) { public List createMethods(List brApiMethods) throws HttpException, APIException { + if (brApiMethods == null) { + throw new APIException("BrAPI methods cannot be null"); + } + + if (brApiMethods.isEmpty()) { + throw new APIException("BrAPI methods cannot be empty"); + } + if (brApiMethods.stream().anyMatch(method -> method.getMethodDbId() != null)) { throw new APIException("BrAPI method must not have an existing methodDbId."); } @@ -47,6 +55,11 @@ public List createMethods(List brApiMethods) throws Ht } public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + + if (brApiMethod == null) { + throw new APIException("BrAPI method cannot be null"); + } + List brApiMethods = new ArrayList<>(); brApiMethods.add(brApiMethod); List createdMethods = createMethods(brApiMethods); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 632bcd92..bb6a5ef8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -37,6 +37,13 @@ public void createMethodIdPresent() { }); } + @Test + public void createMethodNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.createMethod(null); + }); + } + @Test public void createMethodMultipleIdPresent() { BrApiMethod brApiMethod = BrApiMethod.builder() @@ -52,6 +59,24 @@ public void createMethodMultipleIdPresent() { }); } + @Test + public void createMethodMultipleEmptyList() { + + List brApiMethods = new ArrayList<>(); + + APIException exception = assertThrows(APIException.class, () -> { + List methods = methodsAPI.createMethods(brApiMethods); + }); + } + + @Test + public void createMethodMultipleNull() { + + APIException exception = assertThrows(APIException.class, () -> { + List methods = methodsAPI.createMethods(null); + }); + } + @Test @Order(1) @SneakyThrows From 7078291afc6ec29e711df0d9d46c797501e2c96e Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Fri, 15 May 2020 10:05:52 -0400 Subject: [PATCH 34/71] Fixed test ordering --- .../org/brapi/client/v2/modules/phenotype/MethodsAPITests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index bb6a5ef8..4a5998c6 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -132,6 +132,7 @@ private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { } @Test + @Order(1) @SneakyThrows public void createMethodsMultipleSuccess() { BrApiMethod brApiMethod = BrApiMethod.builder() @@ -156,6 +157,7 @@ public void createMethodsMultipleSuccess() { @Test @SneakyThrows + @Order(2) void getMethodsSuccess() { List methods = methodsAPI.getMethods(); @@ -164,6 +166,7 @@ void getMethodsSuccess() { @Test @SneakyThrows + @Order(2) void getMethodsPageFilter() { MethodsRequest baseRequest = MethodsRequest.builder() .page(0) From 20b87410b69b055f71747a6fd92d9ae48d2c51e3 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 10:13:37 -0400 Subject: [PATCH 35/71] Added create scale api and tests --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 + .../v2/modules/phenotype/ScalesAPI.java | 74 ++++++++ .../v2/modules/phenotype/ScalesAPITests.java | 173 ++++++++++++++++++ .../modules/phenotype/ScalesAPIUnitTests.java | 45 +++++ brapi-pheno-model/pom.xml | 6 + .../v2/phenotyping/model/BrApiScale.java | 6 + .../phenotyping/model/BrApiTraitDataType.java | 26 ++- 7 files changed, 328 insertions(+), 6 deletions(-) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index bdcef4d9..7bcd8503 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -20,4 +20,8 @@ public static String getMethodsByIdPath(String methodId) { return getMethodsPath() + "/" + methodId; } + public static String getScalesPath() { + return getRootPath() + "/scales"; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java new file mode 100644 index 00000000..2a99f69b --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -0,0 +1,74 @@ +package org.brapi.client.v2.modules.phenotype; + +import com.google.gson.reflect.TypeToken; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiScale; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class ScalesAPI extends BrAPIEndpoint { + + public ScalesAPI(BrAPIClient brAPIClient) { + super(brAPIClient); + } + + public List createScales(List brApiScales) throws HttpException, APIException { + + if (brApiScales == null) { + throw new APIException("BrAPI scales cannot be null"); + } + + if (brApiScales.isEmpty()) { + throw new APIException("BrAPI scales cannot be empty"); + } + + if (brApiScales.stream().anyMatch(scale -> scale.getScaleDbId() != null)) { + throw new APIException("BrAPI scale must not have an existing scaleDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiScales) + .method(HttpMethod.POST) + .build(); + + List createdScale = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdScale; + } + + public Optional createScale(BrApiScale brApiScale) throws HttpException, APIException { + + if (brApiScale == null) { + throw new APIException("BrAPI scale cannot be null"); + } + + List brApiScales = new ArrayList<>(); + brApiScales.add(brApiScale); + List createdScales = createScales(brApiScales); + + if (createdScales.size() == 1){ + return Optional.of(createdScales.get(0)); + } + else { + return Optional.empty(); + } + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java new file mode 100644 index 00000000..78b272ef --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -0,0 +1,173 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiOntologyReference; +import org.brapi.v2.phenotyping.model.*; +import org.junit.jupiter.api.*; + +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public class ScalesAPITests extends BrAPIClientTest { + + private ScalesAPI scalesAPI = new ScalesAPI(this.client); + private String externalReferenceID = "testId"; + private String externalReferenceSource = "testSource"; + private BrApiScale createdScale; + + // depends on this existing in test db until we can create our own + // don't have GET /ontologies yet either + private String validOntologyDbId = "ontology_attribute1"; + + @Test + public void createScaleIdPresent() { + BrApiScale brApiScale = BrApiScale.builder() + .scaleDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional scale = scalesAPI.createScale(brApiScale); + }); + } + + @Test + public void createScaleNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional scale = scalesAPI.createScale(null); + }); + } + + @Test + public void createScaleMultipleIdPresent() { + BrApiScale brApiScale = BrApiScale.builder() + .scaleDbId("test") + .build(); + BrApiScale brApiScale1 = new BrApiScale(); + List brApiScales = new ArrayList<>(); + brApiScales.add(brApiScale); + brApiScales.add(brApiScale1); + + APIException exception = assertThrows(APIException.class, () -> { + List scales = scalesAPI.createScales(brApiScales); + }); + } + + @Test + public void createScaleMultipleEmptyList() { + + List brApiScales = new ArrayList<>(); + + APIException exception = assertThrows(APIException.class, () -> { + List scales = scalesAPI.createScales(brApiScales); + }); + } + + @Test + public void createScaleMultipleNull() { + + APIException exception = assertThrows(APIException.class, () -> { + List scales = scalesAPI.createScales(null); + }); + } + + @Test + @Order(1) + @SneakyThrows + public void createScaleSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .referenceSource(externalReferenceSource) + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + + BrApiOntologyReference brApiOntologyReference = BrApiOntologyReference.builder() + .ontologyDbId(validOntologyDbId) + .ontologyName("Ontology.org") + .version("17") + .build(); + + BrApiScaleCategories low = BrApiScaleCategories.builder() + .label("low") + .value("0") + .build(); + BrApiScaleCategories high = BrApiScaleCategories.builder() + .label("high") + .value("5") + .build(); + List categories = new ArrayList<>(); + categories.add(low); + categories.add(high); + + BrApiTraitDataType dataType = BrApiTraitDataType.TEXT; + BrApiScaleValidValues validValues = BrApiScaleValidValues.builder() + .min(0) + .max(5) + .categories(categories) + .build(); + + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); + BrApiScale brApiScale = BrApiScale.builder() + .additionalInfo(additionalInfo) + .externalReferences(externalReferences) + .ontologyReference(brApiOntologyReference) + .dataType(dataType) + .decimalPlaces(2) + .scaleName("test scale") + .validValues(validValues) + .build(); + + Optional createdScale = scalesAPI.createScale(brApiScale); + + assertTrue(createdScale.isPresent()); + BrApiScale scale = createdScale.get(); + + assertFalse(scale.getScaleDbId() == null, "Scale id missing"); + scaleAssertEquals(brApiScale, scale); + + this.createdScale = scale; + } + + private void scaleAssertEquals(BrApiScale expected, BrApiScale actual) { + assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Scale additionalInfo mismatch"); + assertEquals(expected.getScaleName(), actual.getScaleName(), "Scale name mismatch"); + assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Scale ontology dbId mismatch"); + assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Scale ontology name mismatch"); + assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Scale ontology version mismatch"); + assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Scale external reference mismatch"); + assertEquals(expected.getDataType(), actual.getDataType(), "Scale data type mismatch"); + assertEquals(expected.getDecimalPlaces(), actual.getDecimalPlaces(), "Scale decimal places mismatch"); + assertEquals(expected.getValidValues(), actual.getValidValues(), "Scale valid values mismatch"); + } + + @Test + @Order(1) + @SneakyThrows + public void createScalesMultipleSuccess() { + BrApiScale brApiScale = BrApiScale.builder() + .scaleName("new test scale1") + .build(); + BrApiScale brApiScale2 = BrApiScale.builder() + .scaleName("new test scale2") + .build(); + List scales = new ArrayList<>(); + scales.add(brApiScale); + scales.add(brApiScale2); + + List createdScales = scalesAPI.createScales(scales); + + assertEquals(true, createdScales.size() == 2); + assertEquals(true, createdScales.get(0).getScaleDbId() != null, "Scale id missing"); + assertEquals(true, createdScales.get(1).getScaleDbId() != null, "Scale id missing"); + + assertEquals(brApiScale.getScaleName(), createdScales.get(0).getScaleName(), "Scale name mismatch"); + assertEquals(brApiScale2.getScaleName(), createdScales.get(1).getScaleName(), "Scale name mismatch"); + } +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java new file mode 100644 index 00000000..43f8a830 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java @@ -0,0 +1,45 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.phenotyping.model.BrApiScale; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class ScalesAPIUnitTests { + + ScalesAPI scalesAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + scalesAPI = new ScalesAPI(brAPIClient); + } + + @Test + @SneakyThrows + void createScalesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiScale = scalesAPI.createScale(new BrApiScale()); + + assertEquals(false, brApiScale.isPresent(), "Empty optional was not returned."); + } + + + +} diff --git a/brapi-pheno-model/pom.xml b/brapi-pheno-model/pom.xml index 6c422ffc..d4842e3c 100644 --- a/brapi-pheno-model/pom.xml +++ b/brapi-pheno-model/pom.xml @@ -28,5 +28,11 @@ validation-api ${javax.validation.version} + + com.google.code.gson + gson + 2.8.6 + compile + diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java index 5c00de97..3f6d246a 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java @@ -7,7 +7,9 @@ import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; +import javax.validation.Valid; import java.util.List; +import java.util.Map; /** * Scale @@ -19,6 +21,10 @@ public class BrApiScale { @JsonProperty("scaleDbId") private String scaleDbId; + @JsonProperty("additionalInfo") + @Valid + private Map additionalInfo; + @JsonProperty("dataType") private BrApiTraitDataType dataType; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java index 92ea6f82..e54dd2a5 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java @@ -2,18 +2,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.google.gson.annotations.SerializedName; /** *

Class of the scale, entries can be

\"Code\" - This scale class is exceptionally used to express complex traits. Code is a nominal scale that combines the expressions of the different traits composing the complex trait. For example a severity trait might be expressed by a 2 digit and 2 character code. The first 2 digits are the percentage of the plant covered by a fungus and the 2 characters refer to the delay in development, e.g. \"75VD\" means \"75 %\" of the plant is infected and the plant is very delayed.

\"Date\" - The date class is for events expressed in a time format, See ISO 8601

\"Duration\" - The Duration class is for time elapsed between two events expressed in a time format, e.g. days, hours, months

\"Nominal\" - Categorical scale that can take one of a limited and fixed number of categories. There is no intrinsic ordering to the categories

\"Numerical\" - Numerical scales express the trait with real numbers. The numerical scale defines the unit e.g. centimeter, ton per hectare, branches

\"Ordinal\" - Ordinal scales are scales composed of ordered categories

\"Text\" - A free text is used to express the trait.

*/ public enum BrApiTraitDataType { + @SerializedName("Code") CODE("Code"), - DATE("Date"), - DURATION("Duration"), - NOMINAL("Nominal"), - NUMERICAL("Numerical"), - ORDINAL("Ordinal"), - TEXT("Text"); + @SerializedName("Date") + DATE("Date"), + @SerializedName("Duration") + DURATION("Duration"), + @SerializedName("Nominal") + NOMINAL("Nominal"), + @SerializedName("Numerical") + NUMERICAL("Numerical"), + @SerializedName("Ordinal") + ORDINAL("Ordinal"), + @SerializedName("Text") + TEXT("Text"); private String value; @@ -21,6 +29,11 @@ public enum BrApiTraitDataType { this.value = value; } + @JsonValue + public String getValue() { + return value; + } + @Override @JsonValue public String toString() { @@ -36,4 +49,5 @@ public static BrApiTraitDataType fromValue(String text) { } return null; } + } From ce798215f2b5f9722bf734691d0cf6b7c8bde88e Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 10:33:41 -0400 Subject: [PATCH 36/71] Added get scales api and tests --- .../v2/modules/phenotype/ScalesAPI.java | 30 +++++++++++++++++ .../v2/modules/phenotype/ScalesAPITests.java | 25 +++++++++++++++ .../modules/phenotype/ScalesAPIUnitTests.java | 10 ++++++ .../model/request/ScalesRequest.java | 32 +++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ScalesRequest.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java index 2a99f69b..54343fc2 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -9,6 +9,7 @@ import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.v2.core.model.response.DataResponse; import org.brapi.v2.phenotyping.model.BrApiScale; +import org.brapi.v2.phenotyping.model.request.ScalesRequest; import java.lang.reflect.Type; import java.util.ArrayList; @@ -71,4 +72,33 @@ public Optional createScale(BrApiScale brApiScale) throws HttpExcept } } + public List getScales(ScalesRequest scalesRequest) throws HttpException, APIException { + + if (scalesRequest == null) { + throw new IllegalArgumentException("Scales request cannot be null"); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(scalesRequest.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getScales() throws HttpException, APIException { + return getScales(new ScalesRequest()); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java index 78b272ef..d275a57e 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -6,6 +6,7 @@ import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.*; +import org.brapi.v2.phenotyping.model.request.ScalesRequest; import org.junit.jupiter.api.*; import java.util.*; @@ -170,4 +171,28 @@ public void createScalesMultipleSuccess() { assertEquals(brApiScale.getScaleName(), createdScales.get(0).getScaleName(), "Scale name mismatch"); assertEquals(brApiScale2.getScaleName(), createdScales.get(1).getScaleName(), "Scale name mismatch"); } + + @Test + @SneakyThrows + @Order(2) + void getScalesSuccess() { + List scales = scalesAPI.getScales(); + + assertEquals(true, !scales.isEmpty(), "List of scales was empty"); + } + + @Test + @SneakyThrows + @Order(2) + void getScalesPageFilter() { + ScalesRequest baseRequest = ScalesRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List scales = scalesAPI.getScales(baseRequest); + + assertEquals(true, scales.size() == 1, "More than one scale was returned"); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java index 43f8a830..30358e27 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java @@ -11,6 +11,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import java.util.List; import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -40,6 +41,15 @@ void createScalesEmptyBody() { assertEquals(false, brApiScale.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void getScalesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiScales = scalesAPI.getScales(); + + assertEquals(0, brApiScales.size(), "List size is greater than 0"); + } } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ScalesRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ScalesRequest.java new file mode 100644 index 00000000..cf6e32a4 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ScalesRequest.java @@ -0,0 +1,32 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class ScalesRequest extends ObservationVariablesRequest { + private String scaleDbId; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (scaleDbId != null) params.put("scaleDbId", scaleDbId); + + return params; + + } +} From 9d7011a79d5cf8b1e01ff01997a8f5748e9863ca Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 10:49:56 -0400 Subject: [PATCH 37/71] Added get specific scale api and tests --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 ++ .../v2/modules/phenotype/ScalesAPI.java | 22 ++++++++ .../v2/modules/phenotype/ScalesAPITests.java | 54 +++++++++++++++++++ .../modules/phenotype/ScalesAPIUnitTests.java | 10 ++++ 4 files changed, 90 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 7bcd8503..73c3d915 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -24,4 +24,8 @@ public static String getScalesPath() { return getRootPath() + "/scales"; } + public static String getScalesByIdPath(String scaleId) { + return getScalesPath() + "/" + scaleId; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java index 54343fc2..a3fd2c65 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -101,4 +101,26 @@ public List getScales() throws HttpException, APIException { return getScales(new ScalesRequest()); } + public Optional getScaleById(String scaleId) throws HttpException, APIException { + + if (scaleId == null) { + throw new APIException("Must specify scaleId for the getScaleById endpoint."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesByIdPath(scaleId); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiScale resultResponse = gson.fromJson(resultJson, BrApiScale.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java index d275a57e..6ce9a71d 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -3,6 +3,7 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.*; @@ -195,4 +196,57 @@ void getScalesPageFilter() { assertEquals(true, scales.size() == 1, "More than one scale was returned"); } + @Test + @SneakyThrows + @Order(2) + void getScalesByExternalReferenceIdSuccess() { + ScalesRequest scalesRequest = ScalesRequest.builder() + .externalReferenceID(externalReferenceID) + .build(); + + List scales = scalesAPI.getScales(scalesRequest); + + assertEquals(true, scales.size() > 0, "List of scales was empty"); + } + + @Test + @SneakyThrows + @Order(2) + void getScalesByExternalReferenceSourceSuccess() { + ScalesRequest scalesRequest = ScalesRequest.builder() + .externalReferenceSource(externalReferenceSource) + .build(); + + List scales = scalesAPI.getScales(scalesRequest); + + assertEquals(true, scales.size() > 0, "List of scales was empty"); + } + + @Test + public void getScaleByIdMissingId() { + APIException exception = assertThrows(APIException.class, () -> { + Optional scale = scalesAPI.getScaleById(null); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getScaleByIdSuccess() { + Optional optionalBrApiScale = scalesAPI.getScaleById(createdScale.getScaleDbId()); + + assertEquals(true, optionalBrApiScale.isPresent(), "An empty optional was returned"); + BrApiScale scale = optionalBrApiScale.get(); + assertEquals(true, scale.getScaleDbId() != null, "ScaleDbId was not parsed properly."); + scaleAssertEquals(createdScale, scale); + } + + @Test + @SneakyThrows + void getScaleByIdInvalid() { + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional scale = scalesAPI.getScaleById("badScaleId"); + }); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java index 30358e27..3ce2007c 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java @@ -51,5 +51,15 @@ void getScalesEmptyBody() { assertEquals(0, brApiScales.size(), "List size is greater than 0"); } + @Test + @SneakyThrows + void getScalesByIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiScale = scalesAPI.getScaleById("test"); + + assertEquals(false, brApiScale.isPresent(), "Empty optional was not returned."); + } + } From 6c1ba9498a6901e6c54be946b138ce75d6e1fd21 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 11:30:29 -0400 Subject: [PATCH 38/71] Added update scale api and tests --- .../v2/modules/phenotype/ScalesAPI.java | 27 ++++++++++++++ .../v2/modules/phenotype/ScalesAPITests.java | 35 +++++++++++++++++++ .../modules/phenotype/ScalesAPIUnitTests.java | 15 ++++++++ 3 files changed, 77 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java index a3fd2c65..d7fecc0c 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -72,6 +72,33 @@ public Optional createScale(BrApiScale brApiScale) throws HttpExcept } } + public Optional updateScale(BrApiScale brApiScale) throws HttpException, APIException { + + if (brApiScale == null) { + throw new APIException("BrAPI scale cannot be null"); + } + + if (brApiScale.getScaleDbId() == null){ + throw new APIException("BrAPI scale must have an existing scaleDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesByIdPath(brApiScale.getScaleDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiScale) + .method(HttpMethod.PUT) + .build(); + + Optional updateScale = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiScale resultResponse = gson.fromJson(resultJson, BrApiScale.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updateScale; + } + public List getScales(ScalesRequest scalesRequest) throws HttpException, APIException { if (scalesRequest == null) { diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java index 6ce9a71d..2a26dc25 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -249,4 +249,39 @@ void getScaleByIdInvalid() { }); } + @Test + @SneakyThrows + @Order(2) + public void updateScaleSuccess() { + BrApiScale scale = this.createdScale; + scale.setScaleName("updated_name"); + + // Check that it is a success and all data matches + Optional updatedScaleResult = this.scalesAPI.updateScale(scale); + + assertEquals(true, updatedScaleResult.isPresent(), "Scale was not returned"); + BrApiScale updatedScale = updatedScaleResult.get(); + scaleAssertEquals(scale, updatedScale); + } + + @Test + @SneakyThrows + public void updateScaleMissingId() { + // Check that it throws an APIException + BrApiScale brApiScale = BrApiScale.builder() + .scaleName("new test scale") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedScaleResult = this.scalesAPI.updateScale(brApiScale); + }); + } + + @Test + public void updateScaleNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional scale = this.scalesAPI.updateScale(null); + }); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java index 3ce2007c..ce605a9a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java @@ -41,6 +41,21 @@ void createScalesEmptyBody() { assertEquals(false, brApiScale.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void updateScalesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + + BrApiScale scale = BrApiScale.builder() + .scaleDbId("test") + .build(); + + Optional brApiScale = scalesAPI.updateScale(scale); + + assertEquals(false, brApiScale.isPresent(), "Empty optional was not returned."); + } + @Test @SneakyThrows void getScalesEmptyBody() { From c16ec5386d4d5ef57eb2e6e5be212e41bdecd0c7 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 11:49:10 -0400 Subject: [PATCH 39/71] Removed getMethodByExternalReferenceId --- .../v2/modules/phenotype/MethodsAPI.java | 21 --------- .../v2/modules/phenotype/MethodsAPITests.java | 43 ++++++++----------- .../phenotype/MethodsAPIUnitTests.java | 12 ------ 3 files changed, 17 insertions(+), 59 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index b2293af5..5579b3f5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -150,25 +150,4 @@ public Optional getMethodById(String methodId) throws HttpException return searchResult; } - // returns first result if there are multiple matches - public Optional getMethodByExternalReferenceId(String externalReferenceId) throws HttpException, APIException { - - if (externalReferenceId == null) { - throw new APIException("Must specify externalReferenceId for the getMethodByExternalReferenceId endpoint."); - } - - MethodsRequest methodsRequest = MethodsRequest.builder() - .externalReferenceID(externalReferenceId) - .build(); - - List searchResult = getMethods(methodsRequest); - - if (searchResult.isEmpty()) { - return Optional.empty(); - } - - return Optional.of(searchResult.get(0)); - } - - } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 4a5998c6..26c9f3fa 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -155,6 +155,13 @@ public void createMethodsMultipleSuccess() { assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); } + @Test + public void getMethodsNull() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + List methods = this.methodsAPI.getMethods(null); + }); + } + @Test @SneakyThrows @Order(2) @@ -205,16 +212,20 @@ void getMethodsByExternalReferenceSourceSuccess() { } @Test - public void getMethodByIdMissingId() { - APIException exception = assertThrows(APIException.class, () -> { - Optional method = methodsAPI.getMethodById(null); - }); + @SneakyThrows + void getMethodByExternalReferenceIdInvalid() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceSource("badExternalReferenceId") + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + assertEquals(true, methods.isEmpty(), "A method was found that shouldn't have been"); } @Test - public void getMethodByExternalReferenceIdMissingId() { + public void getMethodByIdMissingId() { APIException exception = assertThrows(APIException.class, () -> { - Optional method = methodsAPI.getMethodByExternalReferenceId(null); + Optional method = methodsAPI.getMethodById(null); }); } @@ -238,26 +249,6 @@ void getMethodByIdInvalid() { }); } - @Test - @SneakyThrows - @Order(2) - void getMethodByExternalReferenceIdSuccess() { - - Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId(externalReferenceID); - - assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); - BrApiMethod method = optionalBrApiMethod.get(); - assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); - methodAssertEquals(createdMethod, method); - } - - @Test - @SneakyThrows - void getMethodByExternalReferenceIdInvalid() { - Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId("badExternalReferenceId"); - assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); - } - @Test @SneakyThrows @Order(2) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 69a1a5a7..4823ae5e 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -76,16 +76,4 @@ void getMethodsByIdEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } - @Test - @SneakyThrows - void getMethodsByExternalReferenceIdEmptyBody() { - when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) - .thenReturn(Optional.empty()); - Optional brApiMethod = methodsAPI.getMethodByExternalReferenceId("test"); - - assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); - } - - - } From ad642088b82ac169dd1c1eb50d3217d738a98681 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 12:02:21 -0400 Subject: [PATCH 40/71] Added lombok @NonNull annotations and updated tests --- brapi-client/lombok.config | 2 ++ .../v2/modules/phenotype/MethodsAPI.java | 31 ++++--------------- .../v2/modules/phenotype/MethodsAPITests.java | 8 ++--- 3 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 brapi-client/lombok.config diff --git a/brapi-client/lombok.config b/brapi-client/lombok.config new file mode 100644 index 00000000..f5e94db5 --- /dev/null +++ b/brapi-client/lombok.config @@ -0,0 +1,2 @@ +lombok.nonNull.exceptionType = IllegalArgumentException +lombok.nonNull.flagUsage = [warning | error] \ No newline at end of file diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 5579b3f5..199dedd7 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -1,6 +1,7 @@ package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; +import lombok.NonNull; import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.BrAPIEndpoint; import org.brapi.client.v2.model.BrAPIRequest; @@ -22,11 +23,7 @@ public MethodsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List createMethods(List brApiMethods) throws HttpException, APIException { - - if (brApiMethods == null) { - throw new APIException("BrAPI methods cannot be null"); - } + public List createMethods(@NonNull List brApiMethods) throws HttpException, APIException { if (brApiMethods.isEmpty()) { throw new APIException("BrAPI methods cannot be empty"); @@ -54,11 +51,7 @@ public List createMethods(List brApiMethods) throws Ht return createdMethod; } - public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { - - if (brApiMethod == null) { - throw new APIException("BrAPI method cannot be null"); - } + public Optional createMethod(@NonNull BrApiMethod brApiMethod) throws HttpException, APIException { List brApiMethods = new ArrayList<>(); brApiMethods.add(brApiMethod); @@ -72,11 +65,7 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } - public Optional updateMethod(BrApiMethod brApiMethod) throws HttpException, APIException { - - if (brApiMethod == null) { - throw new APIException("BrAPI method cannot be null"); - } + public Optional updateMethod(@NonNull BrApiMethod brApiMethod) throws HttpException, APIException { if (brApiMethod.getMethodDbId() == null){ throw new APIException("BrAPI method must have an existing methodDbId."); @@ -99,11 +88,7 @@ public Optional updateMethod(BrApiMethod brApiMethod) throws HttpEx return updateMethod; } - public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { - - if (methodsRequest == null) { - throw new IllegalArgumentException("Methods request cannot be null"); - } + public List getMethods(@NonNull MethodsRequest methodsRequest) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); @@ -128,11 +113,7 @@ public List getMethods() throws HttpException, APIException { return getMethods(new MethodsRequest()); } - public Optional getMethodById(String methodId) throws HttpException, APIException { - - if (methodId == null) { - throw new APIException("Must specify methodId for the getMethodById endpoint."); - } + public Optional getMethodById(@NonNull String methodId) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(methodId); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 26c9f3fa..74966207 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -39,7 +39,7 @@ public void createMethodIdPresent() { @Test public void createMethodNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = methodsAPI.createMethod(null); }); } @@ -72,7 +72,7 @@ public void createMethodMultipleEmptyList() { @Test public void createMethodMultipleNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { List methods = methodsAPI.createMethods(null); }); } @@ -224,7 +224,7 @@ void getMethodByExternalReferenceIdInvalid() { @Test public void getMethodByIdMissingId() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = methodsAPI.getMethodById(null); }); } @@ -280,7 +280,7 @@ public void updateMethodMissingId() { @Test public void updateMethodNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = this.methodsAPI.updateMethod(null); }); } From 423a84975ef04332a9cb4d1ec9bfb9d46bed3c67 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 13:20:01 -0400 Subject: [PATCH 41/71] Changed scale api to use @NonNull annotations --- .../v2/modules/phenotype/ScalesAPI.java | 31 ++++--------------- .../v2/modules/phenotype/ScalesAPITests.java | 8 ++--- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java index d7fecc0c..2cc1c6a9 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -1,6 +1,7 @@ package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; +import lombok.NonNull; import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.BrAPIEndpoint; import org.brapi.client.v2.model.BrAPIRequest; @@ -22,11 +23,7 @@ public ScalesAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List createScales(List brApiScales) throws HttpException, APIException { - - if (brApiScales == null) { - throw new APIException("BrAPI scales cannot be null"); - } + public List createScales(@NonNull List brApiScales) throws HttpException, APIException { if (brApiScales.isEmpty()) { throw new APIException("BrAPI scales cannot be empty"); @@ -54,11 +51,7 @@ public List createScales(List brApiScales) throws HttpEx return createdScale; } - public Optional createScale(BrApiScale brApiScale) throws HttpException, APIException { - - if (brApiScale == null) { - throw new APIException("BrAPI scale cannot be null"); - } + public Optional createScale(@NonNull BrApiScale brApiScale) throws HttpException, APIException { List brApiScales = new ArrayList<>(); brApiScales.add(brApiScale); @@ -72,11 +65,7 @@ public Optional createScale(BrApiScale brApiScale) throws HttpExcept } } - public Optional updateScale(BrApiScale brApiScale) throws HttpException, APIException { - - if (brApiScale == null) { - throw new APIException("BrAPI scale cannot be null"); - } + public Optional updateScale(@NonNull BrApiScale brApiScale) throws HttpException, APIException { if (brApiScale.getScaleDbId() == null){ throw new APIException("BrAPI scale must have an existing scaleDbId."); @@ -99,11 +88,7 @@ public Optional updateScale(BrApiScale brApiScale) throws HttpExcept return updateScale; } - public List getScales(ScalesRequest scalesRequest) throws HttpException, APIException { - - if (scalesRequest == null) { - throw new IllegalArgumentException("Scales request cannot be null"); - } + public List getScales(@NonNull ScalesRequest scalesRequest) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesPath(); @@ -128,11 +113,7 @@ public List getScales() throws HttpException, APIException { return getScales(new ScalesRequest()); } - public Optional getScaleById(String scaleId) throws HttpException, APIException { - - if (scaleId == null) { - throw new APIException("Must specify scaleId for the getScaleById endpoint."); - } + public Optional getScaleById(@NonNull String scaleId) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getScalesByIdPath(scaleId); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java index 2a26dc25..6741303b 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -40,7 +40,7 @@ public void createScaleIdPresent() { @Test public void createScaleNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional scale = scalesAPI.createScale(null); }); } @@ -73,7 +73,7 @@ public void createScaleMultipleEmptyList() { @Test public void createScaleMultipleNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { List scales = scalesAPI.createScales(null); }); } @@ -224,7 +224,7 @@ void getScalesByExternalReferenceSourceSuccess() { @Test public void getScaleByIdMissingId() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional scale = scalesAPI.getScaleById(null); }); } @@ -279,7 +279,7 @@ public void updateScaleMissingId() { @Test public void updateScaleNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional scale = this.scalesAPI.updateScale(null); }); } From d1a5f0025db57282fec2bbd0bb5ff36c5659a3e0 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 12:20:43 -0400 Subject: [PATCH 42/71] Added create method --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 ++ .../v2/modules/phenotype/MethodsAPI.java | 61 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 9790fb43..e162fe2d 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -12,4 +12,8 @@ public static String getTraitsByIdPath(String traitId) { return String.format(getRootPath() + "/traits/%s", traitId); } + public static String getMethodsPath() { + return getRootPath() + "/methods"; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java new file mode 100644 index 00000000..0ae87ae9 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -0,0 +1,61 @@ +package org.brapi.client.v2.modules.phenotype; + +import com.google.gson.reflect.TypeToken; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiMethod; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class MethodsAPI extends BrAPIEndpoint { + + public MethodsAPI(BrAPIClient brAPIClient) { + super(brAPIClient); + } + + public List createMethods(List brApiMethods) throws HttpException, APIException { + + if (brApiMethods.stream().anyMatch(trait -> trait.getMethodDbId() != null)) { + throw new APIException("BrAPI method must not have an existing methodDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiMethods) + .method(HttpMethod.POST) + .build(); + + List createdMethod = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdMethod; + } + + public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + List brApiMethods = new ArrayList<>(); + brApiMethods.add(brApiMethod); + List createdMethods = createMethods(brApiMethods); + + if (createdMethods.size() == 1){ + return Optional.of(createdMethods.get(0)); + } + else { + return Optional.empty(); + } + } + +} From f99aa6bd556c65a400482d246af2498bb1370f5e Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 15:03:17 -0400 Subject: [PATCH 43/71] Added create method tests --- .../v2/modules/phenotype/MethodsAPITests.java | 121 ++++++++++++++++++ .../phenotype/MethodsAPIUnitTests.java | 42 ++++++ 2 files changed, 163 insertions(+) create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java new file mode 100644 index 00000000..2c3969b9 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -0,0 +1,121 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiOntologyReference; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.junit.jupiter.api.*; + +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class MethodsAPITests extends BrAPIClientTest { + + private MethodsAPI methodsAPI = new MethodsAPI(this.client); + private String externalReferenceID = "test"; + // depends on this existing in test db until we can create our own + // don't have GET /ontologies yet either + private String validOntologyDbId = "ontology_attribute1"; + + @Test + public void createMethodIdPresent() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional method = this.methodsAPI.createMethod(brApiMethod); + }); + } + + @Test + public void createMethodMultipleIdPresent() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodDbId("test") + .build(); + BrApiMethod brApiMethod1 = new BrApiMethod(); + List brApiMethods = new ArrayList<>(); + brApiMethods.add(brApiMethod); + brApiMethods.add(brApiMethod1); + + APIException exception = assertThrows(APIException.class, () -> { + List methods = this.methodsAPI.createMethods(brApiMethods); + }); + } + + @Test + @SneakyThrows + public void createMethodSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .referenceSource("test") + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + + BrApiOntologyReference brApiOntologyReference = BrApiOntologyReference.builder() + .ontologyDbId(validOntologyDbId) + .ontologyName("Ontology.org") + .version("17") + .build(); + + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); + BrApiMethod brApiMethod = BrApiMethod.builder() + .additionalInfo(additionalInfo) + .externalReferences(externalReferences) + .ontologyReference(brApiOntologyReference) + .bibliographicalReference("test bib") + .description("test method description") + .formula("test = test + 1") + .methodClass("test class") + .methodName("new test method") + .build(); + + Optional createdMethod = this.methodsAPI.createMethod(brApiMethod); + + assertTrue(createdMethod.isPresent()); + BrApiMethod method = createdMethod.get(); + + assertFalse(method.getMethodDbId() == null, "Method id missing"); + methodAssertEquals(brApiMethod, method); + } + + private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { + assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Method additionalInfo mismatch"); + assertEquals(expected.getMethodName(), actual.getMethodName(), "Method name mismatch"); + assertEquals(expected.getBibliographicalReference(), actual.getBibliographicalReference(), "Method bibliographical mismatch"); + assertEquals(expected.getOntologyReference(), actual.getOntologyReference(), "Method ontology reference mismatch"); + assertEquals(expected.getDescription(), actual.getDescription(), "Method description mismatch"); + assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Method external reference mismatch"); + assertEquals(expected.getFormula(), actual.getFormula(), "Method formula mismatch"); + assertEquals(expected.getMethodClass(), actual.getMethodClass(), "Method class mismatch"); + } + + @Test + @SneakyThrows + public void createMethodsMultipleSuccess() { + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodName("new test method1") + .build(); + BrApiMethod brApiMethod2 = BrApiMethod.builder() + .methodName("new test method2") + .build(); + List methods = new ArrayList<>(); + methods.add(brApiMethod); + methods.add(brApiMethod2); + + List createdMethods = this.methodsAPI.createMethods(methods); + + assertEquals(true, createdMethods.size() == 2); + assertEquals(true, createdMethods.get(0).getMethodDbId() != null, "Method id missing"); + assertEquals(true, createdMethods.get(1).getMethodDbId() != null, "Method id missing"); + + assertEquals(brApiMethod.getMethodName(), createdMethods.get(0).getMethodName(), "Method name mismatch"); + assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java new file mode 100644 index 00000000..b1ca8c69 --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -0,0 +1,42 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class MethodsAPIUnitTests { + + MethodsAPI methodsAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + methodsAPI = new MethodsAPI(brAPIClient); + } + + @Test + @SneakyThrows + void createTraitsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.createMethod(new BrApiMethod()); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } +} From e46b55e41bbb3df2978ea4cbe1a1c4c21ca16d10 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 11 May 2020 15:49:55 -0400 Subject: [PATCH 44/71] Updated some missed names --- .../java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java | 2 +- .../brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 0ae87ae9..d70ca8a3 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -23,7 +23,7 @@ public MethodsAPI(BrAPIClient brAPIClient) { public List createMethods(List brApiMethods) throws HttpException, APIException { - if (brApiMethods.stream().anyMatch(trait -> trait.getMethodDbId() != null)) { + if (brApiMethods.stream().anyMatch(method -> method.getMethodDbId() != null)) { throw new APIException("BrAPI method must not have an existing methodDbId."); } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index b1ca8c69..fce6325a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -32,7 +32,7 @@ public void setUp() { @Test @SneakyThrows - void createTraitsEmptyBody() { + void createMethodsEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); Optional brApiMethod = methodsAPI.createMethod(new BrApiMethod()); From 24e5271dfe098b18716e0f2b0477d6d49f2db673 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 13 May 2020 11:50:30 -0400 Subject: [PATCH 45/71] Added get methods api and tests --- .../v2/modules/phenotype/MethodsAPI.java | 30 +++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 64 +++++++++++++++++-- .../phenotype/MethodsAPIUnitTests.java | 11 ++++ .../v2/modules/phenotype/TraitsAPITests.java | 2 - .../model/request/MethodsRequest.java | 33 ++++++++++ .../request/ObservationVariablesRequest.java | 39 +++++++++++ .../model/request/TraitsRequest.java | 9 +-- 7 files changed, 172 insertions(+), 16 deletions(-) create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index d70ca8a3..50fe7725 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -9,6 +9,7 @@ import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.v2.core.model.response.DataResponse; import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.request.MethodsRequest; import java.lang.reflect.Type; import java.util.ArrayList; @@ -58,4 +59,33 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } + public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { + + if (methodsRequest == null) { + throw new IllegalArgumentException("Methods request cannot be null"); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(methodsRequest.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getMethods() throws HttpException, APIException { + return getMethods(new MethodsRequest()); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 2c3969b9..eb0370a0 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -6,6 +6,7 @@ import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.request.MethodsRequest; import org.junit.jupiter.api.*; import java.util.*; @@ -13,10 +14,12 @@ import static org.junit.jupiter.api.Assertions.*; @TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class MethodsAPITests extends BrAPIClientTest { private MethodsAPI methodsAPI = new MethodsAPI(this.client); - private String externalReferenceID = "test"; + private String externalReferenceID = "testId"; + private String externalReferenceSource = "testSource"; // depends on this existing in test db until we can create our own // don't have GET /ontologies yet either private String validOntologyDbId = "ontology_attribute1"; @@ -27,7 +30,7 @@ public void createMethodIdPresent() { .methodDbId("test") .build(); APIException exception = assertThrows(APIException.class, () -> { - Optional method = this.methodsAPI.createMethod(brApiMethod); + Optional method = methodsAPI.createMethod(brApiMethod); }); } @@ -42,16 +45,17 @@ public void createMethodMultipleIdPresent() { brApiMethods.add(brApiMethod1); APIException exception = assertThrows(APIException.class, () -> { - List methods = this.methodsAPI.createMethods(brApiMethods); + List methods = methodsAPI.createMethods(brApiMethods); }); } @Test + @Order(1) @SneakyThrows public void createMethodSuccess() { BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() .referenceID(externalReferenceID) - .referenceSource("test") + .referenceSource(externalReferenceSource) .build(); List externalReferences = new ArrayList<>(); externalReferences.add(brApiExternalReference); @@ -75,7 +79,7 @@ public void createMethodSuccess() { .methodName("new test method") .build(); - Optional createdMethod = this.methodsAPI.createMethod(brApiMethod); + Optional createdMethod = methodsAPI.createMethod(brApiMethod); assertTrue(createdMethod.isPresent()); BrApiMethod method = createdMethod.get(); @@ -108,7 +112,7 @@ public void createMethodsMultipleSuccess() { methods.add(brApiMethod); methods.add(brApiMethod2); - List createdMethods = this.methodsAPI.createMethods(methods); + List createdMethods = methodsAPI.createMethods(methods); assertEquals(true, createdMethods.size() == 2); assertEquals(true, createdMethods.get(0).getMethodDbId() != null, "Method id missing"); @@ -118,4 +122,52 @@ public void createMethodsMultipleSuccess() { assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); } + @Test + @SneakyThrows + void getMethodsSuccess() { + List methods = methodsAPI.getMethods(); + + assertEquals(true, !methods.isEmpty(), "List of methods was empty"); + } + + @Test + @SneakyThrows + void getMethodsPageFilter() { + MethodsRequest baseRequest = MethodsRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List methods = methodsAPI.getMethods(baseRequest); + + assertEquals(true, methods.size() == 1, "More than one method was returned"); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodsByExternalReferenceIdSuccess() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceID(externalReferenceID) + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + + assertEquals(true, methods.size() > 0, "List of methods was empty"); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodsByExternalReferenceSourceSuccess() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceSource(externalReferenceSource) + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + + assertEquals(true, methods.size() > 0, "List of methods was empty"); + } + + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index fce6325a..87c39a7a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -11,6 +11,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import java.util.List; import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -39,4 +40,14 @@ void createMethodsEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } + + @Test + @SneakyThrows + void getMethodsEmtpyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiMethods = methodsAPI.getMethods(); + + assertEquals(0, brApiMethods.size(), "List size is greater than 0"); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 37d43183..f962bda8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -4,8 +4,6 @@ import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.v2.core.model.BrApiExternalReference; -import org.brapi.v2.core.model.BrApiProgram; -import org.brapi.v2.core.model.request.ProgramsRequest; import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.request.TraitsRequest; import org.junit.jupiter.api.*; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java new file mode 100644 index 00000000..731fd2d9 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/MethodsRequest.java @@ -0,0 +1,33 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class MethodsRequest extends ObservationVariablesRequest { + + private String methodDbId; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (methodDbId != null) params.put("methodDbId", methodDbId); + + return params; + + } +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java new file mode 100644 index 00000000..98d92b71 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/ObservationVariablesRequest.java @@ -0,0 +1,39 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; +import org.brapi.v2.core.model.request.BaseRequest; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class ObservationVariablesRequest extends BaseRequest { + + protected String observationVariableDbId; + protected String externalReferenceID; + protected String externalReferenceSource; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); + if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); + if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); + + return params; + + } + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java index b886c98f..6ce4ffab 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java @@ -3,7 +3,6 @@ import lombok.*; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; -import org.brapi.v2.core.model.request.BaseRequest; import java.util.HashMap; import java.util.Map; @@ -14,12 +13,9 @@ @NoArgsConstructor @AllArgsConstructor @Accessors(fluent=true) -public class TraitsRequest extends BaseRequest { +public class TraitsRequest extends ObservationVariablesRequest { private String traitDbId; - private String observationVariableDbId; - private String externalReferenceID; - private String externalReferenceSource; public Map constructParameters() { @@ -27,9 +23,6 @@ public Map constructParameters() { params.putAll(super.constructParameters()); if (traitDbId != null) params.put("traitDbId", traitDbId); - if (observationVariableDbId != null) params.put("observationVariableDbId", observationVariableDbId); - if (externalReferenceID != null) params.put("externalReferenceID", externalReferenceID); - if (externalReferenceSource != null) params.put("externalReferenceSource", externalReferenceSource); return params; From bd590969fa27f9a82b00a1c657e307bf528408f0 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 09:44:33 -0400 Subject: [PATCH 46/71] Added get specific method api and tests --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 6 +- .../v2/modules/phenotype/MethodsAPI.java | 41 ++++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 62 ++++++++++++++++++- .../phenotype/MethodsAPIUnitTests.java | 25 +++++++- 4 files changed, 131 insertions(+), 3 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index e162fe2d..bdcef4d9 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -9,11 +9,15 @@ public static String getTraitsPath() { } public static String getTraitsByIdPath(String traitId) { - return String.format(getRootPath() + "/traits/%s", traitId); + return getTraitsPath() + "/" + traitId; } public static String getMethodsPath() { return getRootPath() + "/methods"; } + public static String getMethodsByIdPath(String methodId) { + return getMethodsPath() + "/" + methodId; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 50fe7725..8ab6cbbd 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -88,4 +88,45 @@ public List getMethods() throws HttpException, APIException { return getMethods(new MethodsRequest()); } + public Optional getMethodById(String methodId) throws HttpException, APIException { + + if (methodId == null) { + throw new APIException("Must specify methodId for the getMethodById endpoint."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(methodId); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiMethod resultResponse = gson.fromJson(resultJson, BrApiMethod.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } + + // returns first result if there are multiple matches + public Optional getMethodByExternalReferenceId(String externalReferenceId) throws HttpException, APIException { + + if (externalReferenceId == null) { + throw new APIException("Must specify externalReferenceId for the getMethodByExternalReferenceId endpoint."); + } + + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceID(externalReferenceId) + .build(); + + List searchResult = getMethods(methodsRequest); + + if (searchResult.isEmpty()) { + return Optional.empty(); + } + + return Optional.of(searchResult.get(0)); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index eb0370a0..0c670860 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -3,6 +3,7 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.BrApiMethod; @@ -20,6 +21,8 @@ public class MethodsAPITests extends BrAPIClientTest { private MethodsAPI methodsAPI = new MethodsAPI(this.client); private String externalReferenceID = "testId"; private String externalReferenceSource = "testSource"; + private BrApiMethod createdMethod; + // depends on this existing in test db until we can create our own // don't have GET /ontologies yet either private String validOntologyDbId = "ontology_attribute1"; @@ -86,13 +89,17 @@ public void createMethodSuccess() { assertFalse(method.getMethodDbId() == null, "Method id missing"); methodAssertEquals(brApiMethod, method); + + this.createdMethod = method; } private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Method additionalInfo mismatch"); assertEquals(expected.getMethodName(), actual.getMethodName(), "Method name mismatch"); assertEquals(expected.getBibliographicalReference(), actual.getBibliographicalReference(), "Method bibliographical mismatch"); - assertEquals(expected.getOntologyReference(), actual.getOntologyReference(), "Method ontology reference mismatch"); + assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Method ontology dbId mismatch"); + assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Method ontology name mismatch"); + assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Method ontology version mismatch"); assertEquals(expected.getDescription(), actual.getDescription(), "Method description mismatch"); assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Method external reference mismatch"); assertEquals(expected.getFormula(), actual.getFormula(), "Method formula mismatch"); @@ -169,5 +176,58 @@ void getMethodsByExternalReferenceSourceSuccess() { assertEquals(true, methods.size() > 0, "List of methods was empty"); } + @Test + public void getMethodByIdMissingId() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.getMethodById(null); + }); + } + + @Test + public void getMethodByExternalReferenceIdMissingId() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.getMethodByExternalReferenceId(null); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodByIdSuccess() { + Optional optionalBrApiMethod = methodsAPI.getMethodById(createdMethod.getMethodDbId()); + + assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); + BrApiMethod method = optionalBrApiMethod.get(); + assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); + methodAssertEquals(createdMethod, method); + } + + @Test + @SneakyThrows + void getMethodByIdInvalid() { + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional method = methodsAPI.getMethodById("badMethodId"); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getMethodByExternalReferenceIdSuccess() { + + Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId(externalReferenceID); + + assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); + BrApiMethod method = optionalBrApiMethod.get(); + assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); + methodAssertEquals(createdMethod, method); + } + + @Test + @SneakyThrows + void getMethodByExternalReferenceIdInvalid() { + Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId("badExternalReferenceId"); + assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 87c39a7a..40e268eb 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -43,11 +43,34 @@ void createMethodsEmptyBody() { @Test @SneakyThrows - void getMethodsEmtpyBody() { + void getMethodsEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); List brApiMethods = methodsAPI.getMethods(); assertEquals(0, brApiMethods.size(), "List size is greater than 0"); } + + @Test + @SneakyThrows + void getMethodsByIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.getMethodById("test"); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + + @Test + @SneakyThrows + void getMethodsByExternalReferenceIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiMethod = methodsAPI.getMethodByExternalReferenceId("test"); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + + + } From 89ca91aedad79db72b9c1113ff457960ca449cf2 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 10:42:45 -0400 Subject: [PATCH 47/71] Added update method api and tests --- .../v2/modules/phenotype/MethodsAPI.java | 29 +++++++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 36 +++++++++++++++++++ .../phenotype/MethodsAPIUnitTests.java | 15 ++++++++ 3 files changed, 80 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 8ab6cbbd..f7dc5f41 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -59,6 +59,33 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } + public Optional updateMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + + if (brApiMethod == null) { + throw new APIException("BrAPI method cannot be null"); + } + + if (brApiMethod.getMethodDbId() == null){ + throw new APIException("BrAPI method must have an existing methodDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(brApiMethod.getMethodDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiMethod) + .method(HttpMethod.PUT) + .build(); + + Optional updateMethod = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiMethod resultResponse = gson.fromJson(resultJson, BrApiMethod.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updateMethod; + } + public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { if (methodsRequest == null) { @@ -129,4 +156,6 @@ public Optional getMethodByExternalReferenceId(String externalRefer return Optional.of(searchResult.get(0)); } + + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 0c670860..632bcd92 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -230,4 +230,40 @@ void getMethodByExternalReferenceIdInvalid() { assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); } + @Test + @SneakyThrows + @Order(2) + public void updateMethodSuccess() { + BrApiMethod method = this.createdMethod; + method.setMethodName("updated_name"); + method.setDescription("updated_description"); + + // Check that it is a success and all data matches + Optional updatedMethodResult = this.methodsAPI.updateMethod(method); + + assertEquals(true, updatedMethodResult.isPresent(), "Method was not returned"); + BrApiMethod updatedMethod = updatedMethodResult.get(); + methodAssertEquals(method, updatedMethod); + } + + @Test + @SneakyThrows + public void updateMethodMissingId() { + // Check that it throws an APIException + BrApiMethod brApiMethod = BrApiMethod.builder() + .methodName("new test method") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedMethodResult = this.methodsAPI.updateMethod(brApiMethod); + }); + } + + @Test + public void updateMethodNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = this.methodsAPI.updateMethod(null); + }); + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 40e268eb..69a1a5a7 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -41,6 +41,21 @@ void createMethodsEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void updateMethodsEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + + BrApiMethod method = BrApiMethod.builder() + .methodDbId("test") + .build(); + + Optional brApiMethod = methodsAPI.updateMethod(method); + + assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); + } + @Test @SneakyThrows void getMethodsEmptyBody() { From 4212038f20d2f1054dd54cd2f8e1d7f03c2b3da6 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 14 May 2020 11:18:01 -0400 Subject: [PATCH 48/71] Added null and empty checks for create methods --- .../v2/modules/phenotype/MethodsAPI.java | 13 ++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index f7dc5f41..b2293af5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -24,6 +24,14 @@ public MethodsAPI(BrAPIClient brAPIClient) { public List createMethods(List brApiMethods) throws HttpException, APIException { + if (brApiMethods == null) { + throw new APIException("BrAPI methods cannot be null"); + } + + if (brApiMethods.isEmpty()) { + throw new APIException("BrAPI methods cannot be empty"); + } + if (brApiMethods.stream().anyMatch(method -> method.getMethodDbId() != null)) { throw new APIException("BrAPI method must not have an existing methodDbId."); } @@ -47,6 +55,11 @@ public List createMethods(List brApiMethods) throws Ht } public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { + + if (brApiMethod == null) { + throw new APIException("BrAPI method cannot be null"); + } + List brApiMethods = new ArrayList<>(); brApiMethods.add(brApiMethod); List createdMethods = createMethods(brApiMethods); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 632bcd92..bb6a5ef8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -37,6 +37,13 @@ public void createMethodIdPresent() { }); } + @Test + public void createMethodNull() { + APIException exception = assertThrows(APIException.class, () -> { + Optional method = methodsAPI.createMethod(null); + }); + } + @Test public void createMethodMultipleIdPresent() { BrApiMethod brApiMethod = BrApiMethod.builder() @@ -52,6 +59,24 @@ public void createMethodMultipleIdPresent() { }); } + @Test + public void createMethodMultipleEmptyList() { + + List brApiMethods = new ArrayList<>(); + + APIException exception = assertThrows(APIException.class, () -> { + List methods = methodsAPI.createMethods(brApiMethods); + }); + } + + @Test + public void createMethodMultipleNull() { + + APIException exception = assertThrows(APIException.class, () -> { + List methods = methodsAPI.createMethods(null); + }); + } + @Test @Order(1) @SneakyThrows From 81a855885675e5c8b2255f9dca5aa460fd04efee Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Fri, 15 May 2020 10:05:52 -0400 Subject: [PATCH 49/71] Fixed test ordering --- .../org/brapi/client/v2/modules/phenotype/MethodsAPITests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index bb6a5ef8..4a5998c6 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -132,6 +132,7 @@ private void methodAssertEquals(BrApiMethod expected, BrApiMethod actual) { } @Test + @Order(1) @SneakyThrows public void createMethodsMultipleSuccess() { BrApiMethod brApiMethod = BrApiMethod.builder() @@ -156,6 +157,7 @@ public void createMethodsMultipleSuccess() { @Test @SneakyThrows + @Order(2) void getMethodsSuccess() { List methods = methodsAPI.getMethods(); @@ -164,6 +166,7 @@ void getMethodsSuccess() { @Test @SneakyThrows + @Order(2) void getMethodsPageFilter() { MethodsRequest baseRequest = MethodsRequest.builder() .page(0) From 46b97112ed24bee210cfc79c7aa58d77d1bf34e2 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 11:49:10 -0400 Subject: [PATCH 50/71] Removed getMethodByExternalReferenceId --- .../v2/modules/phenotype/MethodsAPI.java | 21 --------- .../v2/modules/phenotype/MethodsAPITests.java | 43 ++++++++----------- .../phenotype/MethodsAPIUnitTests.java | 12 ------ 3 files changed, 17 insertions(+), 59 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index b2293af5..5579b3f5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -150,25 +150,4 @@ public Optional getMethodById(String methodId) throws HttpException return searchResult; } - // returns first result if there are multiple matches - public Optional getMethodByExternalReferenceId(String externalReferenceId) throws HttpException, APIException { - - if (externalReferenceId == null) { - throw new APIException("Must specify externalReferenceId for the getMethodByExternalReferenceId endpoint."); - } - - MethodsRequest methodsRequest = MethodsRequest.builder() - .externalReferenceID(externalReferenceId) - .build(); - - List searchResult = getMethods(methodsRequest); - - if (searchResult.isEmpty()) { - return Optional.empty(); - } - - return Optional.of(searchResult.get(0)); - } - - } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 4a5998c6..26c9f3fa 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -155,6 +155,13 @@ public void createMethodsMultipleSuccess() { assertEquals(brApiMethod2.getMethodName(), createdMethods.get(1).getMethodName(), "Method name mismatch"); } + @Test + public void getMethodsNull() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + List methods = this.methodsAPI.getMethods(null); + }); + } + @Test @SneakyThrows @Order(2) @@ -205,16 +212,20 @@ void getMethodsByExternalReferenceSourceSuccess() { } @Test - public void getMethodByIdMissingId() { - APIException exception = assertThrows(APIException.class, () -> { - Optional method = methodsAPI.getMethodById(null); - }); + @SneakyThrows + void getMethodByExternalReferenceIdInvalid() { + MethodsRequest methodsRequest = MethodsRequest.builder() + .externalReferenceSource("badExternalReferenceId") + .build(); + + List methods = methodsAPI.getMethods(methodsRequest); + assertEquals(true, methods.isEmpty(), "A method was found that shouldn't have been"); } @Test - public void getMethodByExternalReferenceIdMissingId() { + public void getMethodByIdMissingId() { APIException exception = assertThrows(APIException.class, () -> { - Optional method = methodsAPI.getMethodByExternalReferenceId(null); + Optional method = methodsAPI.getMethodById(null); }); } @@ -238,26 +249,6 @@ void getMethodByIdInvalid() { }); } - @Test - @SneakyThrows - @Order(2) - void getMethodByExternalReferenceIdSuccess() { - - Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId(externalReferenceID); - - assertEquals(true, optionalBrApiMethod.isPresent(), "An empty optional was returned"); - BrApiMethod method = optionalBrApiMethod.get(); - assertEquals(true, method.getMethodDbId() != null, "MethodDbId was not parsed properly."); - methodAssertEquals(createdMethod, method); - } - - @Test - @SneakyThrows - void getMethodByExternalReferenceIdInvalid() { - Optional optionalBrApiMethod = methodsAPI.getMethodByExternalReferenceId("badExternalReferenceId"); - assertEquals(false, optionalBrApiMethod.isPresent(), "A present optional was returned"); - } - @Test @SneakyThrows @Order(2) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 69a1a5a7..4823ae5e 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -76,16 +76,4 @@ void getMethodsByIdEmptyBody() { assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); } - @Test - @SneakyThrows - void getMethodsByExternalReferenceIdEmptyBody() { - when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) - .thenReturn(Optional.empty()); - Optional brApiMethod = methodsAPI.getMethodByExternalReferenceId("test"); - - assertEquals(false, brApiMethod.isPresent(), "Empty optional was not returned."); - } - - - } From 0fde56d53837e25b125ed31ef5ae8a5f02b640e3 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 19 May 2020 12:02:21 -0400 Subject: [PATCH 51/71] Added lombok @NonNull annotations and updated tests --- brapi-client/lombok.config | 2 ++ .../v2/modules/phenotype/MethodsAPI.java | 31 ++++--------------- .../v2/modules/phenotype/MethodsAPITests.java | 8 ++--- 3 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 brapi-client/lombok.config diff --git a/brapi-client/lombok.config b/brapi-client/lombok.config new file mode 100644 index 00000000..f5e94db5 --- /dev/null +++ b/brapi-client/lombok.config @@ -0,0 +1,2 @@ +lombok.nonNull.exceptionType = IllegalArgumentException +lombok.nonNull.flagUsage = [warning | error] \ No newline at end of file diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 5579b3f5..199dedd7 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -1,6 +1,7 @@ package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; +import lombok.NonNull; import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.BrAPIEndpoint; import org.brapi.client.v2.model.BrAPIRequest; @@ -22,11 +23,7 @@ public MethodsAPI(BrAPIClient brAPIClient) { super(brAPIClient); } - public List createMethods(List brApiMethods) throws HttpException, APIException { - - if (brApiMethods == null) { - throw new APIException("BrAPI methods cannot be null"); - } + public List createMethods(@NonNull List brApiMethods) throws HttpException, APIException { if (brApiMethods.isEmpty()) { throw new APIException("BrAPI methods cannot be empty"); @@ -54,11 +51,7 @@ public List createMethods(List brApiMethods) throws Ht return createdMethod; } - public Optional createMethod(BrApiMethod brApiMethod) throws HttpException, APIException { - - if (brApiMethod == null) { - throw new APIException("BrAPI method cannot be null"); - } + public Optional createMethod(@NonNull BrApiMethod brApiMethod) throws HttpException, APIException { List brApiMethods = new ArrayList<>(); brApiMethods.add(brApiMethod); @@ -72,11 +65,7 @@ public Optional createMethod(BrApiMethod brApiMethod) throws HttpEx } } - public Optional updateMethod(BrApiMethod brApiMethod) throws HttpException, APIException { - - if (brApiMethod == null) { - throw new APIException("BrAPI method cannot be null"); - } + public Optional updateMethod(@NonNull BrApiMethod brApiMethod) throws HttpException, APIException { if (brApiMethod.getMethodDbId() == null){ throw new APIException("BrAPI method must have an existing methodDbId."); @@ -99,11 +88,7 @@ public Optional updateMethod(BrApiMethod brApiMethod) throws HttpEx return updateMethod; } - public List getMethods(MethodsRequest methodsRequest) throws HttpException, APIException { - - if (methodsRequest == null) { - throw new IllegalArgumentException("Methods request cannot be null"); - } + public List getMethods(@NonNull MethodsRequest methodsRequest) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsPath(); @@ -128,11 +113,7 @@ public List getMethods() throws HttpException, APIException { return getMethods(new MethodsRequest()); } - public Optional getMethodById(String methodId) throws HttpException, APIException { - - if (methodId == null) { - throw new APIException("Must specify methodId for the getMethodById endpoint."); - } + public Optional getMethodById(@NonNull String methodId) throws HttpException, APIException { // Build our request String endpoint = BrAPIPhenotypeEndpoints_V2.getMethodsByIdPath(methodId); diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 26c9f3fa..74966207 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -39,7 +39,7 @@ public void createMethodIdPresent() { @Test public void createMethodNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = methodsAPI.createMethod(null); }); } @@ -72,7 +72,7 @@ public void createMethodMultipleEmptyList() { @Test public void createMethodMultipleNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { List methods = methodsAPI.createMethods(null); }); } @@ -224,7 +224,7 @@ void getMethodByExternalReferenceIdInvalid() { @Test public void getMethodByIdMissingId() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = methodsAPI.getMethodById(null); }); } @@ -280,7 +280,7 @@ public void updateMethodMissingId() { @Test public void updateMethodNull() { - APIException exception = assertThrows(APIException.class, () -> { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { Optional method = this.methodsAPI.updateMethod(null); }); } From a6f939efb52660d792aa47a429e7ad4a8d7aeb85 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 21 May 2020 10:09:00 -0400 Subject: [PATCH 52/71] Added get variables api and tests --- .../java/org/brapi/client/v2/BrAPIClient.java | 21 +++++-- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 2 + .../v2/modules/phenotype/VariablesAPI.java | 50 ++++++++++++++++ .../modules/phenotype/VariablesAPITests.java | 58 +++++++++++++++++++ .../phenotype/VariablesAPIUnitTests.java | 44 ++++++++++++++ .../v2/phenotyping/model/BrApiVariable.java | 35 +++++------ .../model/request/VariablesRequest.java | 33 +++++++++++ 7 files changed, 222 insertions(+), 21 deletions(-) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java create mode 100644 brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java create mode 100644 brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/VariablesRequest.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index 1d6b8470..c0eab802 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -1,8 +1,6 @@ package org.brapi.client.v2; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; +import com.google.gson.*; import lombok.Getter; import lombok.experimental.Accessors; import okhttp3.*; @@ -13,6 +11,9 @@ import java.io.File; import java.io.IOException; +import java.lang.reflect.Type; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; @@ -26,7 +27,19 @@ public class BrAPIClient { public BrAPIClient(String brapiURI) { this.brapiURI = brapiURI; - this.gson = new Gson(); + this.gson = new GsonBuilder().registerTypeAdapter(OffsetDateTime.class, new JsonDeserializer() { + @Override + public OffsetDateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException { + return OffsetDateTime.parse(json.getAsString(), DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + }).registerTypeAdapter(OffsetDateTime.class, new JsonSerializer() { + @Override + public JsonElement serialize(OffsetDateTime offsetDateTime, Type typeOfT, JsonSerializationContext context) + throws JsonParseException { + return new JsonPrimitive(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(offsetDateTime)); + } + }).create(); } /** diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 73c3d915..3fb70048 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -28,4 +28,6 @@ public static String getScalesByIdPath(String scaleId) { return getScalesPath() + "/" + scaleId; } + public static String getVariablesPath() { return getRootPath() + "/variables"; } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java new file mode 100644 index 00000000..f75d741e --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -0,0 +1,50 @@ +package org.brapi.client.v2.modules.phenotype; + +import com.google.gson.reflect.TypeToken; +import lombok.NonNull; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.BrAPIEndpoint; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.client.v2.model.HttpMethod; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpException; +import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiVariable; +import org.brapi.v2.phenotyping.model.request.VariablesRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +public class VariablesAPI extends BrAPIEndpoint { + + public VariablesAPI(BrAPIClient brAPIClient) { + super(brAPIClient); + } + + public List getVariables(@NonNull VariablesRequest variablesRequest) throws HttpException, APIException { + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getVariablesPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .parameters(variablesRequest.constructParameters()) + .method(HttpMethod.GET) + .build(); + + List searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() { + }.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return searchResult; + } + + public List getVariables() throws HttpException, APIException { + return getVariables(new VariablesRequest()); + } + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java new file mode 100644 index 00000000..b0012f0d --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -0,0 +1,58 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.v2.phenotyping.model.BrApiVariable; +import org.brapi.v2.phenotyping.model.request.VariablesRequest; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class VariablesAPITests extends BrAPIClientTest { + + private VariablesAPI variablesAPI = new VariablesAPI(this.client); + private String externalReferenceID = "testId"; + private String externalReferenceSource = "testSource"; + private BrApiVariable createdVariable; + + @Test + @SneakyThrows + @Order(2) + void getVariablesSuccess() { + List variables = variablesAPI.getVariables(); + + assertEquals(true, !variables.isEmpty(), "List of variables was empty"); + } + + @Test + @SneakyThrows + @Order(2) + void getVariablesPageFilter() { + VariablesRequest baseRequest = VariablesRequest.builder() + .page(0) + .pageSize(1) + .build(); + + List scales = variablesAPI.getVariables(baseRequest); + + assertEquals(true, scales.size() == 1, "More than one variable was returned"); + } + + @Test + @SneakyThrows + @Order(2) + void getVariablesByExternalReferenceIdSuccess() { + VariablesRequest scalesRequest = VariablesRequest.builder() + .externalReferenceID(externalReferenceID) + .build(); + + List variables = variablesAPI.getVariables(scalesRequest); + + assertEquals(true, variables.size() > 0, "List of variables was empty"); + } + + +} diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java new file mode 100644 index 00000000..626a5c1f --- /dev/null +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -0,0 +1,44 @@ +package org.brapi.client.v2.modules.phenotype; + +import lombok.SneakyThrows; +import org.brapi.client.v2.BrAPIClient; +import org.brapi.client.v2.ResponseHandlerFunction; +import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.phenotyping.model.BrApiVariable; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class VariablesAPIUnitTests { + + VariablesAPI variablesAPI; + @Mock + BrAPIClient brAPIClient; + + @BeforeAll + public void setUp() { + MockitoAnnotations.initMocks(this); + variablesAPI = new VariablesAPI(brAPIClient); + } + + @Test + @SneakyThrows + void getVariablesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + List brApiScales = variablesAPI.getVariables(); + + assertEquals(0, brApiScales.size(), "List size is greater than 0"); + } + +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java index 3aa7d810..e9d24a6d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -1,6 +1,7 @@ package org.brapi.v2.phenotyping.model; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -19,58 +20,58 @@ @SuperBuilder @NoArgsConstructor public class BrApiVariable { - @JsonProperty("additionalInfo") + @SerializedName("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("commonCropName") + @SerializedName("commonCropName") private String commonCropName; - @JsonProperty("contextOfUse") + @SerializedName("contextOfUse") @Valid private List contextOfUse; - @JsonProperty("defaultValue") + @SerializedName("defaultValue") private String defaultValue; - @JsonProperty("documentationURL") + @SerializedName("documentationURL") private String documentationURL; - @JsonProperty("externalReferences") + @SerializedName("externalReferences") private List externalReferences; - @JsonProperty("growthStage") + @SerializedName("growthStage") private String growthStage; - @JsonProperty("institution") + @SerializedName("institution") private String institution; - @JsonProperty("language") + @SerializedName("language") private String language; - @JsonProperty("method") + @SerializedName("method") private BrApiMethod method; - @JsonProperty("ontologyReference") + @SerializedName("ontologyReference") private BrApiOntologyReference ontologyReference; - @JsonProperty("scale") + @SerializedName("scale") private BrApiScale scale; - @JsonProperty("scientist") + @SerializedName("scientist") private String scientist; - @JsonProperty("status") + @SerializedName("status") private String status; - @JsonProperty("submissionTimestamp") + @SerializedName("submissionTimestamp") private OffsetDateTime submissionTimestamp; - @JsonProperty("synonyms") + @SerializedName("synonyms") @Valid private List synonyms; - @JsonProperty("trait") + @SerializedName("trait") private BrApiTrait trait; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/VariablesRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/VariablesRequest.java new file mode 100644 index 00000000..e18c10a2 --- /dev/null +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/VariablesRequest.java @@ -0,0 +1,33 @@ +package org.brapi.v2.phenotyping.model.request; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.Accessors; +import lombok.experimental.SuperBuilder; + +import java.util.HashMap; +import java.util.Map; + +@Getter +@Setter +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(fluent=true) +public class VariablesRequest extends ObservationVariablesRequest { + private String traitClass; + private String studyDbId; + + public Map constructParameters() { + + Map params = new HashMap<>(); + + params.putAll(super.constructParameters()); + if (traitClass != null) params.put("traitClass", traitClass); + if (studyDbId != null) params.put("studyDbId", studyDbId); + + return params; + } +} From e75f5f2bf28c4515f1f3a4209170199aa36557e8 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Tue, 26 May 2020 17:04:24 -0400 Subject: [PATCH 53/71] Added create variables api and tests --- .../v2/modules/phenotype/VariablesAPI.java | 43 ++++ .../modules/phenotype/VariablesAPITests.java | 188 +++++++++++++++++- .../phenotype/VariablesAPIUnitTests.java | 11 + .../v2/phenotyping/model/BrApiVariable.java | 21 +- 4 files changed, 244 insertions(+), 19 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index f75d741e..1f66762b 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -15,6 +15,7 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class VariablesAPI extends BrAPIEndpoint { @@ -22,6 +23,48 @@ public VariablesAPI(BrAPIClient brAPIClient) { super(brAPIClient); } + public List createVariables(@NonNull List brApiVariables) throws HttpException, APIException { + + if (brApiVariables.isEmpty()) { + throw new APIException("BrAPI variables cannot be empty"); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getObservationVariableDbId() != null)) { + throw new APIException("BrAPI variable must not have an existing observationVariableDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getVariablesPath(); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiVariables) + .method(HttpMethod.POST) + .build(); + + List createdVariable = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + Type resultGsonType = new TypeToken>() {}.getType(); + DataResponse dataResponse = gson.fromJson(resultJson, resultGsonType); + return dataResponse.data(); + }).orElse(new ArrayList<>()); + + return createdVariable; + } + + public Optional createVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { + + List brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + List createdVariables = createVariables(brApiVariables); + + if (createdVariables.size() == 1){ + return Optional.of(createdVariables.get(0)); + } + else { + return Optional.empty(); + } + } + public List getVariables(@NonNull VariablesRequest variablesRequest) throws HttpException, APIException { // Build our request diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index b0012f0d..2d26bcd2 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -2,14 +2,22 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; +import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.v2.core.model.BrApiExternalReference; +import org.brapi.v2.core.model.BrApiOntologyReference; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.BrApiScale; +import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.BrApiVariable; import org.brapi.v2.phenotyping.model.request.VariablesRequest; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import java.util.List; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class VariablesAPITests extends BrAPIClientTest { @@ -18,6 +26,182 @@ public class VariablesAPITests extends BrAPIClientTest { private String externalReferenceSource = "testSource"; private BrApiVariable createdVariable; + // depends on this existing in test db until we can create our own + // don't have GET /ontologies yet either + private String validOntologyDbId = "ontology_attribute1"; + private String validCrop = "Tomatillo"; + + @Test + public void createVariableIdPresent() { + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional variable = variablesAPI.createVariable(brApiVariable); + }); + } + + @Test + public void createVariableNull() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + Optional variable = variablesAPI.createVariable(null); + }); + } + + @Test + public void createVariableMultipleIdPresent() { + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableDbId("test") + .build(); + BrApiVariable brApiVariable1 = new BrApiVariable(); + List brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + brApiVariables.add(brApiVariable1); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createVariables(brApiVariables); + }); + } + + @Test + public void createVariableMultipleEmptyList() { + + List brApiVariables = new ArrayList<>(); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createVariables(brApiVariables); + }); + } + + @Test + public void createVariableMultipleNull() { + + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + List variables = variablesAPI.createVariables(null); + }); + } + + @Test + @Order(1) + @SneakyThrows + public void createVariableSuccess() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() + .referenceID(externalReferenceID) + .referenceSource(externalReferenceSource) + .build(); + List externalReferences = new ArrayList<>(); + externalReferences.add(brApiExternalReference); + + BrApiOntologyReference brApiOntologyReference = BrApiOntologyReference.builder() + .ontologyDbId(validOntologyDbId) + .ontologyName("Ontology.org") + .version("17") + .build(); + + Map additionalInfo = new HashMap<>(); + additionalInfo.put("test", "test"); + + List contextOfUse = new ArrayList<>(); + contextOfUse.add("test context 1"); + contextOfUse.add("test context 2"); + + List synonyms = new ArrayList<>(); + contextOfUse.add("test synonym 1"); + contextOfUse.add("test synonym 2"); + + BrApiTrait trait = BrApiTrait.builder() + .traitName("test trait") + .build(); + + BrApiMethod method = BrApiMethod.builder() + .methodName("test method") + .build(); + + BrApiScale scale = BrApiScale.builder() + .scaleName("scale scale") + .build(); + + OffsetDateTime timestamp = OffsetDateTime.parse("2020-05-26T20:45:10Z", DateTimeFormatter.ISO_OFFSET_DATE_TIME); + + BrApiVariable brApiVariable = BrApiVariable.builder() + .additionalInfo(additionalInfo) + .commonCropName(validCrop) + .contextOfUse(contextOfUse) + .defaultValue("test default") + .documentationURL("http://www.test.com") + .externalReferences(externalReferences) + .growthStage("test stage") + .institution("test institution") + .language("test language") + .ontologyReference(brApiOntologyReference) + .scientist("test scientist") + .status("test status") + .submissionTimestamp(timestamp) + .synonyms(synonyms) + .observationVariableName("test variable") + .trait(trait) + .scale(scale) + .method(method) + .build(); + + Optional createdVariable = variablesAPI.createVariable(brApiVariable); + + assertTrue(createdVariable.isPresent()); + BrApiVariable variable = createdVariable.get(); + + assertFalse(variable.getObservationVariableDbId() == null, "Variable id missing"); + variableAssertEquals(brApiVariable, variable); + + this.createdVariable = variable; + } + + private void variableAssertEquals(BrApiVariable expected, BrApiVariable actual) { + assertEquals(expected.getAdditionalInfo(), actual.getAdditionalInfo(), "Variable additionalInfo mismatch"); + assertEquals(expected.getCommonCropName(), actual.getCommonCropName(), "Variable commonCropName mismatch"); + assertEquals(expected.getContextOfUse(), actual.getContextOfUse(), "Variable contextOfUse mismatch"); + assertEquals(expected.getDefaultValue(), actual.getDefaultValue(), "Variable defaultValue mismatch"); + assertEquals(expected.getDocumentationURL(), actual.getDocumentationURL(), "Variable documentationUrl mismatch"); + assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Scale ontology dbId mismatch"); + assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Scale ontology name mismatch"); + assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Scale ontology version mismatch"); + assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Scale external reference mismatch"); + assertEquals(expected.getGrowthStage(), actual.getGrowthStage(), "Variable growthStage mismatch"); + assertEquals(expected.getInstitution(), actual.getInstitution(), "Variable institution mismatch"); + assertEquals(expected.getLanguage(), actual.getLanguage(), "Variable language mismatch"); + assertEquals(expected.getScientist(), actual.getScientist(), "Variable scientist mismatch"); + assertEquals(expected.getStatus(), actual.getStatus(), "Variable status mismatch"); + assertEquals(expected.getSubmissionTimestamp(), actual.getSubmissionTimestamp(), "Variable submissionTimestamp mismatch"); + assertEquals(expected.getSynonyms(), actual.getSynonyms(), "Variable synonyms mismatch"); + assertEquals(expected.getObservationVariableName(), actual.getObservationVariableName(), "Variable name mismatch"); + assertEquals(expected.getTrait().getTraitName(), actual.getTrait().getTraitName(), "Variable trait mismatch"); + assertEquals(expected.getScale().getScaleName(), actual.getScale().getScaleName(), "Variable scale mismatch"); + assertEquals(expected.getMethod().getMethodName(), actual.getMethod().getMethodName(), "Variable method mismatch"); + } + + @Test + @Order(1) + @SneakyThrows + public void createVariablesMultipleSuccess() { + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableName("new test variable1") + .build(); + BrApiVariable brApiVariable2 = BrApiVariable.builder() + .observationVariableName("new test variable2") + .build(); + List variables = new ArrayList<>(); + variables.add(brApiVariable); + variables.add(brApiVariable2); + + List createdVariables = variablesAPI.createVariables(variables); + + assertEquals(true, createdVariables.size() == 2); + assertEquals(true, createdVariables.get(0).getObservationVariableDbId() != null, "Variable id missing"); + assertEquals(true, createdVariables.get(1).getObservationVariableDbId() != null, "Variable id missing"); + + assertEquals(brApiVariable.getObservationVariableName(), createdVariables.get(0).getObservationVariableName(), "Variable name mismatch"); + assertEquals(brApiVariable2.getObservationVariableName(), createdVariables.get(1).getObservationVariableName(), "Variable name mismatch"); + } + @Test @SneakyThrows @Order(2) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java index 626a5c1f..74fdbddd 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -31,6 +31,17 @@ public void setUp() { variablesAPI = new VariablesAPI(brAPIClient); } + + @Test + @SneakyThrows + void createVariablesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiVariable = variablesAPI.createVariable(new BrApiVariable()); + + assertEquals(false, brApiVariable.isPresent(), "Empty optional was not returned."); + } + @Test @SneakyThrows void getVariablesEmptyBody() { diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java index e9d24a6d..4156776d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -20,58 +20,45 @@ @SuperBuilder @NoArgsConstructor public class BrApiVariable { - @SerializedName("additionalInfo") + private String observationVariableDbId; + @Valid private Map additionalInfo; - @SerializedName("commonCropName") private String commonCropName; - @SerializedName("contextOfUse") @Valid private List contextOfUse; - @SerializedName("defaultValue") private String defaultValue; - @SerializedName("documentationURL") private String documentationURL; - @SerializedName("externalReferences") private List externalReferences; - @SerializedName("growthStage") private String growthStage; - @SerializedName("institution") private String institution; - @SerializedName("language") private String language; - @SerializedName("method") private BrApiMethod method; - @SerializedName("ontologyReference") private BrApiOntologyReference ontologyReference; - @SerializedName("scale") private BrApiScale scale; - @SerializedName("scientist") private String scientist; - @SerializedName("status") private String status; - @SerializedName("submissionTimestamp") private OffsetDateTime submissionTimestamp; - @SerializedName("synonyms") @Valid private List synonyms; - @SerializedName("trait") private BrApiTrait trait; + private String observationVariableName; + } From 43ee0adf770acceaf91a0190b591e1e09a20111b Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 27 May 2020 11:19:30 -0400 Subject: [PATCH 54/71] Added brapi enum type adapter and interface --- .../java/org/brapi/client/v2/BrAPIClient.java | 2 +- .../v2/BrApiEnumTypeAdapterFactory.java | 51 +++++++++++++++++++ .../org/brapi/v2/core/model/BrApiEnum.java | 5 ++ .../phenotyping/model/BrApiTraitDataType.java | 34 ++----------- 4 files changed, 61 insertions(+), 31 deletions(-) create mode 100644 brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java create mode 100644 brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index c0eab802..fdfea91d 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -39,7 +39,7 @@ public JsonElement serialize(OffsetDateTime offsetDateTime, Type typeOfT, JsonSe throws JsonParseException { return new JsonPrimitive(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(offsetDateTime)); } - }).create(); + }).registerTypeAdapterFactory(new BrApiEnumTypeAdapterFactory()).create(); } /** diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java b/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java new file mode 100644 index 00000000..0f175f36 --- /dev/null +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java @@ -0,0 +1,51 @@ +package org.brapi.client.v2; + +import com.google.gson.Gson; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; +import org.brapi.v2.core.model.BrApiEnum; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + + +public class BrApiEnumTypeAdapterFactory implements TypeAdapterFactory { + + public TypeAdapter create(Gson gson, TypeToken type) { + Class rawType = (Class) type.getRawType(); + if (!(rawType.isEnum() && BrApiEnum.class.isAssignableFrom(rawType))) { + return null; + } + + final Map valueToNameMap = new HashMap(); + for (T constant : rawType.getEnumConstants()) { + valueToNameMap.put(((BrApiEnum)constant).getBrapiValue(), constant); + } + + return new TypeAdapter() { + + public void write(JsonWriter out, T value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(((BrApiEnum)value).getBrapiValue()); + } + } + + public T read(JsonReader reader) throws IOException { + if (reader.peek() == JsonToken.NULL) { + reader.nextNull(); + return null; + } else { + return valueToNameMap.get(reader.nextString()); + } + } + }; + } + +} diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java new file mode 100644 index 00000000..0832258a --- /dev/null +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java @@ -0,0 +1,5 @@ +package org.brapi.v2.core.model; + +public interface BrApiEnum { + String getBrapiValue(); +} diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java index e54dd2a5..b8e4c6e7 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTraitDataType.java @@ -1,26 +1,17 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.google.gson.annotations.SerializedName; +import org.brapi.v2.core.model.BrApiEnum; /** *

Class of the scale, entries can be

\"Code\" - This scale class is exceptionally used to express complex traits. Code is a nominal scale that combines the expressions of the different traits composing the complex trait. For example a severity trait might be expressed by a 2 digit and 2 character code. The first 2 digits are the percentage of the plant covered by a fungus and the 2 characters refer to the delay in development, e.g. \"75VD\" means \"75 %\" of the plant is infected and the plant is very delayed.

\"Date\" - The date class is for events expressed in a time format, See ISO 8601

\"Duration\" - The Duration class is for time elapsed between two events expressed in a time format, e.g. days, hours, months

\"Nominal\" - Categorical scale that can take one of a limited and fixed number of categories. There is no intrinsic ordering to the categories

\"Numerical\" - Numerical scales express the trait with real numbers. The numerical scale defines the unit e.g. centimeter, ton per hectare, branches

\"Ordinal\" - Ordinal scales are scales composed of ordered categories

\"Text\" - A free text is used to express the trait.

*/ -public enum BrApiTraitDataType { - @SerializedName("Code") +public enum BrApiTraitDataType implements BrApiEnum { CODE("Code"), - @SerializedName("Date") DATE("Date"), - @SerializedName("Duration") DURATION("Duration"), - @SerializedName("Nominal") NOMINAL("Nominal"), - @SerializedName("Numerical") NUMERICAL("Numerical"), - @SerializedName("Ordinal") ORDINAL("Ordinal"), - @SerializedName("Text") TEXT("Text"); private String value; @@ -29,25 +20,8 @@ public enum BrApiTraitDataType { this.value = value; } - @JsonValue - public String getValue() { - return value; - } - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static BrApiTraitDataType fromValue(String text) { - for (BrApiTraitDataType b : BrApiTraitDataType.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; + public String getBrapiValue() { + return value; } - } From c21beb932186dcd3bfee548915e42f0c4ca6191a Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 27 May 2020 11:22:07 -0400 Subject: [PATCH 55/71] Removed @JsonProperty annotations and updated enums in core models --- .../org/brapi/v2/core/model/BrApiContact.java | 6 ----- .../brapi/v2/core/model/BrApiDataFile.java | 6 ----- .../brapi/v2/core/model/BrApiDataLink.java | 8 ------ .../core/model/BrApiDatasetAuthorships.java | 4 --- .../core/model/BrApiEnvironmentParameter.java | 7 ----- .../core/model/BrApiExperimentalDesign.java | 2 -- .../v2/core/model/BrApiExternalReference.java | 2 -- .../org/brapi/v2/core/model/BrApiGeoJSON.java | 2 -- .../v2/core/model/BrApiGrowthFacility.java | 2 -- .../brapi/v2/core/model/BrApiLastUpdate.java | 2 -- .../brapi/v2/core/model/BrApiLocation.java | 19 -------------- ...iModel202AcceptedSearchResponseResult.java | 1 - .../v2/core/model/BrApiOntologyReference.java | 4 --- ...piOntologyReferenceDocumentationLinks.java | 2 -- .../org/brapi/v2/core/model/BrApiPerson.java | 11 -------- .../v2/core/model/BrApiPointGeometry.java | 2 -- .../v2/core/model/BrApiPolygonGeometry.java | 2 -- .../org/brapi/v2/core/model/BrApiProgram.java | 10 ------- .../core/model/BrApiRequestPublications.java | 2 -- .../org/brapi/v2/core/model/BrApiSeason.java | 3 --- .../brapi/v2/core/model/BrApiServerInfo.java | 8 ------ .../org/brapi/v2/core/model/BrApiService.java | 21 +++------------ .../org/brapi/v2/core/model/BrApiStudy.java | 26 ------------------- .../org/brapi/v2/core/model/BrApiTrial.java | 16 ------------ .../v2/core/model/BrApiWSMIMEDataTypes.java | 17 +++--------- .../v2/core/model/response/DataResponse.java | 1 - 26 files changed, 6 insertions(+), 180 deletions(-) diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java index 03fac8ad..d5572817 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java @@ -18,37 +18,31 @@ public class BrApiContact { /** * The ID which uniquely identifies this contact MIAPPE V1.1 (DM-33) Person ID - An identifier for the data submitter. If that submitter is an individual, ORCID identifiers are recommended. **/ - @JsonProperty("contactDbId") @NotNull private String contactDbId; /** * The contacts email address MIAPPE V1.1 (DM-32) Person email - The electronic mail address of the person. **/ - @JsonProperty("email") private String email; /** * The name of the institution which this contact is part of MIAPPE V1.1 (DM-35) Person affiliation - The institution the person belongs to **/ - @JsonProperty("instituteName") private String instituteName; /** * The full name of this contact person MIAPPE V1.1 (DM-31) Person name - The name of the person (either full name or as used in scientific publications) **/ - @JsonProperty("name") private String name; /** * The Open Researcher and Contributor ID for this contact person (orcid.org) MIAPPE V1.1 (DM-33) Person ID - An identifier for the data submitter. If that submitter is an individual, ORCID identifiers are recommended. **/ - @JsonProperty("orcid") private String orcid; /** * The type of person this contact represents (ex: Coordinator, Scientist, PI, etc.) MIAPPE V1.1 (DM-34) Person role - Type of contribution of the person to the investigation **/ - @JsonProperty("type") private String type; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java index f6e4de6f..2064fc16 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java @@ -15,37 +15,31 @@ public class BrApiDataFile { /** * A human readable description of the file contents **/ - @JsonProperty("fileDescription") private String fileDescription; /** * The MD5 Hash of the file contents to be used as a check sum **/ - @JsonProperty("fileMD5Hash") private String fileMD5Hash; /** * The name of the file **/ - @JsonProperty("fileName") private String fileName; /** * The size of the file in bytes **/ - @JsonProperty("fileSize") private Integer fileSize; /** * The type or format of the file. Preferably MIME Type. **/ - @JsonProperty("fileType") private String fileType; /** * The absolute URL where the file is located **/ - @JsonProperty("fileURL") private String fileURL; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java index e3f35dc1..227bea26 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java @@ -15,48 +15,40 @@ public class BrApiDataLink { /** * The structure of the data within a file. For example - VCF, table, image archive, multispectral image archives in EDAM ontology (used in Galaxy) **/ - @JsonProperty("dataFormat") private String dataFormat; /** * The general description of this data link **/ - @JsonProperty("description") private String description; /** * The MIME type of the file (ie text/csv, application/excel, application/zip). **/ - @JsonProperty("fileFormat") private String fileFormat; /** * The name of the external data link MIAPPE V1.1 (DM-38) Data file description - Description of the format of the data file. May be a standard file format name, or a description of organization of the data in a tabular file. **/ - @JsonProperty("name") private String name; /** * The description of the origin or ownership of this linked data. Could be a formal reference to software, method, or workflow. **/ - @JsonProperty("provenance") private String provenance; /** * The general type of data. For example- Genotyping, Phenotyping raw data, Phenotyping reduced data, Environmental, etc **/ - @JsonProperty("scientificType") private String scientificType; /** * MIAPPE V1.1 (DM-37) Data file link - Link to the data file (or digital object) in a public database or in a persistent institutional repository; or identifier of the data file when submitted together with the MIAPPE submission. **/ - @JsonProperty("url") private String url; /** * MIAPPE V1.1 (DM-39) Data file version - The version of the dataset (the actual data). **/ - @JsonProperty("version") private String version; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java index 10696941..aac7ceb6 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java @@ -15,16 +15,12 @@ @SuperBuilder @NoArgsConstructor public class BrApiDatasetAuthorships { - @JsonProperty("datasetPUI") private String datasetPUI; - @JsonProperty("license") private String license; - @JsonProperty("publicReleaseDate") private LocalDate publicReleaseDate; - @JsonProperty("submissionDate") private LocalDate submissionDate; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java index e97ee3fa..2fd69d7a 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java @@ -12,25 +12,18 @@ @SuperBuilder @NoArgsConstructor public class BrApiEnvironmentParameter { - @JsonProperty("description") private String description; - @JsonProperty("parameterName") private String parameterName; - @JsonProperty("parameterPUI") private String parameterPUI; - @JsonProperty("unit") private String unit; - @JsonProperty("unitPUI") private String unitPUI; - @JsonProperty("value") private String value; - @JsonProperty("valuePUI") private String valuePUI; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java index ac673b9c..871f8524 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiExperimentalDesign { - @JsonProperty("PUI") private String PUI; - @JsonProperty("description") private String description; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java index c470678c..0a042c51 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiExternalReference { - @JsonProperty("referenceID") private Object referenceID; - @JsonProperty("referenceSource") private String referenceSource; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java index e4ef0633..1ff2bd83 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiGeoJSON { - @JsonProperty("geometry") private BrApiOneOfGeoJSONGeometry geometry; - @JsonProperty("type") private String type = "Feature"; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java index 9cb07749..77b79bd5 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiGrowthFacility { - @JsonProperty("PUI") private String PUI; - @JsonProperty("description") private String description; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java index b6f9b405..5a36c6f5 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java @@ -14,10 +14,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiLastUpdate { - @JsonProperty("timestamp") private OffsetDateTime timestamp; - @JsonProperty("version") private String version; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java index 3808d2f2..42aec7b5 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java @@ -16,62 +16,43 @@ @SuperBuilder @NoArgsConstructor public class BrApiLocation { - @JsonProperty("locationDbId") private String locationDbId; - @JsonProperty("abbreviation") private String abbreviation; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("coordinateDescription") private String coordinateDescription; - @JsonProperty("coordinateUncertainty") private String coordinateUncertainty; - @JsonProperty("coordinates") private BrApiGeoJSON coordinates; - @JsonProperty("countryCode") private String countryCode; - @JsonProperty("countryName") private String countryName; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("environmentType") private String environmentType; - @JsonProperty("exposure") private String exposure; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("instituteAddress") private String instituteAddress; - @JsonProperty("instituteName") private String instituteName; - @JsonProperty("locationName") private String locationName; - @JsonProperty("locationType") private String locationType; - @JsonProperty("siteStatus") private String siteStatus; - @JsonProperty("slope") private String slope; - @JsonProperty("topography") private String topography; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java index 44e79b47..40bad675 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java @@ -12,6 +12,5 @@ @SuperBuilder @NoArgsConstructor public class BrApiModel202AcceptedSearchResponseResult { - @JsonProperty("searchResultsDbId") private String searchResultsDbId; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java index bf3b8105..046d8780 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java @@ -15,17 +15,13 @@ @SuperBuilder @NoArgsConstructor public class BrApiOntologyReference { - @JsonProperty("documentationLinks") @Valid private List documentationLinks; - @JsonProperty("ontologyDbId") private String ontologyDbId; - @JsonProperty("ontologyName") private String ontologyName; - @JsonProperty("version") private String version; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java index c1ef706d..3e44ae31 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiOntologyReferenceDocumentationLinks { - @JsonProperty("URL") private String URL; - @JsonProperty("type") private TypeEnum type; /** diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java index d41b4f25..c6b69e2a 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java @@ -16,38 +16,27 @@ @SuperBuilder @NoArgsConstructor public class BrApiPerson { - @JsonProperty("personDbId") private String personDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("description") private String description; - @JsonProperty("emailAddress") private String emailAddress; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("firstName") private String firstName; - @JsonProperty("lastName") private String lastName; - @JsonProperty("mailingAddress") private String mailingAddress; - @JsonProperty("middleName") private String middleName; - @JsonProperty("phoneNumber") private String phoneNumber; - @JsonProperty("userID") private String userID; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java index da4f050c..951f7d22 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiPointGeometry implements BrApiOneOfGeoJSONSearchAreaGeometry, BrApiOneOfGeoJSONGeometry { - @JsonProperty("coordinates") private BrApiPosition coordinates; - @JsonProperty("type") private String type = "Point"; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java index 6281fc3a..61c4ed7c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiPolygonGeometry implements BrApiOneOfGeoJSONSearchAreaGeometry, BrApiOneOfGeoJSONGeometry { - @JsonProperty("coordinates") private BrApiPolygon coordinates; - @JsonProperty("type") private String type = "Polygon"; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index aa6ee16d..e5fc24c7 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -17,37 +17,27 @@ @SuperBuilder @NoArgsConstructor public class BrApiProgram { - @JsonProperty("programDbId") private String programDbId; - @JsonProperty("abbreviation") private String abbreviation; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("commonCropName") @NotNull private String commonCropName; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("externalReferences") @Valid private List externalReferences; - @JsonProperty("leadPersonDbId") private String leadPersonDbId; - @JsonProperty("leadPersonName") private String leadPersonName; - @JsonProperty("objective") private String objective; - @JsonProperty("programName") @NotNull private String programName; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java index 605cc243..f5f8f77a 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java @@ -12,9 +12,7 @@ @SuperBuilder @NoArgsConstructor public class BrApiRequestPublications { - @JsonProperty("publicationPUI") private String publicationPUI; - @JsonProperty("publicationReference") private String publicationReference; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java index dd954ee4..8a914ff0 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java @@ -14,14 +14,11 @@ @SuperBuilder @NoArgsConstructor public class BrApiSeason { - @JsonProperty("season") private String season; - @JsonProperty("seasonDbId") @NotNull private String seasonDbId; - @JsonProperty("year") private Integer year; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java index 6b5ede0b..ea71d5d7 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java @@ -16,29 +16,21 @@ @SuperBuilder @NoArgsConstructor public class BrApiServerInfo { - @JsonProperty("calls") @Valid private List calls = new ArrayList(); - @JsonProperty("contactEmail") private String contactEmail; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("location") private String location; - @JsonProperty("organizationName") private String organizationName; - @JsonProperty("organizationURL") private String organizationURL; - @JsonProperty("serverDescription") private String serverDescription; - @JsonProperty("serverName") private String serverName; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java index dd2ab1d9..0f1d8570 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java @@ -18,18 +18,14 @@ @SuperBuilder @NoArgsConstructor public class BrApiService { - @JsonProperty("dataTypes") @Valid private List dataTypes; - @JsonProperty("methods") @Valid private List methods = new ArrayList(); - @JsonProperty("service") private String service; - @JsonProperty("versions") @Valid private List versions = new ArrayList(); @@ -46,7 +42,7 @@ public enum MethodsEnum { /** * Gets or Sets versions */ - public enum VersionsEnum { + public enum VersionsEnum implements BrApiEnum { _0("2.0"), _1("2.1"), @@ -60,19 +56,8 @@ public enum VersionsEnum { } @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static VersionsEnum fromValue(String text) { - for (VersionsEnum b : VersionsEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; + public String getBrapiValue() { + return value; } } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java index a7a736f0..863f048e 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -17,87 +17,61 @@ @SuperBuilder @NoArgsConstructor public class BrApiStudy { - @JsonProperty("studyDbId") private String studyDbId; - @JsonProperty("active") private Boolean active; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("commonCropName") private String commonCropName; - @JsonProperty("contacts") @Valid private List contacts; - @JsonProperty("culturalPractices") private String culturalPractices; - @JsonProperty("dataLinks") @Valid private List dataLinks; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("endDate") private OffsetDateTime endDate; - @JsonProperty("environmentParameters") @Valid private List environmentParameters; - @JsonProperty("experimentalDesign") private BrApiExperimentalDesign experimentalDesign; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("growthFacility") private BrApiGrowthFacility growthFacility; - @JsonProperty("lastUpdate") private BrApiLastUpdate lastUpdate; - @JsonProperty("license") private String license; - @JsonProperty("locationDbId") private String locationDbId; - @JsonProperty("locationName") private String locationName; - @JsonProperty("observationUnitsDescription") private String observationUnitsDescription; - @JsonProperty("seasons") @Valid private List seasons; - @JsonProperty("startDate") private OffsetDateTime startDate; - @JsonProperty("studyDescription") private String studyDescription; - @JsonProperty("studyName") private String studyName; - @JsonProperty("studyPUI") private String studyPUI; - @JsonProperty("studyType") private String studyType; - @JsonProperty("trialDbId") private String trialDbId; - @JsonProperty("trialName") private String trialName; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java index 9f34eb88..590e8bc2 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java @@ -17,56 +17,40 @@ @SuperBuilder @NoArgsConstructor public class BrApiTrial { - @JsonProperty("trialDbId") private String trialDbId; - @JsonProperty("active") private Boolean active; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("commonCropName") private String commonCropName; - @JsonProperty("contacts") @Valid private List contacts; - @JsonProperty("datasetAuthorships") @Valid private List datasetAuthorships; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("endDate") private LocalDate endDate; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("programDbId") private String programDbId; - @JsonProperty("programName") private String programName; - @JsonProperty("publications") @Valid private List publications; - @JsonProperty("startDate") private LocalDate startDate; - @JsonProperty("trialDescription") private String trialDescription; - @JsonProperty("trialName") private String trialName; - @JsonProperty("trialPUI") private String trialPUI; } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java index fb1165d5..2de9b571 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java @@ -6,7 +6,7 @@ /** * Gets or Sets WSMIMEDataTypes */ -public enum BrApiWSMIMEDataTypes { +public enum BrApiWSMIMEDataTypes implements BrApiEnum { APPLICATION_JSON("application/json"), TEXT_CSV("text/csv"), TEXT_TSV("text/tsv"), @@ -19,18 +19,7 @@ public enum BrApiWSMIMEDataTypes { } @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static BrApiWSMIMEDataTypes fromValue(String text) { - for (BrApiWSMIMEDataTypes b : BrApiWSMIMEDataTypes.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; + public String getBrapiValue() { + return value; } } diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java index d8eaa9d5..e37f5a75 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java @@ -29,7 +29,6 @@ @EqualsAndHashCode @ToString public class DataResponse { - @JsonProperty("data") private List data; } From 0d0a7b4d899d7b1057772f37f98eba4c61d4cdbb Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 27 May 2020 11:25:30 -0400 Subject: [PATCH 56/71] Removed @JsonProperty annotations and updated enums in phenotyping models --- .../v2/phenotyping/model/BrApiEvent.java | 11 +--------- .../model/BrApiEventParameters.java | 3 --- .../v2/phenotyping/model/BrApiImage.java | 17 --------------- .../v2/phenotyping/model/BrApiMethod.java | 9 -------- .../phenotyping/model/BrApiObservation.java | 15 ------------- .../model/BrApiObservationLevel.java | 18 ++++------------ .../model/BrApiObservationTable.java | 4 ---- .../model/BrApiObservationTreatment.java | 2 -- .../model/BrApiObservationUnit.java | 21 ------------------- .../model/BrApiObservationUnitPosition.java | 9 -------- .../model/BrApiObservationUnitTable.java | 4 +--- ...ervationUnitTableObservationVariables.java | 2 -- .../model/BrApiObservationVariable.java | 2 -- .../v2/phenotyping/model/BrApiOntology.java | 9 -------- .../v2/phenotyping/model/BrApiScale.java | 8 ------- .../model/BrApiScaleCategories.java | 2 -- .../model/BrApiScaleValidValues.java | 3 --- .../v2/phenotyping/model/BrApiTrait.java | 13 ------------ .../v2/phenotyping/model/HeaderRowName.java | 18 ++++------------ 19 files changed, 10 insertions(+), 160 deletions(-) diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java index 09afbc11..7e6e2c61 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java @@ -17,35 +17,26 @@ @SuperBuilder @NoArgsConstructor public class BrApiEvent { - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("date") @Valid private List date; - @JsonProperty("eventDbId") private String eventDbId; - @JsonProperty("eventDescription") private String eventDescription; - @JsonProperty("eventParameters") @Valid private List eventParameters; - @JsonProperty("eventType") private String eventType; - @JsonProperty("eventTypeDbId") private String eventTypeDbId; - @JsonProperty("observationUnitDbIds") @Valid private List observationUnitDbIds; - @JsonProperty("studyDbId") private String studyDbId; -} +} \ No newline at end of file diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java index 45b82010..235dafd1 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java @@ -12,13 +12,10 @@ @SuperBuilder @NoArgsConstructor public class BrApiEventParameters { - @JsonProperty("key") private String key; - @JsonProperty("rdfValue") private String rdfValue; - @JsonProperty("value") private String value; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java index 12acdcaa..a72a8d46 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java @@ -19,58 +19,41 @@ @SuperBuilder @NoArgsConstructor public class BrApiImage { - @JsonProperty("imageDbId") private String imageDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("copyright") private String copyright; - @JsonProperty("description") private String description; - @JsonProperty("descriptiveOntologyTerms") @Valid private List descriptiveOntologyTerms; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("imageFileName") private String imageFileName; - @JsonProperty("imageFileSize") private Integer imageFileSize; - @JsonProperty("imageHeight") private Integer imageHeight; - @JsonProperty("imageLocation") private BrApiGeoJSON imageLocation; - @JsonProperty("imageName") private String imageName; - @JsonProperty("imageTimeStamp") private OffsetDateTime imageTimeStamp; - @JsonProperty("imageURL") private String imageURL; - @JsonProperty("imageWidth") private Integer imageWidth; - @JsonProperty("mimeType") private String mimeType; - @JsonProperty("observationDbIds") @Valid private List observationDbIds; - @JsonProperty("observationUnitDbId") private String observationUnitDbId; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java index 3174e622..4f9ce74b 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java @@ -18,32 +18,23 @@ @SuperBuilder @NoArgsConstructor public class BrApiMethod { - @JsonProperty("methodDbId") private String methodDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("bibliographicalReference") private String bibliographicalReference; - @JsonProperty("description") private String description; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("formula") private String formula; - @JsonProperty("methodClass") private String methodClass; - @JsonProperty("methodName") private String methodName; - @JsonProperty("ontologyReference") private BrApiOntologyReference ontologyReference; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java index 0b105f47..1f18f9a9 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java @@ -20,58 +20,43 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservation { - @JsonProperty("observationDbId") private String observationDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("collector") @NotNull private String collector; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("germplasmDbId") @NotNull private String germplasmDbId; - @JsonProperty("germplasmName") private String germplasmName; - @JsonProperty("observationTimeStamp") @NotNull private OffsetDateTime observationTimeStamp; - @JsonProperty("observationUnitDbId") @NotNull private String observationUnitDbId; - @JsonProperty("observationUnitName") private String observationUnitName; - @JsonProperty("observationVariableDbId") @NotNull private String observationVariableDbId; - @JsonProperty("observationVariableName") private String observationVariableName; - @JsonProperty("season") @NotNull private BrApiSeason season; - @JsonProperty("studyDbId") @NotNull private String studyDbId; - @JsonProperty("uploadedBy") @NotNull private String uploadedBy; - @JsonProperty("value") @NotNull private String value; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java index 1a5c5c72..a9d80907 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java @@ -2,11 +2,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import org.brapi.v2.core.model.BrApiEnum; /** * observation levels available in this database */ -public enum BrApiObservationLevel { +public enum BrApiObservationLevel implements BrApiEnum { FIELD("field"), PLOT("plot"), SUBPLOT("subplot"), @@ -20,18 +21,7 @@ public enum BrApiObservationLevel { } @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static BrApiObservationLevel fromValue(String text) { - for (BrApiObservationLevel b : BrApiObservationLevel.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; + public String getBrapiValue() { + return value; } } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java index 2151fa54..f494fcf4 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java @@ -15,19 +15,15 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationTable { - @JsonProperty("data") @Valid private List> data; - @JsonProperty("headerRow") @Valid private List headerRow; - @JsonProperty("observationVariableDbIds") @Valid private List observationVariableDbIds; - @JsonProperty("observationVariableNames") @Valid private List observationVariableNames; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java index 3c46efd7..7241ef66 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationTreatment { - @JsonProperty("factor") private String factor; - @JsonProperty("modality") private String modality; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java index 388f85b7..4f23baa7 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java @@ -17,69 +17,48 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationUnit { - @JsonProperty("observationUnitDbId") private String observationUnitDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("germplasmDbId") private String germplasmDbId; - @JsonProperty("germplasmName") private String germplasmName; - @JsonProperty("locationDbId") private String locationDbId; - @JsonProperty("locationName") private String locationName; - @JsonProperty("observationLevel") private BrApiObservationLevel observationLevel; - @JsonProperty("observationUnitName") private String observationUnitName; - @JsonProperty("observationUnitPUI") private String observationUnitPUI; - @JsonProperty("observationUnitPosition") private BrApiObservationUnitPosition observationUnitPosition; - @JsonProperty("plantNumber") private String plantNumber; - @JsonProperty("plotNumber") private String plotNumber; - @JsonProperty("programDbId") private String programDbId; - @JsonProperty("programName") private String programName; - @JsonProperty("seedLotDbId") private String seedLotDbId; - @JsonProperty("studyDbId") private String studyDbId; - @JsonProperty("studyName") private String studyName; - @JsonProperty("treatments") @Valid private List treatments; - @JsonProperty("trialDbId") private String trialDbId; - @JsonProperty("trialName") private String trialName; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java index 6f8a697f..f6fbb53d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java @@ -13,10 +13,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationUnitPosition { - @JsonProperty("blockNumber") private String blockNumber; - @JsonProperty("entryNumber") private String entryNumber; /** @@ -27,13 +25,10 @@ public enum EntryTypeEnum { TEST, FILLER; } - @JsonProperty("entryType") private EntryTypeEnum entryType; - @JsonProperty("geoCoordinates") private BrApiGeoJSON geoCoordinates; - @JsonProperty("positionCoordinateX") private String positionCoordinateX; /** @@ -49,16 +44,12 @@ public enum PositionCoordinateType { MEASURED_ROW, MEASURED_COL; } - @JsonProperty("positionCoordinateXType") private PositionCoordinateType positionCoordinateXType; - @JsonProperty("positionCoordinateY") private String positionCoordinateY; - @JsonProperty("positionCoordinateYType") private PositionCoordinateType positionCoordinateYType; - @JsonProperty("replicate") private String replicate; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java index debc1250..29a67284 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java @@ -15,15 +15,13 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationUnitTable { - @JsonProperty("data") + @Valid private List> data; - @JsonProperty("headerRow") @Valid private List headerRow; - @JsonProperty("observationVariables") @Valid private List observationVariables; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java index e5b135ee..27b79e66 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationUnitTableObservationVariables { - @JsonProperty("observationVariableDbId") private String observationVariableDbId; - @JsonProperty("observationVariableName") private String observationVariableName; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java index be733dbe..371b70e1 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiObservationVariable extends BrApiVariable { - @JsonProperty("observationVariableDbId") private String observationVariableDbId; - @JsonProperty("observationVariableName") private String observationVariableName; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java index 1afa99da..b144f22c 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java @@ -15,32 +15,23 @@ @SuperBuilder @NoArgsConstructor public class BrApiOntology { - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("authors") private String authors; - @JsonProperty("copyright") private String copyright; - @JsonProperty("description") private String description; - @JsonProperty("documentationURL") private String documentationURL; - @JsonProperty("licence") private String licence; - @JsonProperty("ontologyDbId") private String ontologyDbId; - @JsonProperty("ontologyName") private String ontologyName; - @JsonProperty("version") private String version; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java index 3f6d246a..2391b70d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java @@ -18,29 +18,21 @@ @SuperBuilder @NoArgsConstructor public class BrApiScale { - @JsonProperty("scaleDbId") private String scaleDbId; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("dataType") private BrApiTraitDataType dataType; - @JsonProperty("decimalPlaces") private Integer decimalPlaces; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("ontologyReference") private BrApiOntologyReference ontologyReference; - @JsonProperty("scaleName") private String scaleName; - @JsonProperty("validValues") private BrApiScaleValidValues validValues; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java index 830167bc..cc46d673 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java @@ -12,10 +12,8 @@ @SuperBuilder @NoArgsConstructor public class BrApiScaleCategories { - @JsonProperty("label") private String label; - @JsonProperty("value") private String value; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java index fb3862ae..da75f130 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java @@ -15,14 +15,11 @@ @SuperBuilder @NoArgsConstructor public class BrApiScaleValidValues { - @JsonProperty("categories") @Valid private List categories; - @JsonProperty("max") private Integer max; - @JsonProperty("min") private Integer min; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java index eb216120..e895cc9d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java @@ -18,46 +18,33 @@ @SuperBuilder @NoArgsConstructor public class BrApiTrait { - @JsonProperty("traitDbId") private String traitDbId; - @JsonProperty("alternativeAbbreviations") @Valid private List alternativeAbbreviations; - @JsonProperty("attribute") private String attribute; - @JsonProperty("additionalInfo") @Valid private Map additionalInfo; - @JsonProperty("entity") private String entity; - @JsonProperty("externalReferences") private List externalReferences; - @JsonProperty("mainAbbreviation") private String mainAbbreviation; - @JsonProperty("ontologyReference") private BrApiOntologyReference ontologyReference; - @JsonProperty("status") private String status; - @JsonProperty("synonyms") @Valid private List synonyms; - @JsonProperty("traitClass") private String traitClass; - @JsonProperty("traitDescription") private String traitDescription; - @JsonProperty("traitName") private String traitName; } diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java index 854fbc82..6353ce8c 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java @@ -2,11 +2,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import org.brapi.v2.core.model.BrApiEnum; /** * valid header fields */ -public enum HeaderRowName { +public enum HeaderRowName implements BrApiEnum { OBSERVATIONTIMESTAMP("observationTimeStamp"), STUDYDBID("studyDbId"), STUDYNAME("studyName"), @@ -29,18 +30,7 @@ public enum HeaderRowName { } @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static HeaderRowName fromValue(String text) { - for (HeaderRowName b : HeaderRowName.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; + public String getBrapiValue() { + return value; } } From 2685388b563e9327465bd3ec879248cd3edab884 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 27 May 2020 11:57:28 -0400 Subject: [PATCH 57/71] Added get specific variable api and tests --- .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 4 ++ .../v2/modules/phenotype/VariablesAPI.java | 18 +++++++ .../v2/modules/phenotype/TraitsAPITests.java | 4 +- .../modules/phenotype/VariablesAPITests.java | 49 +++++++++++++++---- .../phenotype/VariablesAPIUnitTests.java | 14 +++++- 5 files changed, 75 insertions(+), 14 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 3fb70048..52ff8b2b 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -30,4 +30,8 @@ public static String getScalesByIdPath(String scaleId) { public static String getVariablesPath() { return getRootPath() + "/variables"; } + public static String getVariablesByIdPath(String variableId) { + return getVariablesPath() + "/" + variableId; + } + } diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index 1f66762b..0a59d9a5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -90,4 +90,22 @@ public List getVariables() throws HttpException, APIException { return getVariables(new VariablesRequest()); } + public Optional getVariableById(@NonNull String variableId) throws HttpException, APIException { + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getVariablesByIdPath(variableId); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .method(HttpMethod.GET) + .build(); + + Optional searchResult = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiVariable resultResponse = gson.fromJson(resultJson, BrApiVariable.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return searchResult; + } + } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index f962bda8..001d4554 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -195,14 +195,14 @@ public void updateTraitSuccess() { @Test @SneakyThrows - public void updateProgramMissingId() { + public void updateTraitMissingId() { // Check that it throws an APIException BrApiTrait brApiTrait = BrApiTrait.builder() .traitName("new test trait") .build(); APIException exception = assertThrows(APIException.class, () -> { - Optional updatedProgramResult = this.traitsAPI.updateTrait(brApiTrait); + Optional updatedTraitResult = this.traitsAPI.updateTrait(brApiTrait); }); } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index 2d26bcd2..9c2fa3f6 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -3,6 +3,7 @@ import lombok.SneakyThrows; import org.brapi.client.v2.BrAPIClientTest; import org.brapi.client.v2.model.exceptions.APIException; +import org.brapi.client.v2.model.exceptions.HttpNotFoundException; import org.brapi.v2.core.model.BrApiExternalReference; import org.brapi.v2.core.model.BrApiOntologyReference; import org.brapi.v2.phenotyping.model.BrApiMethod; @@ -10,8 +11,7 @@ import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.BrApiVariable; import org.brapi.v2.phenotyping.model.request.VariablesRequest; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; @@ -19,6 +19,8 @@ import static org.junit.jupiter.api.Assertions.*; +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class VariablesAPITests extends BrAPIClientTest { private VariablesAPI variablesAPI = new VariablesAPI(this.client); @@ -161,10 +163,10 @@ private void variableAssertEquals(BrApiVariable expected, BrApiVariable actual) assertEquals(expected.getContextOfUse(), actual.getContextOfUse(), "Variable contextOfUse mismatch"); assertEquals(expected.getDefaultValue(), actual.getDefaultValue(), "Variable defaultValue mismatch"); assertEquals(expected.getDocumentationURL(), actual.getDocumentationURL(), "Variable documentationUrl mismatch"); - assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Scale ontology dbId mismatch"); - assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Scale ontology name mismatch"); - assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Scale ontology version mismatch"); - assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Scale external reference mismatch"); + assertEquals(expected.getOntologyReference().getOntologyDbId(), actual.getOntologyReference().getOntologyDbId(), "Variable ontology dbId mismatch"); + assertEquals(expected.getOntologyReference().getOntologyName(), actual.getOntologyReference().getOntologyName(), "Variable ontology name mismatch"); + assertEquals(expected.getOntologyReference().getVersion(), actual.getOntologyReference().getVersion(), "Variable ontology version mismatch"); + assertEquals(expected.getExternalReferences(), actual.getExternalReferences(), "Variable external reference mismatch"); assertEquals(expected.getGrowthStage(), actual.getGrowthStage(), "Variable growthStage mismatch"); assertEquals(expected.getInstitution(), actual.getInstitution(), "Variable institution mismatch"); assertEquals(expected.getLanguage(), actual.getLanguage(), "Variable language mismatch"); @@ -220,23 +222,50 @@ void getVariablesPageFilter() { .pageSize(1) .build(); - List scales = variablesAPI.getVariables(baseRequest); + List variables = variablesAPI.getVariables(baseRequest); - assertEquals(true, scales.size() == 1, "More than one variable was returned"); + assertEquals(true, variables.size() == 1, "More than one variable was returned"); } @Test @SneakyThrows @Order(2) void getVariablesByExternalReferenceIdSuccess() { - VariablesRequest scalesRequest = VariablesRequest.builder() + VariablesRequest variablesRequest = VariablesRequest.builder() .externalReferenceID(externalReferenceID) .build(); - List variables = variablesAPI.getVariables(scalesRequest); + List variables = variablesAPI.getVariables(variablesRequest); assertEquals(true, variables.size() > 0, "List of variables was empty"); } + + @Test + public void getVariableByIdMissingId() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + Optional variable = variablesAPI.getVariableById(null); + }); + } + + @Test + @SneakyThrows + @Order(2) + void getVariableByIdSuccess() { + Optional optionalBrApiVariable = variablesAPI.getVariableById(createdVariable.getObservationVariableDbId()); + + assertEquals(true, optionalBrApiVariable.isPresent(), "An empty optional was returned"); + BrApiVariable variable = optionalBrApiVariable.get(); + assertEquals(true, variable.getObservationVariableDbId() != null, "VariableDbId was not parsed properly."); + variableAssertEquals(createdVariable, variable); + } + + @Test + @SneakyThrows + void getVariableByIdInvalid() { + HttpNotFoundException exception = assertThrows(HttpNotFoundException.class, () -> { + Optional variable = variablesAPI.getVariableById("badVariableId"); + }); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java index 74fdbddd..dea647f0 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -47,9 +47,19 @@ void createVariablesEmptyBody() { void getVariablesEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); - List brApiScales = variablesAPI.getVariables(); + List brApiVariables = variablesAPI.getVariables(); - assertEquals(0, brApiScales.size(), "List size is greater than 0"); + assertEquals(0, brApiVariables.size(), "List size is greater than 0"); + } + + @Test + @SneakyThrows + void getScalesByIdEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + Optional brApiVariable = variablesAPI.getVariableById("test"); + + assertEquals(false, brApiVariable.isPresent(), "Empty optional was not returned."); } } From be90dc4a71360561090fb3c97c9b36ad3d75a22d Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 27 May 2020 12:20:00 -0400 Subject: [PATCH 58/71] Added update variable api and tests --- .../v2/modules/phenotype/VariablesAPI.java | 23 ++++++++++++ .../modules/phenotype/VariablesAPITests.java | 35 +++++++++++++++++++ .../phenotype/VariablesAPIUnitTests.java | 17 ++++++++- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index 0a59d9a5..739466bc 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -65,6 +65,29 @@ public Optional createVariable(@NonNull BrApiVariable brApiVariab } } + public Optional updateVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { + + if (brApiVariable.getObservationVariableDbId() == null){ + throw new APIException("BrAPI variable must have an existing variableDbId."); + } + + // Build our request + String endpoint = BrAPIPhenotypeEndpoints_V2.getVariablesByIdPath(brApiVariable.getObservationVariableDbId()); + BrAPIRequest request = BrAPIRequest.builder() + .target(endpoint) + .parameter("dataType", "application/json") + .data(brApiVariable) + .method(HttpMethod.PUT) + .build(); + + Optional updateVariable = getBrAPIClient().execute(request, (metadata, resultJson, gson) -> { + BrApiVariable resultResponse = gson.fromJson(resultJson, BrApiVariable.class); + return Optional.of(resultResponse); + }).orElse(Optional.empty()); + + return updateVariable; + } + public List getVariables(@NonNull VariablesRequest variablesRequest) throws HttpException, APIException { // Build our request diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index 9c2fa3f6..2af3a050 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -266,6 +266,41 @@ void getVariableByIdInvalid() { Optional variable = variablesAPI.getVariableById("badVariableId"); }); } + + @Test + @SneakyThrows + @Order(2) + public void updateVariableSuccess() { + BrApiVariable variable = this.createdVariable; + variable.setObservationVariableName("updated_name"); + + // Check that it is a success and all data matches + Optional updatedVaribleResult = this.variablesAPI.updateVariable(variable); + + assertEquals(true, updatedVaribleResult.isPresent(), "Variable was not returned"); + BrApiVariable updatedVariable = updatedVaribleResult.get(); + variableAssertEquals(variable, updatedVariable); + } + + @Test + @SneakyThrows + public void updateVariableMissingId() { + // Check that it throws an APIException + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableName("new test variable") + .build(); + + APIException exception = assertThrows(APIException.class, () -> { + Optional updatedVariableResult = this.variablesAPI.updateVariable(brApiVariable); + }); + } + + @Test + public void updateVariableNull() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + Optional variable = this.variablesAPI.updateVariable(null); + }); + } } diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java index dea647f0..7a9d04a7 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -42,6 +42,21 @@ void createVariablesEmptyBody() { assertEquals(false, brApiVariable.isPresent(), "Empty optional was not returned."); } + @Test + @SneakyThrows + void updateVariablesEmptyBody() { + when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) + .thenReturn(Optional.empty()); + + BrApiVariable variable = BrApiVariable.builder() + .observationVariableDbId("test") + .build(); + + Optional brApiVariable = variablesAPI.updateVariable(variable); + + assertEquals(false, brApiVariable.isPresent(), "Empty optional was not returned."); + } + @Test @SneakyThrows void getVariablesEmptyBody() { @@ -54,7 +69,7 @@ void getVariablesEmptyBody() { @Test @SneakyThrows - void getScalesByIdEmptyBody() { + void getVariablesByIdEmptyBody() { when(brAPIClient.execute(any(BrAPIRequest.class), any(ResponseHandlerFunction.class))) .thenReturn(Optional.empty()); Optional brApiVariable = variablesAPI.getVariableById("test"); From b182c1b9f5f7b642550ad22befebfa75776b389f Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Thu, 28 May 2020 16:51:14 -0400 Subject: [PATCH 59/71] Added create variables separate call api and tests --- .../v2/modules/phenotype/VariablesAPI.java | 98 ++++++++++ .../modules/phenotype/VariablesAPITests.java | 169 +++++++++++++++++- .../phenotype/VariablesAPIUnitTests.java | 3 + .../v2/phenotyping/model/BrApiVariable.java | 2 +- 4 files changed, 263 insertions(+), 9 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index 739466bc..1587a74a 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -9,6 +9,9 @@ import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.v2.core.model.response.DataResponse; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.BrApiScale; +import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.BrApiVariable; import org.brapi.v2.phenotyping.model.request.VariablesRequest; @@ -19,8 +22,15 @@ public class VariablesAPI extends BrAPIEndpoint { + private MethodsAPI methodsAPI; + private ScalesAPI scalesAPI; + private TraitsAPI traitsAPI; + public VariablesAPI(BrAPIClient brAPIClient) { super(brAPIClient); + methodsAPI = new MethodsAPI(brAPIClient); + scalesAPI = new ScalesAPI(brAPIClient); + traitsAPI = new TraitsAPI(brAPIClient); } public List createVariables(@NonNull List brApiVariables) throws HttpException, APIException { @@ -65,6 +75,93 @@ public Optional createVariable(@NonNull BrApiVariable brApiVariab } } + private List createMethodsScalesTraits(@NonNull List brApiVariables) throws HttpException, APIException { + + if (brApiVariables.stream().anyMatch(variable -> variable.getMethod() == null)) { + throw new APIException("BrAPI variable method must exist."); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getScale() == null)) { + throw new APIException("BrAPI variable scale must exist."); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getTrait() == null)) { + throw new APIException("BrAPI variable trait must exist."); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getMethod().getMethodDbId() != null)) { + throw new APIException("BrAPI variable method must not have an existing dbId."); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getScale().getScaleDbId() != null)) { + throw new APIException("BrAPI variable scale must not have an existing dbId."); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getTrait().getTraitDbId() != null)) { + throw new APIException("BrAPI variable trait must not have an existing dbId."); + } + + ArrayList variablesWithDbIds = new ArrayList<>(); + + // not the most efficient way to do this since there are list calls but mapping is error prone without unique ids + // will have more network calls since it's not batching them and only doing single calls + for (BrApiVariable variable : brApiVariables) { + Optional method = methodsAPI.createMethod(variable.getMethod()); + Optional scale = scalesAPI.createScale(variable.getScale()); + Optional trait = traitsAPI.createTrait(variable.getTrait()); + + BrApiMethod methodResponse = method.orElseThrow(() -> new APIException("BrAPI variable problem creating method")); + BrApiMethod methodOnlyDbId = new BrApiMethod(); + methodOnlyDbId.setMethodDbId(methodResponse.getMethodDbId()); + + BrApiScale scaleResponse = scale.orElseThrow(() -> new APIException("BrAPI variable problem creating scale")); + BrApiScale scaleOnlyDbId = new BrApiScale(); + scaleOnlyDbId.setScaleDbId(scaleResponse.getScaleDbId()); + + BrApiTrait traitResponse = trait.orElseThrow(() -> new APIException("BrAPI variable problem creating trait")); + BrApiTrait traitOnlyDbId = new BrApiTrait(); + traitOnlyDbId.setTraitDbId(traitResponse.getTraitDbId()); + + // TODO: this should be a deep copy + BrApiVariable shallowCopy = variable.toBuilder().build(); + shallowCopy.setMethod(methodOnlyDbId); + shallowCopy.setScale(scaleOnlyDbId); + shallowCopy.setTrait(traitOnlyDbId); + variablesWithDbIds.add(shallowCopy); + } + + return variablesWithDbIds; + } + + public List createMethodsScalesTraitsThenVariables(@NonNull List brApiVariables) throws HttpException, APIException { + + if (brApiVariables.isEmpty()) { + throw new APIException("BrAPI variables cannot be empty"); + } + + if (brApiVariables.stream().anyMatch(variable -> variable.getMethod() != null && variable.getObservationVariableDbId() != null)) { + throw new APIException("BrAPI variable must not have an existing observationVariableDbId."); + } + + createMethodsScalesTraits(brApiVariables); + + return createVariables(brApiVariables); + } + + public Optional createMethodScaleTraitThenVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { + + List brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + List createdVariables = createMethodsScalesTraitsThenVariables(brApiVariables); + + if (createdVariables.size() == 1){ + return Optional.of(createdVariables.get(0)); + } + else { + return Optional.empty(); + } + } + public Optional updateVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { if (brApiVariable.getObservationVariableDbId() == null){ @@ -88,6 +185,7 @@ public Optional updateVariable(@NonNull BrApiVariable brApiVariab return updateVariable; } + public List getVariables(@NonNull VariablesRequest variablesRequest) throws HttpException, APIException { // Build our request diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index 2af3a050..cf3a4715 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -87,6 +87,22 @@ public void createVariableMultipleNull() { @Order(1) @SneakyThrows public void createVariableSuccess() { + + BrApiVariable brApiVariable = buildTestVariable(); + + Optional createdVariable = variablesAPI.createVariable(brApiVariable); + + assertTrue(createdVariable.isPresent()); + BrApiVariable variable = createdVariable.get(); + + assertFalse(variable.getObservationVariableDbId() == null, "Variable id missing"); + variableAssertEquals(brApiVariable, variable); + + this.createdVariable = variable; + } + + private BrApiVariable buildTestVariable() { + BrApiExternalReference brApiExternalReference = BrApiExternalReference.builder() .referenceID(externalReferenceID) .referenceSource(externalReferenceSource) @@ -146,15 +162,8 @@ public void createVariableSuccess() { .method(method) .build(); - Optional createdVariable = variablesAPI.createVariable(brApiVariable); - - assertTrue(createdVariable.isPresent()); - BrApiVariable variable = createdVariable.get(); - - assertFalse(variable.getObservationVariableDbId() == null, "Variable id missing"); - variableAssertEquals(brApiVariable, variable); + return brApiVariable; - this.createdVariable = variable; } private void variableAssertEquals(BrApiVariable expected, BrApiVariable actual) { @@ -204,6 +213,150 @@ public void createVariablesMultipleSuccess() { assertEquals(brApiVariable2.getObservationVariableName(), createdVariables.get(1).getObservationVariableName(), "Variable name mismatch"); } + @Test + public void createMethodScaleTraitThenVariableIdPresent() { + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableDbId("test") + .build(); + APIException exception = assertThrows(APIException.class, () -> { + Optional variable = variablesAPI.createMethodScaleTraitThenVariable(brApiVariable); + }); + } + + @Test + public void createMethodScaleTraitThenVariableNull() { + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + Optional variable = variablesAPI.createMethodScaleTraitThenVariable(null); + }); + } + + @Test + public void createMethodScaleTraitThenVariableMultipleIdPresent() { + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableDbId("test") + .build(); + BrApiVariable brApiVariable1 = new BrApiVariable(); + List brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + brApiVariables.add(brApiVariable1); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); + }); + } + + @Test + public void createMethodsScalesTraitsThenVariablesMultipleEmptyList() { + + List brApiVariables = new ArrayList<>(); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); + }); + } + + @Test + public void createMethodsScalesTraitsThenVariablesMultipleNull() { + + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { + List variables = variablesAPI.createMethodsScalesTraitsThenVariables(null); + }); + } + + @Test + public void createMethodsScalesTraitsThenVariablesNullTraitMethodScale() { + + BrApiVariable brApiVariable = BrApiVariable.builder() + .build(); + ArrayList brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); + }); + } + + @Test + public void createMethodsScalesTraitsThenVariablesExistingTraitMethodScaleDbId() { + + BrApiMethod method = BrApiMethod.builder() + .methodDbId("testDbId") + .build(); + + BrApiVariable brApiVariable = BrApiVariable.builder() + .method(method) + .build(); + ArrayList brApiVariables = new ArrayList<>(); + brApiVariables.add(brApiVariable); + + APIException exception = assertThrows(APIException.class, () -> { + List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); + }); + } + + + + + @Test + @Order(1) + @SneakyThrows + public void createMethodsScalesTraitsThenVariablesSuccess() { + + BrApiVariable brApiVariable = buildTestVariable(); + + Optional createdVariable = variablesAPI.createMethodScaleTraitThenVariable(brApiVariable); + + assertTrue(createdVariable.isPresent()); + BrApiVariable variable = createdVariable.get(); + + assertFalse(variable.getObservationVariableDbId() == null, "Variable id missing"); + variableAssertEquals(brApiVariable, variable); + + //this.createdVariable = variable; + } + + @Test + @Order(1) + @SneakyThrows + public void createMethodsScalesTraitsThenVariablesMultipleSuccess() { + + BrApiMethod method = BrApiMethod.builder() + .methodName("test method") + .build(); + BrApiScale scale = BrApiScale.builder() + .scaleName("test scale") + .build(); + BrApiTrait trait = BrApiTrait.builder() + .traitName("test trait") + .build(); + + BrApiVariable brApiVariable = BrApiVariable.builder() + .observationVariableName("new test variable1") + .method(method) + .scale(scale) + .trait(trait) + .build(); + BrApiVariable brApiVariable2 = BrApiVariable.builder() + .observationVariableName("new test variable2") + .method(method) + .scale(scale) + .trait(trait) + .build(); + List variables = new ArrayList<>(); + variables.add(brApiVariable); + variables.add(brApiVariable2); + + List createdVariables = variablesAPI.createMethodsScalesTraitsThenVariables(variables); + + assertEquals(true, createdVariables.size() == 2); + assertEquals(true, createdVariables.get(0).getObservationVariableDbId() != null, "Variable id missing"); + assertEquals(true, createdVariables.get(1).getObservationVariableDbId() != null, "Variable id missing"); + + assertEquals(brApiVariable.getObservationVariableName(), createdVariables.get(0).getObservationVariableName(), "Variable name mismatch"); + assertEquals(brApiVariable2.getObservationVariableName(), createdVariables.get(1).getObservationVariableName(), "Variable name mismatch"); + } + + @Test @SneakyThrows @Order(2) diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java index 7a9d04a7..bfe084e1 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -4,6 +4,9 @@ import org.brapi.client.v2.BrAPIClient; import org.brapi.client.v2.ResponseHandlerFunction; import org.brapi.client.v2.model.BrAPIRequest; +import org.brapi.v2.phenotyping.model.BrApiMethod; +import org.brapi.v2.phenotyping.model.BrApiScale; +import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.BrApiVariable; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java index 4156776d..53f76cb7 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -17,7 +17,7 @@ * Variable */ @Data -@SuperBuilder +@SuperBuilder(toBuilder = true) @NoArgsConstructor public class BrApiVariable { private String observationVariableDbId; From ada7056c2704113281c3f4fb62a130177cfecf3f Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 3 Jun 2020 10:37:09 -0400 Subject: [PATCH 60/71] Removed create variables convenience api and tests for now --- .../v2/modules/phenotype/VariablesAPI.java | 98 ------------ .../modules/phenotype/VariablesAPITests.java | 144 ------------------ 2 files changed, 242 deletions(-) diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index 1587a74a..739466bc 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -9,9 +9,6 @@ import org.brapi.client.v2.model.exceptions.APIException; import org.brapi.client.v2.model.exceptions.HttpException; import org.brapi.v2.core.model.response.DataResponse; -import org.brapi.v2.phenotyping.model.BrApiMethod; -import org.brapi.v2.phenotyping.model.BrApiScale; -import org.brapi.v2.phenotyping.model.BrApiTrait; import org.brapi.v2.phenotyping.model.BrApiVariable; import org.brapi.v2.phenotyping.model.request.VariablesRequest; @@ -22,15 +19,8 @@ public class VariablesAPI extends BrAPIEndpoint { - private MethodsAPI methodsAPI; - private ScalesAPI scalesAPI; - private TraitsAPI traitsAPI; - public VariablesAPI(BrAPIClient brAPIClient) { super(brAPIClient); - methodsAPI = new MethodsAPI(brAPIClient); - scalesAPI = new ScalesAPI(brAPIClient); - traitsAPI = new TraitsAPI(brAPIClient); } public List createVariables(@NonNull List brApiVariables) throws HttpException, APIException { @@ -75,93 +65,6 @@ public Optional createVariable(@NonNull BrApiVariable brApiVariab } } - private List createMethodsScalesTraits(@NonNull List brApiVariables) throws HttpException, APIException { - - if (brApiVariables.stream().anyMatch(variable -> variable.getMethod() == null)) { - throw new APIException("BrAPI variable method must exist."); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getScale() == null)) { - throw new APIException("BrAPI variable scale must exist."); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getTrait() == null)) { - throw new APIException("BrAPI variable trait must exist."); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getMethod().getMethodDbId() != null)) { - throw new APIException("BrAPI variable method must not have an existing dbId."); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getScale().getScaleDbId() != null)) { - throw new APIException("BrAPI variable scale must not have an existing dbId."); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getTrait().getTraitDbId() != null)) { - throw new APIException("BrAPI variable trait must not have an existing dbId."); - } - - ArrayList variablesWithDbIds = new ArrayList<>(); - - // not the most efficient way to do this since there are list calls but mapping is error prone without unique ids - // will have more network calls since it's not batching them and only doing single calls - for (BrApiVariable variable : brApiVariables) { - Optional method = methodsAPI.createMethod(variable.getMethod()); - Optional scale = scalesAPI.createScale(variable.getScale()); - Optional trait = traitsAPI.createTrait(variable.getTrait()); - - BrApiMethod methodResponse = method.orElseThrow(() -> new APIException("BrAPI variable problem creating method")); - BrApiMethod methodOnlyDbId = new BrApiMethod(); - methodOnlyDbId.setMethodDbId(methodResponse.getMethodDbId()); - - BrApiScale scaleResponse = scale.orElseThrow(() -> new APIException("BrAPI variable problem creating scale")); - BrApiScale scaleOnlyDbId = new BrApiScale(); - scaleOnlyDbId.setScaleDbId(scaleResponse.getScaleDbId()); - - BrApiTrait traitResponse = trait.orElseThrow(() -> new APIException("BrAPI variable problem creating trait")); - BrApiTrait traitOnlyDbId = new BrApiTrait(); - traitOnlyDbId.setTraitDbId(traitResponse.getTraitDbId()); - - // TODO: this should be a deep copy - BrApiVariable shallowCopy = variable.toBuilder().build(); - shallowCopy.setMethod(methodOnlyDbId); - shallowCopy.setScale(scaleOnlyDbId); - shallowCopy.setTrait(traitOnlyDbId); - variablesWithDbIds.add(shallowCopy); - } - - return variablesWithDbIds; - } - - public List createMethodsScalesTraitsThenVariables(@NonNull List brApiVariables) throws HttpException, APIException { - - if (brApiVariables.isEmpty()) { - throw new APIException("BrAPI variables cannot be empty"); - } - - if (brApiVariables.stream().anyMatch(variable -> variable.getMethod() != null && variable.getObservationVariableDbId() != null)) { - throw new APIException("BrAPI variable must not have an existing observationVariableDbId."); - } - - createMethodsScalesTraits(brApiVariables); - - return createVariables(brApiVariables); - } - - public Optional createMethodScaleTraitThenVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { - - List brApiVariables = new ArrayList<>(); - brApiVariables.add(brApiVariable); - List createdVariables = createMethodsScalesTraitsThenVariables(brApiVariables); - - if (createdVariables.size() == 1){ - return Optional.of(createdVariables.get(0)); - } - else { - return Optional.empty(); - } - } - public Optional updateVariable(@NonNull BrApiVariable brApiVariable) throws HttpException, APIException { if (brApiVariable.getObservationVariableDbId() == null){ @@ -185,7 +88,6 @@ public Optional updateVariable(@NonNull BrApiVariable brApiVariab return updateVariable; } - public List getVariables(@NonNull VariablesRequest variablesRequest) throws HttpException, APIException { // Build our request diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index cf3a4715..4e5e0d4a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -213,150 +213,6 @@ public void createVariablesMultipleSuccess() { assertEquals(brApiVariable2.getObservationVariableName(), createdVariables.get(1).getObservationVariableName(), "Variable name mismatch"); } - @Test - public void createMethodScaleTraitThenVariableIdPresent() { - BrApiVariable brApiVariable = BrApiVariable.builder() - .observationVariableDbId("test") - .build(); - APIException exception = assertThrows(APIException.class, () -> { - Optional variable = variablesAPI.createMethodScaleTraitThenVariable(brApiVariable); - }); - } - - @Test - public void createMethodScaleTraitThenVariableNull() { - IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { - Optional variable = variablesAPI.createMethodScaleTraitThenVariable(null); - }); - } - - @Test - public void createMethodScaleTraitThenVariableMultipleIdPresent() { - BrApiVariable brApiVariable = BrApiVariable.builder() - .observationVariableDbId("test") - .build(); - BrApiVariable brApiVariable1 = new BrApiVariable(); - List brApiVariables = new ArrayList<>(); - brApiVariables.add(brApiVariable); - brApiVariables.add(brApiVariable1); - - APIException exception = assertThrows(APIException.class, () -> { - List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); - }); - } - - @Test - public void createMethodsScalesTraitsThenVariablesMultipleEmptyList() { - - List brApiVariables = new ArrayList<>(); - - APIException exception = assertThrows(APIException.class, () -> { - List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); - }); - } - - @Test - public void createMethodsScalesTraitsThenVariablesMultipleNull() { - - IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> { - List variables = variablesAPI.createMethodsScalesTraitsThenVariables(null); - }); - } - - @Test - public void createMethodsScalesTraitsThenVariablesNullTraitMethodScale() { - - BrApiVariable brApiVariable = BrApiVariable.builder() - .build(); - ArrayList brApiVariables = new ArrayList<>(); - brApiVariables.add(brApiVariable); - - APIException exception = assertThrows(APIException.class, () -> { - List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); - }); - } - - @Test - public void createMethodsScalesTraitsThenVariablesExistingTraitMethodScaleDbId() { - - BrApiMethod method = BrApiMethod.builder() - .methodDbId("testDbId") - .build(); - - BrApiVariable brApiVariable = BrApiVariable.builder() - .method(method) - .build(); - ArrayList brApiVariables = new ArrayList<>(); - brApiVariables.add(brApiVariable); - - APIException exception = assertThrows(APIException.class, () -> { - List variables = variablesAPI.createMethodsScalesTraitsThenVariables(brApiVariables); - }); - } - - - - - @Test - @Order(1) - @SneakyThrows - public void createMethodsScalesTraitsThenVariablesSuccess() { - - BrApiVariable brApiVariable = buildTestVariable(); - - Optional createdVariable = variablesAPI.createMethodScaleTraitThenVariable(brApiVariable); - - assertTrue(createdVariable.isPresent()); - BrApiVariable variable = createdVariable.get(); - - assertFalse(variable.getObservationVariableDbId() == null, "Variable id missing"); - variableAssertEquals(brApiVariable, variable); - - //this.createdVariable = variable; - } - - @Test - @Order(1) - @SneakyThrows - public void createMethodsScalesTraitsThenVariablesMultipleSuccess() { - - BrApiMethod method = BrApiMethod.builder() - .methodName("test method") - .build(); - BrApiScale scale = BrApiScale.builder() - .scaleName("test scale") - .build(); - BrApiTrait trait = BrApiTrait.builder() - .traitName("test trait") - .build(); - - BrApiVariable brApiVariable = BrApiVariable.builder() - .observationVariableName("new test variable1") - .method(method) - .scale(scale) - .trait(trait) - .build(); - BrApiVariable brApiVariable2 = BrApiVariable.builder() - .observationVariableName("new test variable2") - .method(method) - .scale(scale) - .trait(trait) - .build(); - List variables = new ArrayList<>(); - variables.add(brApiVariable); - variables.add(brApiVariable2); - - List createdVariables = variablesAPI.createMethodsScalesTraitsThenVariables(variables); - - assertEquals(true, createdVariables.size() == 2); - assertEquals(true, createdVariables.get(0).getObservationVariableDbId() != null, "Variable id missing"); - assertEquals(true, createdVariables.get(1).getObservationVariableDbId() != null, "Variable id missing"); - - assertEquals(brApiVariable.getObservationVariableName(), createdVariables.get(0).getObservationVariableName(), "Variable name mismatch"); - assertEquals(brApiVariable2.getObservationVariableName(), createdVariables.get(1).getObservationVariableName(), "Variable name mismatch"); - } - - @Test @SneakyThrows @Order(2) From d9424c4d894bf009e18cd39317fb7cfb6b77160b Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Wed, 3 Jun 2020 12:46:24 -0400 Subject: [PATCH 61/71] Added lombok setup section --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 24776bf7..34a06fc1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # brapi A java project with modules to interact with BrAPI data. + +## Development Environment Setup +This project uses lombok so your development environment has to be configured to handle the lombok annotations. Instructions for popular editors are available [here](https://projectlombok.org/setup/overview). From e16ce866a7c1431a189fae9567d3d38452f86513 Mon Sep 17 00:00:00 2001 From: Chris T Date: Wed, 3 Jun 2020 12:17:13 -0400 Subject: [PATCH 62/71] fix external reference data type --- .../java/org/brapi/v2/core/model/BrApiExternalReference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java index 0a042c51..2a3c8e34 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java @@ -12,7 +12,7 @@ @SuperBuilder @NoArgsConstructor public class BrApiExternalReference { - private Object referenceID; + private String referenceID; private String referenceSource; From 334238e490f9f63b9a14ccd014bf7f4fbffdbecc Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 10:43:32 -0400 Subject: [PATCH 63/71] Added headers to brapi-core-model --- brapi-core-model/pom.xml | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiContact.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiDataFile.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiDataLink.java | 17 +++++++++++++++++ .../v2/core/model/BrApiDatasetAuthorships.java | 17 +++++++++++++++++ .../java/org/brapi/v2/core/model/BrApiEnum.java | 17 +++++++++++++++++ .../core/model/BrApiEnvironmentParameter.java | 17 +++++++++++++++++ .../v2/core/model/BrApiExperimentalDesign.java | 17 +++++++++++++++++ .../v2/core/model/BrApiExternalReference.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiGeoJSON.java | 17 +++++++++++++++++ .../v2/core/model/BrApiGrowthFacility.java | 17 +++++++++++++++++ .../brapi/v2/core/model/BrApiLastUpdate.java | 17 +++++++++++++++++ .../brapi/v2/core/model/BrApiLinearRing.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiLocation.java | 17 +++++++++++++++++ ...ApiModel202AcceptedSearchResponseResult.java | 17 +++++++++++++++++ .../core/model/BrApiOneOfGeoJSONGeometry.java | 17 +++++++++++++++++ .../BrApiOneOfGeoJSONSearchAreaGeometry.java | 17 +++++++++++++++++ .../v2/core/model/BrApiOntologyReference.java | 17 +++++++++++++++++ ...rApiOntologyReferenceDocumentationLinks.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiPerson.java | 17 +++++++++++++++++ .../brapi/v2/core/model/BrApiPointGeometry.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiPolygon.java | 17 +++++++++++++++++ .../v2/core/model/BrApiPolygonGeometry.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiPosition.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiProgram.java | 17 +++++++++++++++++ .../v2/core/model/BrApiRequestPublications.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiSeason.java | 17 +++++++++++++++++ .../brapi/v2/core/model/BrApiServerInfo.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiService.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiStudy.java | 17 +++++++++++++++++ .../org/brapi/v2/core/model/BrApiTrial.java | 17 +++++++++++++++++ .../v2/core/model/BrApiWSMIMEDataTypes.java | 17 +++++++++++++++++ .../v2/core/model/request/BaseRequest.java | 17 +++++++++++++++++ .../v2/core/model/request/ProgramsRequest.java | 17 +++++++++++++++++ .../v2/core/model/response/BrAPIResponse.java | 17 +++++++++++++++++ .../v2/core/model/response/DataResponse.java | 17 +++++++++++++++++ .../brapi/v2/core/model/response/Metadata.java | 17 +++++++++++++++++ .../core/model/response/MetadataPagination.java | 17 +++++++++++++++++ .../brapi/v2/core/model/response/Status.java | 17 +++++++++++++++++ 39 files changed, 663 insertions(+) diff --git a/brapi-core-model/pom.xml b/brapi-core-model/pom.xml index ad2f1fc5..68469662 100644 --- a/brapi-core-model/pom.xml +++ b/brapi-core-model/pom.xml @@ -1,4 +1,21 @@ + + diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java index d5572817..059a7273 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java index 2064fc16..9ee95518 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java index 227bea26..76d8caa3 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java index aac7ceb6..fb741cf4 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java index 0832258a..13f51034 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnum.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; public interface BrApiEnum { diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java index 2fd69d7a..8bf7aa44 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java index 871f8524..e36d4a4c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java index 2a3c8e34..a2dc9212 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java index 1ff2bd83..b61366b5 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java index 77b79bd5..ad7ddf8c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java index 5a36c6f5..c48051f0 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java index b68548bd..8fe050c7 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLinearRing.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import lombok.EqualsAndHashCode; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java index 42aec7b5..0a8e811c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java index 40bad675..c2eee1e8 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java index d3b5162b..1ffad2c0 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONGeometry.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java index 5f2192a9..5755288e 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOneOfGeoJSONSearchAreaGeometry.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java index 046d8780..0ae0c983 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java index 3e44ae31..40d0c3e3 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java index c6b69e2a..64857924 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java index 951f7d22..5ed4bb2f 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java index 89df982b..82c94810 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygon.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import lombok.EqualsAndHashCode; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java index 61c4ed7c..3e7d95f9 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java index 46758069..5e26d40b 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPosition.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import lombok.EqualsAndHashCode; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index e5fc24c7..a3570e75 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java index f5f8f77a..6e7322ae 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java index 8a914ff0..062ffcae 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java index ea71d5d7..c56ae35b 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java index 0f1d8570..7a98f11b 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java index 863f048e..243bcf82 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java index 590e8bc2..15523aff 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java index 2de9b571..32bcb00a 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java index 5c1440a2..1362283f 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model.request; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java index 1d8332cf..c1410e71 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.v2.core.model.request; import lombok.*; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java index 900b0c3e..0a34bc1c 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/BrAPIResponse.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + /* * BrAPI * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java index e37f5a75..7f62517e 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + /* * BrAPI * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java index 7da8a28f..cede3e59 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Metadata.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + /* * BrAPI * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java index 49b8cf68..5b119e5f 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/MetadataPagination.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + /* * BrAPI * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java index 04fabd5c..0ec1c481 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/Status.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + /* * BrAPI * The Breeding API (BrAPI) is a Standardized RESTful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. General Reference Documentation URL Structure Response Structure Date/Time Encoding Location Encoding Error Handling Search Services Asynchronous Processing From 1695c5b397787e3b952dc869258b0cb65e9fa142 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 10:54:56 -0400 Subject: [PATCH 64/71] Removed unused imports in brapi-core-model --- .../src/main/java/org/brapi/v2/core/model/BrApiContact.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiDataFile.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiDataLink.java | 1 - .../org/brapi/v2/core/model/BrApiDatasetAuthorships.java | 2 -- .../org/brapi/v2/core/model/BrApiEnvironmentParameter.java | 1 - .../org/brapi/v2/core/model/BrApiExperimentalDesign.java | 1 - .../java/org/brapi/v2/core/model/BrApiExternalReference.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java | 1 - .../java/org/brapi/v2/core/model/BrApiGrowthFacility.java | 1 - .../main/java/org/brapi/v2/core/model/BrApiLastUpdate.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiLocation.java | 1 - .../model/BrApiModel202AcceptedSearchResponseResult.java | 1 - .../java/org/brapi/v2/core/model/BrApiOntologyReference.java | 1 - .../core/model/BrApiOntologyReferenceDocumentationLinks.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiPerson.java | 1 - .../java/org/brapi/v2/core/model/BrApiPointGeometry.java | 1 - .../java/org/brapi/v2/core/model/BrApiPolygonGeometry.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiProgram.java | 1 - .../org/brapi/v2/core/model/BrApiRequestPublications.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiSeason.java | 1 - .../main/java/org/brapi/v2/core/model/BrApiServerInfo.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiService.java | 3 --- .../src/main/java/org/brapi/v2/core/model/BrApiStudy.java | 1 - .../src/main/java/org/brapi/v2/core/model/BrApiTrial.java | 1 - .../java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java | 3 --- .../java/org/brapi/v2/core/model/request/BaseRequest.java | 4 ++-- .../org/brapi/v2/core/model/request/ProgramsRequest.java | 5 ++++- .../java/org/brapi/v2/core/model/response/DataResponse.java | 2 -- 28 files changed, 6 insertions(+), 35 deletions(-) diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java index 059a7273..fc9ebaa1 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiContact.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java index 9ee95518..25996d38 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataFile.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java index 76d8caa3..3d1b9392 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDataLink.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java index fb741cf4..a0a4e082 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiDatasetAuthorships.java @@ -17,8 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java index 8bf7aa44..03988a2d 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiEnvironmentParameter.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java index e36d4a4c..df0c3e56 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExperimentalDesign.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java index a2dc9212..54932589 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiExternalReference.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java index b61366b5..33dbac57 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGeoJSON.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java index ad7ddf8c..f0cc314e 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiGrowthFacility.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java index c48051f0..46ebdbd1 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLastUpdate.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java index 0a8e811c..7ec7b952 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiLocation.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java index c2eee1e8..7ce1ca3d 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiModel202AcceptedSearchResponseResult.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java index 0ae0c983..fb37b588 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReference.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java index 40d0c3e3..244cde63 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiOntologyReferenceDocumentationLinks.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java index 64857924..d0d66f65 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPerson.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java index 5ed4bb2f..86475b91 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPointGeometry.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java index 3e7d95f9..f45b497a 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiPolygonGeometry.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java index a3570e75..5daab671 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiProgram.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java index 6e7322ae..c891a7ca 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiRequestPublications.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java index 062ffcae..599e55da 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiSeason.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java index c56ae35b..09406bb3 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiServerInfo.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java index 7a98f11b..8e95b1bc 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiService.java @@ -17,9 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java index 243bcf82..8d449544 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiStudy.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java index 15523aff..869d1ea9 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiTrial.java @@ -17,7 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java index 32bcb00a..eb6afda5 100755 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/BrApiWSMIMEDataTypes.java @@ -17,9 +17,6 @@ package org.brapi.v2.core.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Gets or Sets WSMIMEDataTypes */ diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java index 1362283f..19e81a11 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/BaseRequest.java @@ -18,8 +18,8 @@ package org.brapi.v2.core.model.request; -import lombok.*; -import lombok.experimental.Accessors; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import java.util.HashMap; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java index c1410e71..0d7cbf27 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/request/ProgramsRequest.java @@ -17,7 +17,10 @@ package org.brapi.v2.core.model.request; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; diff --git a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java index 7f62517e..f4fc647f 100644 --- a/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java +++ b/brapi-core-model/src/main/java/org/brapi/v2/core/model/response/DataResponse.java @@ -29,8 +29,6 @@ package org.brapi.v2.core.model.response; -import com.fasterxml.jackson.annotation.JsonProperty; - import lombok.*; import lombok.experimental.Accessors; From f850a3aa21581ff03ced4b3ddc5b680d62942d6b Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 11:16:01 -0400 Subject: [PATCH 65/71] Added headers to brapi-pheno-model --- brapi-pheno-model/pom.xml | 17 +++++++++++++++++ brapi-pheno-model/settings.xml | 17 +++++++++++++++++ .../brapi/v2/phenotyping/model/BrApiEvent.java | 17 +++++++++++++++++ .../phenotyping/model/BrApiEventParameters.java | 17 +++++++++++++++++ .../brapi/v2/phenotyping/model/BrApiImage.java | 17 +++++++++++++++++ .../brapi/v2/phenotyping/model/BrApiMethod.java | 17 +++++++++++++++++ .../v2/phenotyping/model/BrApiObservation.java | 17 +++++++++++++++++ .../model/BrApiObservationLevel.java | 17 +++++++++++++++++ .../model/BrApiObservationTable.java | 17 +++++++++++++++++ .../model/BrApiObservationTreatment.java | 17 +++++++++++++++++ .../phenotyping/model/BrApiObservationUnit.java | 17 +++++++++++++++++ .../model/BrApiObservationUnitPosition.java | 17 +++++++++++++++++ .../model/BrApiObservationUnitTable.java | 17 +++++++++++++++++ ...bservationUnitTableObservationVariables.java | 17 +++++++++++++++++ .../model/BrApiObservationVariable.java | 17 +++++++++++++++++ .../v2/phenotyping/model/BrApiOntology.java | 17 +++++++++++++++++ .../brapi/v2/phenotyping/model/BrApiScale.java | 17 +++++++++++++++++ .../phenotyping/model/BrApiScaleCategories.java | 17 +++++++++++++++++ .../model/BrApiScaleValidValues.java | 17 +++++++++++++++++ .../brapi/v2/phenotyping/model/BrApiTrait.java | 17 +++++++++++++++++ .../phenotyping/model/BrApiTraitDataType.java | 17 +++++++++++++++++ .../v2/phenotyping/model/BrApiVariable.java | 17 +++++++++++++++++ .../v2/phenotyping/model/HeaderRowName.java | 17 +++++++++++++++++ .../model/request/MethodsRequest.java | 17 +++++++++++++++++ .../request/ObservationVariablesRequest.java | 17 +++++++++++++++++ .../model/request/ScalesRequest.java | 17 +++++++++++++++++ .../model/request/TraitsRequest.java | 17 +++++++++++++++++ .../model/request/VariablesRequest.java | 17 +++++++++++++++++ 28 files changed, 476 insertions(+) diff --git a/brapi-pheno-model/pom.xml b/brapi-pheno-model/pom.xml index d4842e3c..c12f7f36 100644 --- a/brapi-pheno-model/pom.xml +++ b/brapi-pheno-model/pom.xml @@ -1,4 +1,21 @@ + + diff --git a/brapi-pheno-model/settings.xml b/brapi-pheno-model/settings.xml index 737451f0..092b1dae 100644 --- a/brapi-pheno-model/settings.xml +++ b/brapi-pheno-model/settings.xml @@ -1,3 +1,20 @@ + + Date: Mon, 29 Jun 2020 11:23:11 -0400 Subject: [PATCH 66/71] Remove unused imports from brapi-pheno-model --- .../main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java | 1 - .../org/brapi/v2/phenotyping/model/BrApiEventParameters.java | 1 - .../main/java/org/brapi/v2/phenotyping/model/BrApiImage.java | 1 - .../java/org/brapi/v2/phenotyping/model/BrApiMethod.java | 1 - .../org/brapi/v2/phenotyping/model/BrApiObservation.java | 1 - .../brapi/v2/phenotyping/model/BrApiObservationLevel.java | 2 -- .../brapi/v2/phenotyping/model/BrApiObservationTable.java | 1 - .../v2/phenotyping/model/BrApiObservationTreatment.java | 1 - .../org/brapi/v2/phenotyping/model/BrApiObservationUnit.java | 1 - .../v2/phenotyping/model/BrApiObservationUnitPosition.java | 1 - .../v2/phenotyping/model/BrApiObservationUnitTable.java | 1 - .../model/BrApiObservationUnitTableObservationVariables.java | 1 - .../brapi/v2/phenotyping/model/BrApiObservationVariable.java | 1 - .../java/org/brapi/v2/phenotyping/model/BrApiOntology.java | 1 - .../main/java/org/brapi/v2/phenotyping/model/BrApiScale.java | 1 - .../org/brapi/v2/phenotyping/model/BrApiScaleCategories.java | 1 - .../brapi/v2/phenotyping/model/BrApiScaleValidValues.java | 1 - .../main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java | 1 - .../java/org/brapi/v2/phenotyping/model/BrApiVariable.java | 2 -- .../java/org/brapi/v2/phenotyping/model/HeaderRowName.java | 2 -- .../brapi/v2/phenotyping/model/request/TraitsRequest.java | 5 ++++- 21 files changed, 4 insertions(+), 24 deletions(-) diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java index 4692a8f0..fee4c1de 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEvent.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java index 192a52e8..acd3effb 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiEventParameters.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java index c7554c69..169cb2e8 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiImage.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java index a92f6204..73746abf 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiMethod.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java index 5ec9d853..4b9f716d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservation.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java index 67d53a38..43bc142a 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationLevel.java @@ -17,8 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; import org.brapi.v2.core.model.BrApiEnum; /** diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java index fc4c4eae..d49cc52b 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTable.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java index 82d3f8a6..f646db5b 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationTreatment.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java index d2d7e4e6..f7dd5164 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnit.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java index 195cf040..b89e58c4 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitPosition.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java index ca89a2b4..90486b6f 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTable.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java index 78e799fe..a5fade43 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationUnitTableObservationVariables.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java index 5f77f7dc..3dde04d7 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiObservationVariable.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java index d8386b90..3df45ca3 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiOntology.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java index b0910f0f..54f3d8d3 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScale.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java index d39023d1..274012bb 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleCategories.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java index 5c3bb93f..e4a0baf8 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiScaleValidValues.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java index 5daab0c9..053cf02d 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiTrait.java @@ -17,7 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java index 26bb8728..dcd99c6f 100755 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/BrApiVariable.java @@ -17,8 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java index 1fbc8251..98ecea36 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/HeaderRowName.java @@ -17,8 +17,6 @@ package org.brapi.v2.phenotyping.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; import org.brapi.v2.core.model.BrApiEnum; /** diff --git a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java index 07408440..43f11ba5 100644 --- a/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java +++ b/brapi-pheno-model/src/main/java/org/brapi/v2/phenotyping/model/request/TraitsRequest.java @@ -17,7 +17,10 @@ package org.brapi.v2.phenotyping.model.request; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; import lombok.experimental.Accessors; import lombok.experimental.SuperBuilder; From 32e273f24f7bfb70e419fa805a6065538ef75085 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 11:49:07 -0400 Subject: [PATCH 67/71] Added headers to brapi-client --- brapi-client/lombok.config | 17 +++++++++++++++++ brapi-client/pom.xml | 17 +++++++++++++++++ .../java/org/brapi/client/v2/BrAPIClient.java | 17 +++++++++++++++++ .../java/org/brapi/client/v2/BrAPIEndpoint.java | 17 +++++++++++++++++ .../org/brapi/client/v2/BrAPIEndpoints_V2.java | 17 +++++++++++++++++ .../client/v2/BrApiEnumTypeAdapterFactory.java | 17 +++++++++++++++++ .../client/v2/ResponseHandlerFunction.java | 17 +++++++++++++++++ .../org/brapi/client/v2/model/BrAPIRequest.java | 17 +++++++++++++++++ .../org/brapi/client/v2/model/HttpMethod.java | 17 +++++++++++++++++ .../v2/model/exceptions/APIException.java | 17 +++++++++++++++++ .../exceptions/HttpBadRequestException.java | 17 +++++++++++++++++ .../v2/model/exceptions/HttpException.java | 17 +++++++++++++++++ .../exceptions/HttpForbiddenException.java | 17 +++++++++++++++++ .../exceptions/HttpInternalServerError.java | 17 +++++++++++++++++ .../model/exceptions/HttpNotFoundException.java | 17 +++++++++++++++++ .../exceptions/HttpUnauthorizedException.java | 17 +++++++++++++++++ .../v2/modules/core/BrAPICoreEndpoints_V2.java | 17 +++++++++++++++++ .../client/v2/modules/core/ProgramsAPI.java | 17 +++++++++++++++++ .../genotype/BrAPIGenotypeEndpoints_V2.java | 17 +++++++++++++++++ .../germplasm/BrAPIGermplasmEndpoints_V2.java | 17 +++++++++++++++++ .../phenotype/BrAPIPhenotypeEndpoints_V2.java | 17 +++++++++++++++++ .../client/v2/modules/phenotype/MethodsAPI.java | 17 +++++++++++++++++ .../client/v2/modules/phenotype/ScalesAPI.java | 17 +++++++++++++++++ .../client/v2/modules/phenotype/TraitsAPI.java | 17 +++++++++++++++++ .../v2/modules/phenotype/VariablesAPI.java | 17 +++++++++++++++++ .../org/brapi/client/v2/BrAPIClientTest.java | 17 +++++++++++++++++ .../org/brapi/client/v2/MockedBrAPIClient.java | 17 +++++++++++++++++ .../client/v2/modules/BrAPIClientUnitTests.java | 17 +++++++++++++++++ .../v2/modules/core/ProgramAPIUnitTests.java | 17 +++++++++++++++++ .../v2/modules/core/ProgramsAPITests.java | 17 +++++++++++++++++ .../v2/modules/phenotype/MethodsAPITests.java | 17 +++++++++++++++++ .../modules/phenotype/MethodsAPIUnitTests.java | 17 +++++++++++++++++ .../v2/modules/phenotype/ScalesAPITests.java | 17 +++++++++++++++++ .../modules/phenotype/ScalesAPIUnitTests.java | 17 +++++++++++++++++ .../v2/modules/phenotype/TraitsAPITests.java | 17 +++++++++++++++++ .../modules/phenotype/TraitsAPIUnitTests.java | 17 +++++++++++++++++ .../v2/modules/phenotype/VariablesAPITests.java | 17 +++++++++++++++++ .../phenotype/VariablesAPIUnitTests.java | 17 +++++++++++++++++ 38 files changed, 646 insertions(+) diff --git a/brapi-client/lombok.config b/brapi-client/lombok.config index f5e94db5..47f3d21c 100644 --- a/brapi-client/lombok.config +++ b/brapi-client/lombok.config @@ -1,2 +1,19 @@ +# +# See the NOTICE file distributed with this work for additional information +# regarding copyright ownership. +# +# 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. +# + lombok.nonNull.exceptionType = IllegalArgumentException lombok.nonNull.flagUsage = [warning | error] \ No newline at end of file diff --git a/brapi-client/pom.xml b/brapi-client/pom.xml index 768d0776..77736c3c 100644 --- a/brapi-client/pom.xml +++ b/brapi-client/pom.xml @@ -1,4 +1,21 @@ + + diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java index fdfea91d..f77c1b11 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIClient.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import com.google.gson.*; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java index 54d36c05..d86f43b5 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoint.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import lombok.AccessLevel; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java index fcfd2467..882ba3a2 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrAPIEndpoints_V2.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; public abstract class BrAPIEndpoints_V2 { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java b/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java index 0f175f36..c67d9529 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/BrApiEnumTypeAdapterFactory.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import com.google.gson.Gson; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java b/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java index 0c2a3f14..9a12429b 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/ResponseHandlerFunction.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import com.google.gson.Gson; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java b/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java index 22267f88..8f78453d 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/BrAPIRequest.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model; import lombok.Builder; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java b/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java index 9777af87..22d99de8 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/HttpMethod.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model; public enum HttpMethod { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java index 37063c14..663f8d98 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/APIException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class APIException extends Exception { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java index d09088b3..d040e63e 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpBadRequestException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpBadRequestException extends HttpException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java index 93ae49b3..bbccb643 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpException extends Exception { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java index 59fae944..c85735ea 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpForbiddenException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpForbiddenException extends HttpException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java index dea7a8fe..7fde4368 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpInternalServerError.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpInternalServerError extends HttpException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java index cdcba352..197364a4 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpNotFoundException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpNotFoundException extends HttpException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java index 6dd0d39c..da9445cb 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/model/exceptions/HttpUnauthorizedException.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.model.exceptions; public class HttpUnauthorizedException extends HttpException { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java index ab6b1849..bbc217f3 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/BrAPICoreEndpoints_V2.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.core; import org.brapi.client.v2.BrAPIEndpoints_V2; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java index 011aa682..baaa7d16 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/core/ProgramsAPI.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.core; import com.google.gson.reflect.TypeToken; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java index f78be2c1..156c1914 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/genotype/BrAPIGenotypeEndpoints_V2.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.genotype; public class BrAPIGenotypeEndpoints_V2 { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java index 9e753ce2..39af38b6 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/germplasm/BrAPIGermplasmEndpoints_V2.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.germplasm; public class BrAPIGermplasmEndpoints_V2 { diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java index 52ff8b2b..f4b1afcc 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/BrAPIPhenotypeEndpoints_V2.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import org.brapi.client.v2.BrAPIEndpoints_V2; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java index 199dedd7..038b4b48 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/MethodsAPI.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java index 2cc1c6a9..2caa907e 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/ScalesAPI.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java index 0e5c3a89..d5a7f721 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/TraitsAPI.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; diff --git a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java index 739466bc..613075f8 100644 --- a/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java +++ b/brapi-client/src/main/java/org/brapi/client/v2/modules/phenotype/VariablesAPI.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import com.google.gson.reflect.TypeToken; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java b/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java index 85b43cc6..04f7012e 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/BrAPIClientTest.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import org.brapi.client.v2.BrAPIClient; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java b/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java index b71caaeb..6f2b51d8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/MockedBrAPIClient.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2; import lombok.Getter; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java index 84432c32..9e7e9208 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/BrAPIClientUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java index 18d4ba38..04498e8f 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramAPIUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.core; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java index 85c6149e..b62bd936 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/core/ProgramsAPITests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.core; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java index 74966207..b9f4c1a5 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPITests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java index 4823ae5e..e22a3ed7 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/MethodsAPIUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java index 6741303b..3bc11c8a 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPITests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java index ce605a9a..7994477c 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/ScalesAPIUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java index 001d4554..1528db72 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPITests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java index 8b5dc085..58270ba8 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/TraitsAPIUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java index 4e5e0d4a..7256d733 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPITests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; diff --git a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java index bfe084e1..9bc061b7 100644 --- a/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java +++ b/brapi-client/src/test/java/org/brapi/client/v2/modules/phenotype/VariablesAPIUnitTests.java @@ -1,3 +1,20 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + package org.brapi.client.v2.modules.phenotype; import lombok.SneakyThrows; From a1191ca0a128fe475bac631980169c1638fa56ee Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 11:50:26 -0400 Subject: [PATCH 68/71] Added header to project pom --- pom.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pom.xml b/pom.xml index c2e9ea59..f5d92e21 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,22 @@ + + 4.0.0 From 20e4323e2c1451b5dafb58e201c9bff8768c9d5c Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 11:55:12 -0400 Subject: [PATCH 69/71] Changed to apache license and added notice --- LICENSE | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++------ NOTICE | 13 ++++ 2 files changed, 189 insertions(+), 21 deletions(-) create mode 100644 NOTICE diff --git a/LICENSE b/LICENSE index 87f89622..d9a10c0d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,176 @@ -MIT License - -Copyright (c) 2020 Breeding Insight - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000..779787aa --- /dev/null +++ b/NOTICE @@ -0,0 +1,13 @@ +Copyright 2020 Breeding Insight + +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. From 1d7fc98b8096c85076319733ee024edde61591c5 Mon Sep 17 00:00:00 2001 From: Nick Palladino Date: Mon, 29 Jun 2020 20:00:46 -0400 Subject: [PATCH 70/71] Remove old mit license files --- brapi-core-model/LICENSE | 21 --------------------- brapi-pheno-model/LICENSE | 21 --------------------- 2 files changed, 42 deletions(-) delete mode 100644 brapi-core-model/LICENSE delete mode 100644 brapi-pheno-model/LICENSE diff --git a/brapi-core-model/LICENSE b/brapi-core-model/LICENSE deleted file mode 100644 index 87f89622..00000000 --- a/brapi-core-model/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Breeding Insight - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/brapi-pheno-model/LICENSE b/brapi-pheno-model/LICENSE deleted file mode 100644 index 87f89622..00000000 --- a/brapi-pheno-model/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Breeding Insight - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From e270d23ccc6ee20ac549a2f0da692cbcce49f5b0 Mon Sep 17 00:00:00 2001 From: fossabot Date: Mon, 29 Jun 2020 13:26:43 -0700 Subject: [PATCH 71/71] Add license scan report and status Signed off by: fossabot --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 34a06fc1..d381fd01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # brapi +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FBreeding-Insight%2Fbrapi.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FBreeding-Insight%2Fbrapi?ref=badge_shield) + A java project with modules to interact with BrAPI data. ## Development Environment Setup This project uses lombok so your development environment has to be configured to handle the lombok annotations. Instructions for popular editors are available [here](https://projectlombok.org/setup/overview). + + +## License +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FBreeding-Insight%2Fbrapi.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FBreeding-Insight%2Fbrapi?ref=badge_large) \ No newline at end of file