Skip to content

Commit

Permalink
feat: [datacatalog] add support for admin_search in SearchCatalog() A…
Browse files Browse the repository at this point in the history
…PI method (#9728)

* feat: add support for admin_search in SearchCatalog() API method

PiperOrigin-RevId: 553406785

Source-Link: googleapis/googleapis@ce38ea0

Source-Link: https://github.com/googleapis/googleapis-gen/commit/cbd7291e1e4389185dd58ace2dbaad55dea04c77
Copy-Tag: eyJwIjoiamF2YS1kYXRhY2F0YWxvZy8uT3dsQm90LnlhbWwiLCJoIjoiY2JkNzI5MWUxZTQzODkxODVkZDU4YWNlMmRiYWFkNTVkZWEwNGM3NyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 3, 2023
1 parent 4814ee4 commit aee140e
Show file tree
Hide file tree
Showing 9 changed files with 613 additions and 474 deletions.
2 changes: 1 addition & 1 deletion java-datacatalog/README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.

Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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();
}
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit aee140e

Please sign in to comment.