https://github.com/mbari-org/annosaurus-java-sdk
A Java client SDK for the Annosaurus microservice.
https://github.com/mbari-org/annosaurus-java-sdk
Last synced: 10 months ago
JSON representation
A Java client SDK for the Annosaurus microservice.
- Host: GitHub
- URL: https://github.com/mbari-org/annosaurus-java-sdk
- Owner: mbari-org
- License: apache-2.0
- Created: 2024-12-03T18:33:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-29T22:03:57.000Z (12 months ago)
- Last Synced: 2025-01-29T22:31:26.911Z (12 months ago)
- Language: Java
- Homepage: https://mbari-org.github.io/annosaurus-java-sdk
- Size: 150 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# annosaurus-java-sdk
This is a client SDK for interacting with the [annosaurus](https://github.com/mbari-org/annosaurus) microservice. It's mostly auto-generated using [Kiota](https://learn.microsoft.com/en-us/openapi/kiota/overview).
## Usage
```xml
org.mbari.vars
annosaurus-java-sdk
0.0.1
```
```java
var baseUrl = "http://localhost/anno/v1" // Substitute yoru services URL
var apiKey = "foobar" // Substitute your services API KEY
// -- Kiota API
var annosaurus = AnnosaurusFactory.create(baseUrl, apiKey)
// Use the service! Some examples.
// Get 1000 annotations
List annos = annosaurus.v1().fast().get(gcr -> gcr.queryParameters.limit = 10000);
// Request annotations by a video reference uuid (a unique key for a video)
var multiRequest = new MultiRequestSC();
multiRequest.setVideoReferenceUuids(List.of(UUID.fromString("feefe228-c503-4add-ae19-9cd713ee2175")));
var annos = annosaurus.v1().fast().multi().post(multiRequest);
// Create an annotation
var annosaurus = AnnosaurusFactory.create(baseUrl, apiKey);
var annotation = new AnnotationCreateSC();
annotation.setConcept("Concept");
annotation.setObserver("Observer");
annotation.setObservationTimestamp("2021-09-01T00:00:00Z");
annotation.setVideoReferenceUuid(UUID.fromString("feefe228-c503-4add-ae19-9cd713ee2175"));
var created = annosaurus.v1().annotations().post(annotation);
// -- AnnotationService APi
var annotationService = new AnnosaurusHttpClient(URI.create(baseUrl), apiKey);
List groups = annotationService.findGroups();
```
## To regenerate the SDK
1. Copy the open api yaml file into each project's src/main/resources folder as docs.yaml
2. Some may need the openapi version changed to 3.0.0 as kiota does not support 3.1.0
3. Run the following command in the project's root directory
```shell
kiota generate -l java -c Annosaurus -n org.mbari.vars.annosaurus.sdk.kiota -d src/main/resources/docs.yaml -o ./src/main/java/org/mbari/vars/annosaurius/sdk/kiota
```