Skip to content

Commit 7fd1a8a

Browse files
committed
docs: generate javadocs with docgenerator
1 parent 60d5598 commit 7fd1a8a

22 files changed

Lines changed: 590 additions & 0 deletions

‎src/main/java/org/typesense/api/Alias.java‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,29 @@ public Alias(ApiCall apiCall, String name) {
1313
this.name = name;
1414
}
1515

16+
/**
17+
* Retrieve an alias.
18+
*
19+
* <p>
20+
* Find out which collection an alias points to by fetching it
21+
*
22+
* <p>
23+
* HTTP: GET /aliases/{aliasName}
24+
*
25+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
26+
*/
1627
public CollectionAlias retrieve() throws Exception {
1728
return this.apiCall.get(this.getEndpoint(), null, CollectionAlias.class);
1829
}
1930

31+
/**
32+
* Delete an alias.
33+
*
34+
* <p>
35+
* HTTP: DELETE /aliases/{aliasName}
36+
*
37+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
38+
*/
2039
public CollectionAlias delete() throws Exception {
2140
return this.apiCall.delete(this.getEndpoint(), null, CollectionAlias.class);
2241
}

‎src/main/java/org/typesense/api/Aliases.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,33 @@ public Aliases(ApiCall apiCall) {
1414
this.apiCall = apiCall;
1515
}
1616

17+
/**
18+
* Create or update a collection alias.
19+
*
20+
* <p>
21+
* Create or update a collection alias. An alias is a virtual collection name that points to a real collection. If you're familiar with symbolic links on Linux, it's very similar to that. Aliases are useful when you want to reindex your data in the background on a new collection and switch your application to it without any changes to your code.
22+
*
23+
* <p>
24+
* HTTP: PUT /aliases/{aliasName}
25+
*
26+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
27+
*/
1728
public CollectionAlias upsert(String name, CollectionAliasSchema collectionAliasSchema) throws Exception {
1829
return this.apiCall.put(RESOURCE_PATH + "/" + URLEncoding.encodeURIComponent(name), collectionAliasSchema, null,
1930
CollectionAlias.class);
2031
}
2132

33+
/**
34+
* List all aliases.
35+
*
36+
* <p>
37+
* List all aliases and the corresponding collections that they map to.
38+
*
39+
* <p>
40+
* HTTP: GET /aliases
41+
*
42+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
43+
*/
2244
public CollectionAliasesResponse retrieve() throws Exception {
2345
return this.apiCall.get(RESOURCE_PATH, null, CollectionAliasesResponse.class);
2446
}

‎src/main/java/org/typesense/api/AnalyticsEvents.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,32 @@ public AnalyticsEvents(ApiCall apiCall) {
1313
this.apiCall = apiCall;
1414
}
1515

16+
/**
17+
* Create an analytics event.
18+
*
19+
* <p>
20+
* Submit a single analytics event. The event must correspond to an existing analytics rule by name.
21+
*
22+
* <p>
23+
* HTTP: POST /analytics/events
24+
*
25+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
26+
*/
1627
public AnalyticsEventCreateResponse create(AnalyticsEvent event) throws Exception {
1728
return this.apiCall.post(RESOURCE_PATH, event, null, AnalyticsEventCreateResponse.class);
1829
}
1930

31+
/**
32+
* Retrieve analytics events.
33+
*
34+
* <p>
35+
* Retrieve the most recent events for a user and rule.
36+
*
37+
* <p>
38+
* HTTP: GET /analytics/events
39+
*
40+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
41+
*/
2042
public AnalyticsEventsResponse retrieve(Map<String, Object> params) throws Exception {
2143
return this.apiCall.get(RESOURCE_PATH, params, AnalyticsEventsResponse.class);
2244
}

‎src/main/java/org/typesense/api/AnalyticsRule.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,51 @@ public AnalyticsRule(String ruleId, ApiCall apiCall, AnalyticsRuleSerializer ser
2020
this.serializer = serializer;
2121
}
2222

23+
/**
24+
* Retrieves an analytics rule.
25+
*
26+
* <p>
27+
* Retrieve the details of an analytics rule, given it's name
28+
*
29+
* <p>
30+
* HTTP: GET /analytics/rules/{ruleName}
31+
*
32+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
33+
*/
2334
public org.typesense.model.AnalyticsRule retrieve() throws Exception {
2435
String response = this.apiCall.get(this.getEndpoint(), null, String.class);
2536
return serializer.parseFromJson(response);
2637
}
2738

