Skip to content

Commit 446aa28

Browse files
cloudant-sdks-automationricellis
authored andcommitted
feat(generated): update API definition to 1.0.0-dev0.1.32
Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.32 - Automation (cloudant-sdks) version e4adb30
1 parent 222b310 commit 446aa28

12 files changed

Lines changed: 66 additions & 20 deletions

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/Analyzer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ public class Analyzer extends GenericModel {
2626
/**
2727
* Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on
2828
* the analyzer usage:
29-
* * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text
30-
* index default_field the default is `standard`.
29+
* * For search indexes the default is `standard`
30+
* * For query text indexes the default is `keyword`
31+
* * For a query text index default_field the default is `standard`.
3132
*/
3233
public interface Name {
3334
/** classic. */
@@ -223,8 +224,9 @@ public Builder newBuilder() {
223224
*
224225
* Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on
225226
* the analyzer usage:
226-
* * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text
227-
* index default_field the default is `standard`.
227+
* * For search indexes the default is `standard`
228+
* * For query text indexes the default is `keyword`
229+
* * For a query text index default_field the default is `standard`.
228230
*
229231
* @return the name
230232
*/

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/AnalyzerConfiguration.java

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@
1717
import java.util.List;
1818
import java.util.Map;
1919

20+
import com.google.gson.annotations.SerializedName;
2021
import com.ibm.cloud.sdk.core.service.model.GenericModel;
2122

2223
/**
23-
* Schema for a search analyzer configuration.
24+
* Analyzer configuration for search indexes. The default and fields properties are only applicable for the `perfield`
25+
* analyzer name.
2426
*/
2527
public class AnalyzerConfiguration extends GenericModel {
2628

2729
/**
2830
* Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on
2931
* the analyzer usage:
30-
* * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text
31-
* index default_field the default is `standard`.
32+
* * For search indexes the default is `standard`
33+
* * For query text indexes the default is `keyword`
34+
* * For a query text index default_field the default is `standard`.
3235
*/
3336
public interface Name {
3437
/** classic. */
@@ -119,6 +122,8 @@ public interface Name {
119122

120123
protected String name;
121124
protected List<String> stopwords;
125+
@SerializedName("default")
126+
protected Analyzer xDefault;
122127
protected Map<String, Analyzer> fields;
123128

124129
/**
@@ -127,6 +132,7 @@ public interface Name {
127132
public static class Builder {
128133
private String name;
129134
private List<String> stopwords;
135+
private Analyzer xDefault;
130136
private Map<String, Analyzer> fields;
131137

132138
/**
@@ -137,6 +143,7 @@ public static class Builder {
137143
private Builder(AnalyzerConfiguration analyzerConfiguration) {
138144
this.name = analyzerConfiguration.name;
139145
this.stopwords = analyzerConfiguration.stopwords;
146+
this.xDefault = analyzerConfiguration.xDefault;
140147
this.fields = analyzerConfiguration.fields;
141148
}
142149

@@ -203,6 +210,17 @@ public Builder stopwords(List<String> stopwords) {
203210
return this;
204211
}
205212

213+
/**
214+
* Set the xDefault.
215+
*
216+
* @param xDefault the xDefault
217+
* @return the AnalyzerConfiguration builder
218+
*/
219+
public Builder xDefault(Analyzer xDefault) {
220+
this.xDefault = xDefault;
221+
return this;
222+
}
223+
206224
/**
207225
* Set the fields.
208226
*
@@ -222,6 +240,7 @@ protected AnalyzerConfiguration(Builder builder) {
222240
"name cannot be null");
223241
name = builder.name;
224242
stopwords = builder.stopwords;
243+
xDefault = builder.xDefault;
225244
fields = builder.fields;
226245
}
227246

@@ -239,8 +258,9 @@ public Builder newBuilder() {
239258
*
240259
* Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on
241260
* the analyzer usage:
242-
* * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text
243-
* index default_field the default is `standard`.
261+
* * For search indexes the default is `standard`
262+
* * For query text indexes the default is `keyword`
263+
* * For a query text index default_field the default is `standard`.
244264
*
245265
* @return the name
246266
*/
@@ -259,6 +279,17 @@ public List<String> stopwords() {
259279
return stopwords;
260280
}
261281

282+
/**
283+
* Gets the xDefault.
284+
*
285+
* Schema for a full text search analyzer.
286+
*
287+
* @return the xDefault
288+
*/
289+
public Analyzer xDefault() {
290+
return xDefault;
291+
}
292+
262293
/**
263294
* Gets the fields.
264295
*

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/IndexDefinition.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
/**
2424
* Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties
2525
* that do not apply to `json` indexes, these are:
26-
* * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all document
27-
* fields and what analyzer to use for that purpose.
26+
* * `default_analyzer` - the default text analyzer to use
27+
* * `default_field` - whether to index the text in all document fields and what analyzer to use for that purpose.
2828
*/
2929
public class IndexDefinition extends GenericModel {
3030

@@ -223,9 +223,10 @@ public List<IndexField> fields() {
223223
*
224224
* Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths
225225
* field to false if:
226-
* * You do not need to know the length of an array. * You do not use the `$size` operator. * The documents in your
227-
* database are complex, or not completely under your control. As a result, it is difficult to estimate the impact of
228-
* the extra processing that is needed to determine and store the arrays lengths.
226+
* * You do not need to know the length of an array.
227+
* * You do not use the `$size` operator.
228+
* * The documents in your database are complex, or not completely under your control. As a result, it is difficult to
229+
* estimate the impact of the extra processing that is needed to determine and store the arrays lengths.
229230
*
230231
* @return the indexArrayLengths
231232
*/

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/IndexInformation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public String getDdoc() {
5656
*
5757
* Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration
5858
* properties that do not apply to `json` indexes, these are:
59-
* * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all
60-
* document fields and what analyzer to use for that purpose.
59+
* * `default_analyzer` - the default text analyzer to use
60+
* * `default_field` - whether to index the text in all document fields and what analyzer to use for that purpose.
6161
*
6262
* @return the def
6363
*/

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/PostIndexOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ public String db() {
197197
*
198198
* Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration
199199
* properties that do not apply to `json` indexes, these are:
200-
* * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all
201-
* document fields and what analyzer to use for that purpose.
200+
* * `default_analyzer` - the default text analyzer to use
201+
* * `default_field` - whether to index the text in all document fields and what analyzer to use for that purpose.
202202
*
203203
* @return the index
204204
*/

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/model/SearchIndexDefinition.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public Builder newBuilder() {
108108
/**
109109
* Gets the analyzer.
110110
*
111-
* Schema for a search analyzer configuration.
111+
* Analyzer configuration for search indexes. The default and fields properties are only applicable for the `perfield`
112+
* analyzer name.
112113
*
113114
* @return the analyzer
114115
*/

modules/cloudant/src/test/java/com/ibm/cloud/cloudant/v1/CloudantIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,7 @@ public void testPutDesignDocument() throws Exception {
13031303
AnalyzerConfiguration analyzerConfigurationModel = new AnalyzerConfiguration.Builder()
13041304
.name("standard")
13051305
.stopwords(java.util.Arrays.asList("testString"))
1306+
.xDefault(analyzerModel)
13061307
.fields(java.util.Collections.singletonMap("key1", analyzerModel))
13071308
.build();
13081309

modules/cloudant/src/test/java/com/ibm/cloud/cloudant/v1/CloudantTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ public void testDeleteDesignDocumentNoOptions() throws Throwable {
23282328
@Test
23292329
public void testGetDesignDocumentWOptions() throws Throwable {
23302330
// Register a mock response
2331-
String mockResponseBody = "{\"_attachments\": {\"mapKey\": {\"content_type\": \"contentType\", \"data\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"digest\": \"digest\", \"encoded_length\": 0, \"encoding\": \"encoding\", \"follows\": false, \"length\": 0, \"revpos\": 1, \"stub\": true}}, \"_conflicts\": [\"conflicts\"], \"_deleted\": false, \"_deleted_conflicts\": [\"deletedConflicts\"], \"_id\": \"id\", \"_local_seq\": \"localSeq\", \"_rev\": \"rev\", \"_revisions\": {\"ids\": [\"ids\"], \"start\": 1}, \"_revs_info\": [{\"rev\": \"rev\", \"status\": \"available\"}], \"autoupdate\": true, \"filters\": {\"mapKey\": \"inner\"}, \"indexes\": {\"mapKey\": {\"analyzer\": {\"name\": \"classic\", \"stopwords\": [\"stopwords\"], \"fields\": {\"mapKey\": {\"name\": \"classic\", \"stopwords\": [\"stopwords\"]}}}, \"index\": \"index\"}}, \"language\": \"javascript\", \"options\": {\"partitioned\": false}, \"validate_doc_update\": \"validateDocUpdate\", \"views\": {\"mapKey\": {\"map\": \"map\", \"reduce\": \"reduce\"}}}";
2331+
String mockResponseBody = "{\"_attachments\": {\"mapKey\": {\"content_type\": \"contentType\", \"data\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"digest\": \"digest\", \"encoded_length\": 0, \"encoding\": \"encoding\", \"follows\": false, \"length\": 0, \"revpos\": 1, \"stub\": true}}, \"_conflicts\": [\"conflicts\"], \"_deleted\": false, \"_deleted_conflicts\": [\"deletedConflicts\"], \"_id\": \"id\", \"_local_seq\": \"localSeq\", \"_rev\": \"rev\", \"_revisions\": {\"ids\": [\"ids\"], \"start\": 1}, \"_revs_info\": [{\"rev\": \"rev\", \"status\": \"available\"}], \"autoupdate\": true, \"filters\": {\"mapKey\": \"inner\"}, \"indexes\": {\"mapKey\": {\"analyzer\": {\"name\": \"classic\", \"stopwords\": [\"stopwords\"], \"default\": {\"name\": \"classic\", \"stopwords\": [\"stopwords\"]}, \"fields\": {\"mapKey\": {\"name\": \"classic\", \"stopwords\": [\"stopwords\"]}}}, \"index\": \"index\"}}, \"language\": \"javascript\", \"options\": {\"partitioned\": false}, \"validate_doc_update\": \"validateDocUpdate\", \"views\": {\"mapKey\": {\"map\": \"map\", \"reduce\": \"reduce\"}}}";
23322332
String getDesignDocumentPath = "/testString/_design/testString";
23332333
server.enqueue(new MockResponse()
23342334
.setHeader("Content-type", "application/json")
@@ -2443,6 +2443,7 @@ public void testPutDesignDocumentWOptions() throws Throwable {
24432443
AnalyzerConfiguration analyzerConfigurationModel = new AnalyzerConfiguration.Builder()
24442444
.name("standard")
24452445
.stopwords(java.util.Arrays.asList("testString"))
2446+
.xDefault(analyzerModel)
24462447
.fields(java.util.Collections.singletonMap("key1", analyzerModel))
24472448
.build();
24482449

modules/cloudant/src/test/java/com/ibm/cloud/cloudant/v1/model/AnalyzerConfigurationTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,20 @@ public void testAnalyzerConfiguration() throws Throwable {
4242
AnalyzerConfiguration analyzerConfigurationModel = new AnalyzerConfiguration.Builder()
4343
.name("classic")
4444
.stopwords(java.util.Arrays.asList("testString"))
45+
.xDefault(analyzerModel)
4546
.fields(java.util.Collections.singletonMap("key1", analyzerModel))
4647
.build();
4748
assertEquals(analyzerConfigurationModel.name(), "classic");
4849
assertEquals(analyzerConfigurationModel.stopwords(), java.util.Arrays.asList("testString"));
50+
assertEquals(analyzerConfigurationModel.xDefault(), analyzerModel);
4951
assertEquals(analyzerConfigurationModel.fields(), java.util.Collections.singletonMap("key1", analyzerModel));
5052

5153
String json = TestUtilities.serialize(analyzerConfigurationModel);
5254

5355
AnalyzerConfiguration analyzerConfigurationModelNew = TestUtilities.deserialize(json, AnalyzerConfiguration.class);
5456
assertTrue(analyzerConfigurationModelNew instanceof AnalyzerConfiguration);
5557
assertEquals(analyzerConfigurationModelNew.name(), "classic");
58+
assertEquals(analyzerConfigurationModelNew.xDefault().toString(), analyzerModel.toString());
5659
}
5760

5861
@Test(expectedExceptions = IllegalArgumentException.class)

modules/cloudant/src/test/java/com/ibm/cloud/cloudant/v1/model/DesignDocumentTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ public void testDesignDocument() throws Throwable {
8484
AnalyzerConfiguration analyzerConfigurationModel = new AnalyzerConfiguration.Builder()
8585
.name("classic")
8686
.stopwords(java.util.Arrays.asList("testString"))
87+
.xDefault(analyzerModel)
8788
.fields(java.util.Collections.singletonMap("key1", analyzerModel))
8889
.build();
8990
assertEquals(analyzerConfigurationModel.name(), "classic");
9091
assertEquals(analyzerConfigurationModel.stopwords(), java.util.Arrays.asList("testString"));
92+
assertEquals(analyzerConfigurationModel.xDefault(), analyzerModel);
9193
assertEquals(analyzerConfigurationModel.fields(), java.util.Collections.singletonMap("key1", analyzerModel));
9294

9395
SearchIndexDefinition searchIndexDefinitionModel = new SearchIndexDefinition.Builder()

0 commit comments

Comments
 (0)