Skip to content

Commit 2d899b4

Browse files
cloudant-sdks-automationmojito317
authored andcommitted
feat(generated): update API definition to 1.0.0-dev0.1.25
Generated SDK source code using: - Generator version 3.98.0 - Specification version 1.0.0-dev0.1.25 - Automation (cloudant-sdks) version bb333b3
1 parent 039620c commit 2d899b4

13 files changed

Lines changed: 497 additions & 4 deletions

modules/cloudant/src/main/java/com/ibm/cloud/cloudant/v1/Cloudant.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import com.ibm.cloud.cloudant.v1.model.GetSchedulerDocumentOptions;
6464
import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobOptions;
6565
import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobsOptions;
66+
import com.ibm.cloud.cloudant.v1.model.GetSearchDiskSizeOptions;
6667
import com.ibm.cloud.cloudant.v1.model.GetSearchInfoOptions;
6768
import com.ibm.cloud.cloudant.v1.model.GetSecurityOptions;
6869
import com.ibm.cloud.cloudant.v1.model.GetServerInformationOptions;
@@ -126,6 +127,7 @@
126127
import com.ibm.cloud.cloudant.v1.model.SchedulerJob;
127128
import com.ibm.cloud.cloudant.v1.model.SchedulerJobsResult;
128129
import com.ibm.cloud.cloudant.v1.model.SearchAnalyzeResult;
130+
import com.ibm.cloud.cloudant.v1.model.SearchDiskSizeInformation;
129131
import com.ibm.cloud.cloudant.v1.model.SearchInfoResult;
130132
import com.ibm.cloud.cloudant.v1.model.SearchResult;
131133
import com.ibm.cloud.cloudant.v1.model.Security;
@@ -3260,6 +3262,32 @@ public ServiceCall<InputStream> postSearchAsStream(PostSearchOptions postSearchO
32603262
return createServiceCall(builder.build(), responseConverter);
32613263
}
32623264