39+
/**
40+
* Delete an analytics rule.
41+
*
42+
* <p>
43+
* Permanently deletes an analytics rule, given it's name
44+
*
45+
* <p>
46+
* HTTP: DELETE /analytics/rules/{ruleName}
47+
*
48+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
49+
*/
2850
public org.typesense.model.AnalyticsRule delete() throws Exception {
2951
String response = this.apiCall.delete(this.getEndpoint(), null, String.class);
3052
org.typesense.model.AnalyticsRule result = new org.typesense.model.AnalyticsRule();
3153
result.name(this.ruleId);
3254
return result;
3355
}
3456

57+
/**
58+
* Upserts an analytics rule.
59+
*
60+
* <p>
61+
* Upserts an analytics rule with the given name.
62+
*
63+
* <p>
64+
* HTTP: PUT /analytics/rules/{ruleName}
65+
*
66+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
67+
*/
3568
public org.typesense.model.AnalyticsRule update(AnalyticsRuleUpdate rule) throws Exception {
3669
return this.apiCall.put(this.getEndpoint(), rule, null, org.typesense.model.AnalyticsRule.class);
3770
}

‎src/main/java/org/typesense/api/AnalyticsRules.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,33 @@ public AnalyticsRules(ApiCall apiCall, AnalyticsRuleSerializer serializer) {
2020
this.serializer = serializer;
2121
}
2222

23+
/**
24+
* Create analytics rule(s).
25+
*
26+
* <p>
27+
* Create one or more analytics rules. You can send a single rule object or an array of rule objects.
28+
*
29+
* <p>
30+
* HTTP: POST /analytics/rules
31+
*
32+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
33+
*/
2334
public AnalyticsRulesResponse create(List<AnalyticsRuleCreate> rules) throws Exception {
2435
String response = this.apiCall.post(RESOURCE_PATH, rules, null, String.class);
2536
return parseCreateResponse(response);
2637
}
2738

