Skip to content

Commit 3cad94c

Browse files
fix(Global Search): regenerated services with latest API definition (#283)
Signed-off-by: Fabrizio Leoni <[email protected]>
1 parent f8d692b commit 3cad94c

File tree

10 files changed

+42
-88
lines changed

10 files changed

+42
-88
lines changed

modules/global-search/src/main/java/com/ibm/cloud/platform_services/global_search/v2/GlobalSearch.java

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
15-
* IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027
15+
* IBM OpenAPI SDK Code Generator Version: 3.100.0-2ad7a784-20250212-162551
1616
*/
1717

1818
package com.ibm.cloud.platform_services.global_search.v2;
@@ -95,22 +95,18 @@ public GlobalSearch(String serviceName, Authenticator authenticator) {
9595
* Find instances of resources (v3).
9696
*
9797
* Find IAM-enabled resources or storage and network resources that run on classic infrastructure in a specific
98-
* account ID. You can apply query strings if necessary.
99-
*
100-
* To filter results, you can insert a string by using the Lucene syntax and the query string is parsed into a series
101-
* of terms and operators. A term can be a single word or a phrase, in which case the search is performed for all the
102-
* words, in the same order. To filter for a specific value regardless of the property that contains it, type the
103-
* search term without specifying a field. Only resources that belong to the account ID and that are accessible by the
104-
* client are returned.
98+
* account ID.
10599
*
106100
* You must use `/v3/resources/search` when you need to fetch more than `10000` resource items. On the first call, the
107101
* operation returns a live cursor on the data that you must use on all the subsequent calls to get the next batch of
108102
* results until you get the empty result set.
109103
*
110-
* By default, the fields that are returned for every resource are `crn`, `name`,
111-
* `family`, `type`, and `account_id`. You can specify the subset of the fields you want in your request using the
112-
* `fields` request body attribute. Set `"fields": ["*"]` to discover the set of fields which are available to
113-
* request.
104+
* To filter results, you can apply query strings following the *Lucene* query syntax.
105+
*
106+
* By default, the fields that are returned for every resource are **crn**, **name**,
107+
* **family**, **type**, and **account_id**. You can specify the subset of the fields you want in your request using
108+
* the `fields` request body attribute. Set `"fields": ["*"]` to discover the complete set of fields which are
109+
* available to request.
114110
*
115111
* @param searchOptions the {@link SearchOptions} containing the options for the call
116112
* @return a {@link ServiceCall} with a result of type {@link ScanResult}
@@ -148,9 +144,6 @@ public ServiceCall<ScanResult> search(SearchOptions searchOptions) {
148144
if (searchOptions.isReclaimed() != null) {
149145
builder.query("is_reclaimed", String.valueOf(searchOptions.isReclaimed()));
150146
}
151-
if (searchOptions.isPublic() != null) {
152-
builder.query("is_public", String.valueOf(searchOptions.isPublic()));
153-
}
154147
if (searchOptions.impersonateUser() != null) {
155148
builder.query("impersonate_user", String.valueOf(searchOptions.impersonateUser()));
156149
}
@@ -180,22 +173,18 @@ public ServiceCall<ScanResult> search(SearchOptions searchOptions) {
180173
* Find instances of resources (v3).
181174
*
182175
* Find IAM-enabled resources or storage and network resources that run on classic infrastructure in a specific
183-
* account ID. You can apply query strings if necessary.
184-
*
185-
* To filter results, you can insert a string by using the Lucene syntax and the query string is parsed into a series
186-
* of terms and operators. A term can be a single word or a phrase, in which case the search is performed for all the
187-
* words, in the same order. To filter for a specific value regardless of the property that contains it, type the
188-
* search term without specifying a field. Only resources that belong to the account ID and that are accessible by the
189-
* client are returned.
176+
* account ID.
190177
*
191178
* You must use `/v3/resources/search` when you need to fetch more than `10000` resource items. On the first call, the
192179
* operation returns a live cursor on the data that you must use on all the subsequent calls to get the next batch of
193180
* results until you get the empty result set.
194181
*
195-
* By default, the fields that are returned for every resource are `crn`, `name`,
196-
* `family`, `type`, and `account_id`. You can specify the subset of the fields you want in your request using the
197-
* `fields` request body attribute. Set `"fields": ["*"]` to discover the set of fields which are available to
198-
* request.
182+
* To filter results, you can apply query strings following the *Lucene* query syntax.
183+
*
184+
* By default, the fields that are returned for every resource are **crn**, **name**,
185+
* **family**, **type**, and **account_id**. You can specify the subset of the fields you want in your request using
186+
* the `fields` request body attribute. Set `"fields": ["*"]` to discover the complete set of fields which are
187+
* available to request.
199188
*
200189
* @return a {@link ServiceCall} with a result of type {@link ScanResult}
201190
*/

modules/global-search/src/main/java/com/ibm/cloud/platform_services/global_search/v2/model/ResultItem.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package com.ibm.cloud.platform_services.global_search.v2.model;
1415

1516
import com.google.gson.annotations.SerializedName;
@@ -19,6 +20,8 @@
1920
/**
2021
* A resource returned in a search result, which is identified by its `crn`. It contains other properties that depend on
2122
* the resource type.
23+
*
24+
* This type supports additional properties of type Object.
2225
*/
2326
public class ResultItem extends DynamicModel<Object> {
2427

modules/global-search/src/main/java/com/ibm/cloud/platform_services/global_search/v2/model/ScanResult.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package com.ibm.cloud.platform_services.global_search.v2.model;
1415

1516
import java.util.List;

modules/global-search/src/main/java/com/ibm/cloud/platform_services/global_search/v2/model/SearchOptions.java

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package com.ibm.cloud.platform_services.global_search.v2.model;
1415

1516
import java.util.ArrayList;
@@ -50,20 +51,6 @@ public interface IsReclaimed {
5051
String ANY = "any";
5152
}
5253

53-
/**
54-
* Determines if public resources should be included in result set or not. Possible values are false (default), true
55-
* or any. If false, do not search public resources; if true, search only public resources; If any, search also public
56-
* resources.
57-
*/
58-
public interface IsPublic {
59-
/** true. */
60-
String X_TRUE = "true";
61-
/** false. */
62-
String X_FALSE = "false";
63-
/** any. */
64-
String ANY = "any";
65-
}
66-
6754
/**
6855
* Determines if the result set must return the resources that the user can tag or the resources that the user can
6956
* view (only a GhoST admin can use this parameter). If false (default), only resources user can view are returned; if
@@ -102,7 +89,6 @@ public interface IsProjectResource {
10289
protected List<String> sort;
10390
protected String isDeleted;
10491
protected String isReclaimed;
105-
protected String isPublic;
10692
protected String impersonateUser;
10793
protected String canTag;
10894
protected String isProjectResource;
@@ -122,7 +108,6 @@ public static class Builder {
122108
private List<String> sort;
123109
private String isDeleted;
124110
private String isReclaimed;
125-
private String isPublic;
126111
private String impersonateUser;
127112
private String canTag;
128113
private String isProjectResource;
@@ -144,7 +129,6 @@ private Builder(SearchOptions searchOptions) {
144129
this.sort = searchOptions.sort;
145130
this.isDeleted = searchOptions.isDeleted;
146131
this.isReclaimed = searchOptions.isReclaimed;
147-
this.isPublic = searchOptions.isPublic;
148132
this.impersonateUser = searchOptions.impersonateUser;
149133
this.canTag = searchOptions.canTag;
150134
this.isProjectResource = searchOptions.isProjectResource;
@@ -320,17 +304,6 @@ public Builder isReclaimed(String isReclaimed) {
320304
return this;
321305
}
322306

323-
/**
324-
* Set the isPublic.
325-
*
326-
* @param isPublic the isPublic
327-
* @return the SearchOptions builder
328-
*/
329-
public Builder isPublic(String isPublic) {
330-
this.isPublic = isPublic;
331-
return this;
332-
}
333-
334307
/**
335308
* Set the impersonateUser.
336309
*
@@ -379,7 +352,6 @@ protected SearchOptions(Builder builder) {
379352
sort = builder.sort;
380353
isDeleted = builder.isDeleted;
381354
isReclaimed = builder.isReclaimed;
382-
isPublic = builder.isPublic;
383355
impersonateUser = builder.impersonateUser;
384356
canTag = builder.canTag;
385357
isProjectResource = builder.isProjectResource;
@@ -422,7 +394,9 @@ public List<String> fields() {
422394
* Gets the searchCursor.
423395
*
424396
* An opaque cursor that is returned on each call and that must be set on the subsequent call to get the next batch of
425-
* items. If the search returns no items, then the search_cursor is not present in the response.
397+
* items. You can stop paging when the search returns less items than the specified `limit` or when the
398+
* `search_cursor` is not present in the response. NOTE: when setting this parameter, any other properties present in
399+
* the body will be ignored.
426400
*
427401
* @return the searchCursor
428402
*/
@@ -532,19 +506,6 @@ public String isReclaimed() {
532506
return isReclaimed;
533507
}
534508

535-
/**
536-
* Gets the isPublic.
537-
*
538-
* Determines if public resources should be included in result set or not. Possible values are false (default), true
539-
* or any. If false, do not search public resources; if true, search only public resources; If any, search also public
540-
* resources.
541-
*
542-
* @return the isPublic
543-
*/
544-
public String isPublic() {
545-
return isPublic;
546-
}
547-
548509
/**
549510
* Gets the impersonateUser.
550511
*

modules/global-search/src/main/java/com/ibm/cloud/platform_services/global_search/v2/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
/**
1415
* Global Search v2.
1516
*/

modules/global-search/src/test/java/com/ibm/cloud/platform_services/global_search/v2/GlobalSearchTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,6 +10,7 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package com.ibm.cloud.platform_services.global_search.v2;
1415

1516
import com.ibm.cloud.platform_services.global_search.v2.GlobalSearch;
@@ -66,7 +67,7 @@ public void testSearchWOptions() throws Throwable {
6667

6768
// Construct an instance of the SearchOptions model
6869
SearchOptions searchOptionsModel = new SearchOptions.Builder()
69-
.query("testString")
70+
.query("*")
7071
.fields(java.util.Arrays.asList("testString"))
7172
.searchCursor("testString")
7273
.xRequestId("testString")
@@ -77,7 +78,6 @@ public void testSearchWOptions() throws Throwable {
7778
.sort(java.util.Arrays.asList("testString"))
7879
.isDeleted("false")
7980
.isReclaimed("false")
80-
.isPublic("false")
8181
.impersonateUser("testString")
8282
.canTag("false")
8383
.isProjectResource("false")
@@ -105,7 +105,6 @@ public void testSearchWOptions() throws Throwable {
105105
assertEquals(query.get("sort"), RequestUtils.join(java.util.Arrays.asList("testString"), ","));
106106
assertEquals(query.get("is_deleted"), "false");
107107
assertEquals(query.get("is_reclaimed"), "false");
108-
assertEquals(query.get("is_public"), "false");
109108
assertEquals(query.get("impersonate_user"), "testString");
110109
assertEquals(query.get("can_tag"), "false");
111110
assertEquals(query.get("is_project_resource"), "false");

modules/global-search/src/test/java/com/ibm/cloud/platform_services/global_search/v2/model/ResultItemTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/global-search/src/test/java/com/ibm/cloud/platform_services/global_search/v2/model/ScanResultTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

modules/global-search/src/test/java/com/ibm/cloud/platform_services/global_search/v2/model/SearchOptionsTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -32,7 +32,7 @@ public class SearchOptionsTest {
3232
@Test
3333
public void testSearchOptions() throws Throwable {
3434
SearchOptions searchOptionsModel = new SearchOptions.Builder()
35-
.query("testString")
35+
.query("*")
3636
.fields(java.util.Arrays.asList("testString"))
3737
.searchCursor("testString")
3838
.xRequestId("testString")
@@ -43,12 +43,11 @@ public void testSearchOptions() throws Throwable {
4343
.sort(java.util.Arrays.asList("testString"))
4444
.isDeleted("false")
4545
.isReclaimed("false")
46-
.isPublic("false")
4746
.impersonateUser("testString")
4847
.canTag("false")
4948
.isProjectResource("false")
5049
.build();
51-
assertEquals(searchOptionsModel.query(), "testString");
50+
assertEquals(searchOptionsModel.query(), "*");
5251
assertEquals(searchOptionsModel.fields(), java.util.Arrays.asList("testString"));
5352
assertEquals(searchOptionsModel.searchCursor(), "testString");
5453
assertEquals(searchOptionsModel.xRequestId(), "testString");
@@ -59,7 +58,6 @@ public void testSearchOptions() throws Throwable {
5958
assertEquals(searchOptionsModel.sort(), java.util.Arrays.asList("testString"));
6059
assertEquals(searchOptionsModel.isDeleted(), "false");
6160
assertEquals(searchOptionsModel.isReclaimed(), "false");
62-
assertEquals(searchOptionsModel.isPublic(), "false");
6361
assertEquals(searchOptionsModel.impersonateUser(), "testString");
6462
assertEquals(searchOptionsModel.canTag(), "false");
6563
assertEquals(searchOptionsModel.isProjectResource(), "false");

modules/global-search/src/test/java/com/ibm/cloud/platform_services/global_search/v2/utils/TestUtilities.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2024.
2+
* (C) Copyright IBM Corp. 2025.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -10,8 +10,10 @@
1010
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1111
* specific language governing permissions and limitations under the License.
1212
*/
13+
1314
package com.ibm.cloud.platform_services.global_search.v2.utils;
1415

16+
import java.util.Base64;
1517
import java.util.Map;
1618
import java.util.Set;
1719
import java.util.List;
@@ -115,8 +117,8 @@ public static List<FileWithMetadata> creatMockListFileWithMetadata() {
115117
return list;
116118
}
117119

118-
public static byte[] createMockByteArray(String bytes) {
119-
return bytes.getBytes();
120+
public static byte[] createMockByteArray(String encodedString) throws Exception {
121+
return Base64.getDecoder().decode(encodedString);
120122
}
121123

122124
public static Date createMockDate(String date) throws Exception {

0 commit comments

Comments
 (0)