Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [datacatalog] add support for admin_search in SearchCatalog() API method #9728

Merged
merged 2 commits into from Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion java-datacatalog/README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.20.0</version>
<version>26.21.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -299,6 +299,7 @@ public final SearchCatalogPagedResponse searchCatalog(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setAdminSearch(true)
* .build();
* for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -344,6 +345,7 @@ public final SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest reque
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setAdminSearch(true)
* .build();
* ApiFuture<SearchCatalogResult> future =
* dataCatalogClient.searchCatalogPagedCallable().futureCall(request);
Expand Down Expand Up @@ -390,6 +392,7 @@ public final SearchCatalogPagedResponse searchCatalog(SearchCatalogRequest reque
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setOrderBy("orderBy-1207110587")
* .setAdminSearch(true)
* .build();
* while (true) {
* SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request);
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -2471,6 +2471,28 @@ public com.google.protobuf.ByteString getOrderByBytes() {
}
}

public static final int ADMIN_SEARCH_FIELD_NUMBER = 17;
private boolean adminSearch_ = false;
/**
*
*
* <pre>
* Optional. If set, uses searchAll permission granted on organizations from
* `include_org_ids` and projects from `include_project_ids` instead of the
* fine grained per resource permissions when filtering the search results.
* The only allowed `order_by` criteria for admin_search mode is `default`.
* Using this flags guarantees a full recall of the search results.
* </pre>
*
* <code>bool admin_search = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The adminSearch.
*/
@java.lang.Override
public boolean getAdminSearch() {
return adminSearch_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -2500,6 +2522,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (scope_ != null) {
output.writeMessage(6, getScope());
}
if (adminSearch_ != false) {
output.writeBool(17, adminSearch_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -2524,6 +2549,9 @@ public int getSerializedSize() {
if (scope_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getScope());
}
if (adminSearch_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(17, adminSearch_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -2548,6 +2576,7 @@ public boolean equals(final java.lang.Object obj) {
if (getPageSize() != other.getPageSize()) return false;
if (!getPageToken().equals(other.getPageToken())) return false;
if (!getOrderBy().equals(other.getOrderBy())) return false;
if (getAdminSearch() != other.getAdminSearch()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -2571,6 +2600,8 @@ public int hashCode() {
hash = (53 * hash) + getPageToken().hashCode();
hash = (37 * hash) + ORDER_BY_FIELD_NUMBER;
hash = (53 * hash) + getOrderBy().hashCode();
hash = (37 * hash) + ADMIN_SEARCH_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAdminSearch());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -2720,6 +2751,7 @@ public Builder clear() {
pageSize_ = 0;
pageToken_ = "";
orderBy_ = "";
adminSearch_ = false;
return this;
}

Expand Down Expand Up @@ -2771,6 +2803,9 @@ private void buildPartial0(com.google.cloud.datacatalog.v1.SearchCatalogRequest
if (((from_bitField0_ & 0x00000010) != 0)) {
result.orderBy_ = orderBy_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.adminSearch_ = adminSearch_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -2840,6 +2875,9 @@ public Builder mergeFrom(com.google.cloud.datacatalog.v1.SearchCatalogRequest ot
bitField0_ |= 0x00000010;
onChanged();
}
if (other.getAdminSearch() != false) {
setAdminSearch(other.getAdminSearch());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -2896,6 +2934,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000001;
break;
} // case 50
case 136:
{
adminSearch_ = input.readBool();
bitField0_ |= 0x00000020;
break;
} // case 136
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -3703,6 +3747,71 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) {
return this;
}

private boolean adminSearch_;
/**
*
*
* <pre>
* Optional. If set, uses searchAll permission granted on organizations from
* `include_org_ids` and projects from `include_project_ids` instead of the
* fine grained per resource permissions when filtering the search results.
* The only allowed `order_by` criteria for admin_search mode is `default`.
* Using this flags guarantees a full recall of the search results.
* </pre>
*
* <code>bool admin_search = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The adminSearch.
*/
@java.lang.Override
public boolean getAdminSearch() {
return adminSearch_;
}
/**
*
*
* <pre>
* Optional. If set, uses searchAll permission granted on organizations from
* `include_org_ids` and projects from `include_project_ids` instead of the
* fine grained per resource permissions when filtering the search results.
* The only allowed `order_by` criteria for admin_search mode is `default`.
* Using this flags guarantees a full recall of the search results.
* </pre>
*
* <code>bool admin_search = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The adminSearch to set.
* @return This builder for chaining.
*/
public Builder setAdminSearch(boolean value) {

adminSearch_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. If set, uses searchAll permission granted on organizations from
* `include_org_ids` and projects from `include_project_ids` instead of the
* fine grained per resource permissions when filtering the search results.
* The only allowed `order_by` criteria for admin_search mode is `default`.
* Using this flags guarantees a full recall of the search results.
* </pre>
*
* <code>bool admin_search = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearAdminSearch() {
bitField0_ = (bitField0_ & ~0x00000020);
adminSearch_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Expand Up @@ -233,4 +233,21 @@ public interface SearchCatalogRequestOrBuilder
* @return The bytes for orderBy.
*/
com.google.protobuf.ByteString getOrderByBytes();

/**
*
*
* <pre>
* Optional. If set, uses searchAll permission granted on organizations from
* `include_org_ids` and projects from `include_project_ids` instead of the
* fine grained per resource permissions when filtering the search results.
* The only allowed `order_by` criteria for admin_search mode is `default`.
* Using this flags guarantees a full recall of the search results.
* </pre>
*
* <code>bool admin_search = 17 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The adminSearch.
*/
boolean getAdminSearch();
}
Expand Up @@ -734,6 +734,13 @@ message SearchCatalogRequest {
//
// If this parameter is omitted, it defaults to the descending `relevance`.
string order_by = 5;

// Optional. If set, uses searchAll permission granted on organizations from
// `include_org_ids` and projects from `include_project_ids` instead of the
// fine grained per resource permissions when filtering the search results.
// The only allowed `order_by` criteria for admin_search mode is `default`.
// Using this flags guarantees a full recall of the search results.
bool admin_search = 17 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for
Expand Down
Expand Up @@ -42,6 +42,7 @@ public static void asyncSearchCatalog() throws Exception {
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setAdminSearch(true)
.build();
ApiFuture<SearchCatalogResult> future =
dataCatalogClient.searchCatalogPagedCallable().futureCall(request);
Expand Down
Expand Up @@ -43,6 +43,7 @@ public static void asyncSearchCatalogPaged() throws Exception {
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setAdminSearch(true)
.build();
while (true) {
SearchCatalogResponse response = dataCatalogClient.searchCatalogCallable().call(request);
Expand Down
Expand Up @@ -41,6 +41,7 @@ public static void syncSearchCatalog() throws Exception {
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setAdminSearch(true)
.build();
for (SearchCatalogResult element : dataCatalogClient.searchCatalog(request).iterateAll()) {
// doThingsWith(element);
Expand Down