3265+
/**
3266+
* Retrieve information about the search index disk size.
3267+
*
3268+
* Retrieve size of the search index on disk.
3269+
*
3270+
* @param getSearchDiskSizeOptions the {@link GetSearchDiskSizeOptions} containing the options for the call
3271+
* @return a {@link ServiceCall} with a result of type {@link SearchDiskSizeInformation}
3272+
*/
3273+
public ServiceCall<SearchDiskSizeInformation> getSearchDiskSize(GetSearchDiskSizeOptions getSearchDiskSizeOptions) {
3274+
com.ibm.cloud.sdk.core.util.Validator.notNull(getSearchDiskSizeOptions,
3275+
"getSearchDiskSizeOptions cannot be null");
3276+
Map<String, String> pathParamsMap = new HashMap<String, String>();
3277+
pathParamsMap.put("db", getSearchDiskSizeOptions.db());
3278+
pathParamsMap.put("ddoc", getSearchDiskSizeOptions.ddoc());
3279+
pathParamsMap.put("index", getSearchDiskSizeOptions.index());
3280+
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/{db}/_design/{ddoc}/_search_disk_size/{index}", pathParamsMap));
3281+
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("cloudant", "v1", "getSearchDiskSize");
3282+
for (Entry<String, String> header : sdkHeaders.entrySet()) {
3283+
builder.header(header.getKey(), header.getValue());
3284+
}
3285+
builder.header("Accept", "application/json");
3286+
ResponseConverter<SearchDiskSizeInformation> responseConverter =
3287+
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<SearchDiskSizeInformation>() { }.getType());
3288+
return createServiceCall(builder.build(), responseConverter);
3289+
}
3290+
32633291
/**
32643292
* Retrieve information about a search index.
32653293
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public Builder newBuilder() {
147147
/**
148148
* Gets the docId.
149149
*
150-
* Path parameter to specify the document ID.
150+
* Path parameter to specify the ID of the stored replication configuration in the `_replicator` database.
151151
*
152152
* @return the docId
153153
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public Builder newBuilder() {
258258
/**
259259
* Gets the docId.
260260
*
261-
* Path parameter to specify the document ID.
261+
* Path parameter to specify the ID of the stored replication configuration in the `_replicator` database.
262262
*
263263
* @return the docId
264264
*/
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.cloudant.v1.model;
15+
16+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
17+
18+
/**
19+
* The getSearchDiskSize options.
20+
*/
21+
public class GetSearchDiskSizeOptions extends GenericModel {
22+
23+
protected String db;
24+
protected String ddoc;
25+
protected String index;
26+
27+
/**
28+
* Builder.
29+
*/
30+
public static class Builder {
31+
private String db;
32+
private String ddoc;
33+
private String index;
34+
35+
/**
36+
* Instantiates a new Builder from an existing GetSearchDiskSizeOptions instance.
37+
*
38+
* @param getSearchDiskSizeOptions the instance to initialize the Builder with
39+
*/
40+
private Builder(GetSearchDiskSizeOptions getSearchDiskSizeOptions) {
41+
this.db = getSearchDiskSizeOptions.db;
42+
this.ddoc = getSearchDiskSizeOptions.ddoc;
43+
this.index = getSearchDiskSizeOptions.index;
44+
}
45+
46+
/**
47+
* Instantiates a new builder.
48+
*/
49+
public Builder() {
50+
}
51+
52+
/**
53+
* Instantiates a new builder with required properties.
54+
*
55+
* @param db the db
56+
* @param ddoc the ddoc
57+
* @param index the index
58+
*/
59+
public Builder(String db, String ddoc, String index) {
60+
this.db = db;
61+
this.ddoc = ddoc;
62+
this.index = index;
63+
}
64+
65+
/**
66+
* Builds a GetSearchDiskSizeOptions.
67+
*
68+
* @return the new GetSearchDiskSizeOptions instance
69+
*/
70+
public GetSearchDiskSizeOptions build() {
71+
return new GetSearchDiskSizeOptions(this);
72+
}
73+
74+
/**
75+
* Set the db.
76+
*
77+
* @param db the db
78+
* @return the GetSearchDiskSizeOptions builder
79+
*/
80+
public Builder db(String db) {
81+
this.db = db;
82+
return this;
83+
}
84+
85+
/**
86+
* Set the ddoc.
87+
*
88+
* @param ddoc the ddoc
89+
* @return the GetSearchDiskSizeOptions builder
90+
*/
91+
public Builder ddoc(String ddoc) {
92+
this.ddoc = ddoc;
93+
return this;
94+
}
95+
96+
/**
97+
* Set the index.
98+
*
99+
* @param index the index
100+
* @return the GetSearchDiskSizeOptions builder
101+
*/
102+
public Builder index(String index) {
103+
this.index = index;
104+
return this;
105+
}
106+
}
107+
108+
protected GetSearchDiskSizeOptions() { }
109+
110+
protected GetSearchDiskSizeOptions(Builder builder) {
111+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.db,
112+
"db cannot be empty");
113+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ddoc,
114+
"ddoc cannot be empty");
115+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.index,
116+
"index cannot be empty");
117+
db = builder.db;
118+
ddoc = builder.ddoc;
119+
index = builder.index;
120+
}
121+
122+
/**
123+
* New builder.
124+
*
125+
* @return a GetSearchDiskSizeOptions builder
126+
*/
127+
public Builder newBuilder() {
128+
return new Builder(this);
129+
}
130+
131+
/**
132+
* Gets the db.
133+
*
134+
* Path parameter to specify the database name.
135+
*
136+
* @return the db
137+
*/
138+
public String db() {
139+
return db;
140+
}
141+
142+
/**
143+
* Gets the ddoc.
144+
*
145+
* Path parameter to specify the design document name. The design document name is the design document ID excluding
146+
* the `_design/` prefix.
147+
*
148+
* @return the ddoc
149+
*/
150+
public String ddoc() {
151+
return ddoc;
152+
}
153+
154+
/**
155+
* Gets the index.
156+
*
157+
* Path parameter to specify the index name.
158+
*
159+
* @return the index
160+
*/
161+
public String index() {
162+
return index;
163+
}
164+
}
165+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public Builder newBuilder() {
108108
/**
109109
* Gets the docId.
110110
*
111-
* Path parameter to specify the document ID.
111+
* Path parameter to specify the ID of the stored replication configuration in the `_replicator` database.
112112
*
113113
* @return the docId
114114
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public Builder newBuilder() {
181181
/**
182182
* Gets the docId.
183183
*
184-
* Path parameter to specify the document ID.
184+
* Path parameter to specify the ID of the stored replication configuration in the `_replicator` database.
185185
*
186186
* @return the docId
187187
*/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.cloudant.v1.model;
15+
16+
import com.google.gson.annotations.SerializedName;
17+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
18+
19+
/**
20+
* Schema for search index disk size.
21+
*/
22+
public class SearchDiskSizeInformation extends GenericModel {
23+
24+
protected String name;
25+
@SerializedName("search_index")
26+
protected SearchIndexDiskSize searchIndex;
27+
28+
protected SearchDiskSizeInformation() { }
29+
30+
/**
31+
* Gets the name.
32+
*
33+
* The name of the search index prefixed by the design document ID where the index is stored.
34+
*
35+
* @return the name
36+
*/
37+
public String getName() {
38+
return name;
39+
}
40+
41+
/**
42+
* Gets the searchIndex.
43+
*
44+
* Schema for search index disk size.
45+
*
46+
* @return the searchIndex
47+
*/
48+
public SearchIndexDiskSize getSearchIndex() {
49+
return searchIndex;
50+
}
51+
}
52+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2025.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.cloudant.v1.model;
15+
16+
import com.google.gson.annotations.SerializedName;
17+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
18+
19+
/**
20+
* Schema for search index disk size.
21+
*/
22+
public class SearchIndexDiskSize extends GenericModel {
23+
24+
@SerializedName("disk_size")
25+
protected Long diskSize;
26+
27+
protected SearchIndexDiskSize() { }
28+
29+
/**
30+
* Gets the diskSize.
31+
*
32+
* The size of the search index on disk.
33+
*
34+
* @return the diskSize
35+
*/
36+
public Long getDiskSize() {
37+
return diskSize;
38+
}
39+
}
40+

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
import com.ibm.cloud.cloudant.v1.model.GetSchedulerDocumentOptions;
8989
import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobOptions;
9090
import com.ibm.cloud.cloudant.v1.model.GetSchedulerJobsOptions;
91+
import com.ibm.cloud.cloudant.v1.model.GetSearchDiskSizeOptions;
9192
import com.ibm.cloud.cloudant.v1.model.GetSearchInfoOptions;
9293
import com.ibm.cloud.cloudant.v1.model.GetSecurityOptions;
9394
import com.ibm.cloud.cloudant.v1.model.GetServerInformationOptions;
@@ -171,7 +172,9 @@
171172
import com.ibm.cloud.cloudant.v1.model.SchedulerJobEvent;
172173
import com.ibm.cloud.cloudant.v1.model.SchedulerJobsResult;
173174
import com.ibm.cloud.cloudant.v1.model.SearchAnalyzeResult;
175+
import com.ibm.cloud.cloudant.v1.model.SearchDiskSizeInformation;
174176
import com.ibm.cloud.cloudant.v1.model.SearchIndexDefinition;
177+
import com.ibm.cloud.cloudant.v1.model.SearchIndexDiskSize;
175178
import com.ibm.cloud.cloudant.v1.model.SearchIndexInfo;
176179
import com.ibm.cloud.cloudant.v1.model.SearchInfoResult;
177180
import com.ibm.cloud.cloudant.v1.model.SearchResult;
@@ -2294,6 +2297,30 @@ public void testPostSearchAsStream() throws Exception {
22942297
}
22952298

22962299
@Test(dependsOnMethods = { "testPostSearchAsStream" })
2300+
public void testGetSearchDiskSize() throws Exception {
2301+
try {
2302+
GetSearchDiskSizeOptions getSearchDiskSizeOptions = new GetSearchDiskSizeOptions.Builder()
2303+
.db("testString")
2304+
.ddoc("testString")
2305+
.index("testString")
2306+
.build();
2307+
2308+
// Invoke operation
2309+
Response<SearchDiskSizeInformation> response = service.getSearchDiskSize(getSearchDiskSizeOptions).execute();
2310+
// Validate response
2311+
assertNotNull(response);
2312+
assertEquals(response.getStatusCode(), 200);
2313+
2314+
SearchDiskSizeInformation searchDiskSizeInformationResult = response.getResult();
2315+
assertNotNull(searchDiskSizeInformationResult);
2316+
2317+
} catch (ServiceResponseException e) {
2318+
fail(String.format("Service returned status code %d: %s%nError details: %s",
2319+
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()));
2320+
}
2321+
}
2322+
2323+
@Test(dependsOnMethods = { "testGetSearchDiskSize" })
22972324
public void testGetSearchInfo() throws Exception {
22982325
try {
22992326
GetSearchInfoOptions getSearchInfoOptions = new GetSearchInfoOptions.Builder()

0 commit comments

Comments
 (0)