39+
/**
40+
* Retrieve analytics rules.
41+
*
42+
* <p>
43+
* Retrieve all analytics rules. Use the optional rule_tag filter to narrow down results.
44+
*
45+
* <p>
46+
* HTTP: GET /analytics/rules
47+
*
48+
* @see <a href="https://typesense.org/docs/latest/api/analytics-query-suggestions.html">Typesense docs</a>
49+
*/
2850
public List<AnalyticsRule> retrieve() throws Exception {
2951
String response = this.apiCall.get(RESOURCE_PATH, null, String.class);
3052
return parseRetrieveResponse(response);

‎src/main/java/org/typesense/api/Collection.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,47 @@ public class Collection {
3434
this.individualSynonyms = new HashMap<>();
3535
}
3636

37+
/**
38+
* Retrieve a single collection.
39+
*
40+
* <p>
41+
* Retrieve the details of a collection, given its name.
42+
*
43+
* <p>
44+
* HTTP: GET /collections/{collectionName}
45+
*
46+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
47+
*/
3748
public CollectionResponse retrieve() throws Exception {
3849
return this.apiCall.get(endpoint, null, CollectionResponse.class);
3950
}
4051

52+
/**
53+
* Update a collection.
54+
*
55+
* <p>
56+
* Update a collection's schema to modify the fields and their types.
57+
*
58+
* <p>
59+
* HTTP: PATCH /collections/{collectionName}
60+
*
61+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
62+
*/
4163
public CollectionUpdateSchema update(CollectionUpdateSchema c) throws Exception {
4264
return this.apiCall.patch(endpoint, c, null, CollectionUpdateSchema.class);
4365
}
4466

67+
/**
68+
* Delete a collection.
69+
*
70+
* <p>
71+
* Permanently drops a collection. This action cannot be undone. For large collections, this might have an impact on read latencies.
72+
*
73+
* <p>
74+
* HTTP: DELETE /collections/{collectionName}
75+
*
76+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
77+
*/
4578
public CollectionResponse delete() throws Exception {
4679
return this.apiCall.delete(endpoint, null, CollectionResponse.class);
4780
}

‎src/main/java/org/typesense/api/Collections.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,47 @@ public Collections(ApiCall apiCall){
1212
this.apiCall = apiCall;
1313
}
1414

15+
/**
16+
* Create a new collection.
17+
*
18+
* <p>
19+
* When a collection is created, we give it a name and describe the fields that will be indexed from the documents added to the collection.
20+
*
21+
* <p>
22+
* HTTP: POST /collections
23+
*
24+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
25+
*/
1526
public CollectionResponse create(CollectionSchema c) throws Exception {
1627
return this.apiCall.post(RESOURCE_PATH, c, null, CollectionResponse.class);
1728
}
1829

30+
/**
31+
* Create a new collection.
32+
*
33+
* <p>
34+
* When a collection is created, we give it a name and describe the fields that will be indexed from the documents added to the collection.
35+
*
36+
* <p>
37+
* HTTP: POST /collections
38+
*
39+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
40+
*/
1941
public CollectionResponse create(String schemaJson) throws Exception {
2042
return this.apiCall.post(RESOURCE_PATH, schemaJson, null, CollectionResponse.class);
2143
}
2244

45+
/**
46+
* List all collections.
47+
*
48+
* <p>
49+
* Returns a summary of all your collections. The collections are returned sorted by creation date, with the most recent collections appearing first.
50+
*
51+
* <p>
52+
* HTTP: GET /collections
53+
*
54+
* @see <a href="https://typesense.org/docs/latest/api/collections.html">Typesense docs</a>
55+
*/
2356
public CollectionResponse[] retrieve() throws Exception {
2457
return this.apiCall.get(RESOURCE_PATH, null, CollectionResponse[].class);
2558
}

‎src/main/java/org/typesense/api/CurationSet.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,47 @@ public CurationSet(String curationSetName, ApiCall apiCall) {
1515
this.apiCall = apiCall;
1616
}
1717

18+
/**
19+
* Retrieve a curation set.
20+
*
21+
* <p>
22+
* Retrieve a specific curation set by its name
23+
*
24+
* <p>
25+
* HTTP: GET /curation_sets/{curationSetName}
26+
*
27+
* @see <a href="https://typesense.org/docs/latest/api/curation.html">Typesense docs</a>
28+
*/
1829
public CurationSetCreateSchema retrieve() throws Exception {
1930
return this.apiCall.get(this.getEndpoint(), null, CurationSetCreateSchema.class);
2031
}
2132

33+
/**
34+
* Create or update a curation set.
35+
*
36+
* <p>
37+
* Create or update a curation set with the given name
38+
*
39+
* <p>
40+
* HTTP: PUT /curation_sets/{curationSetName}
41+
*
42+
* @see <a href="https://typesense.org/docs/latest/api/curation.html">Typesense docs</a>
43+
*/
2244
public CurationSetSchema upsert(CurationSetCreateSchema curationSetCreateSchema) throws Exception {
2345
return this.apiCall.put(this.getEndpoint(), curationSetCreateSchema, null, CurationSetSchema.class);
2446
}
2547

48+
/**
49+
* Delete a curation set.
50+
*
51+
* <p>
52+
* Delete a specific curation set by its name
53+
*
54+
* <p>
55+
* HTTP: DELETE /curation_sets/{curationSetName}
56+
*
57+
* @see <a href="https://typesense.org/docs/latest/api/curation.html">Typesense docs</a>
58+
*/
2659
public CurationSetDeleteSchema delete() throws Exception {
2760
return this.apiCall.delete(this.getEndpoint(), null, CurationSetDeleteSchema.class);
2861
}

‎src/main/java/org/typesense/api/CurationSets.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,32 @@ public CurationSets(ApiCall apiCall) {
1212
this.apiCall = apiCall;
1313
}
1414

15+
/**
16+
* Create or update a curation set.
17+
*
18+
* <p>
19+
* Create or update a curation set with the given name
20+
*
21+
* <p>
22+
* HTTP: PUT /curation_sets/{curationSetName}
23+
*
24+
* @see <a href="https://typesense.org/docs/latest/api/curation.html">Typesense docs</a>
25+
*/
1526
public CurationSetSchema upsert(String curationSetName, CurationSetCreateSchema curationSetCreateSchema) throws Exception {
1627
return this.apiCall.put(getEndpoint(curationSetName), curationSetCreateSchema, null, CurationSetSchema.class);
1728
}
1829

30+
/**
31+
* Retrieve a curation set.
32+
*
33+
* <p>
34+
* Retrieve a specific curation set by its name
35+
*
36+
* <p>
37+
* HTTP: GET /curation_sets/{curationSetName}
38+
*
39+
* @see <a href="https://typesense.org/docs/latest/api/curation.html">Typesense docs</a>
40+
*/
1941
public CurationSetSchema[] retrieve() throws Exception {
2042
return this.apiCall.get(this.getEndpoint(null), null, CurationSetSchema[].class);
2143
}

‎src/main/java/org/typesense/api/Debug.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ public Debug(ApiCall apiCall) {
1111
this.apiCall = apiCall;
1212
}
1313

14+
/**
15+
* Print debugging information.
16+
*
17+
* <p>
18+
* HTTP: GET /debug
19+
*
20+
* @see <a href="https://typesense.org/docs/latest/api/cluster-operations.html#debug">Typesense docs</a>
21+
*/
1422
public Map<String, Object> retrieve() throws Exception {
1523
return this.apiCall.get(RESOURCEPATH, null, Map.class);
1624
}

0 commit comments

Comments
 (0)