Skip to content

Commit

Permalink
feat: [kmsinventory] add resource_types to SearchAllResources, to all…
Browse files Browse the repository at this point in the history
…ow filtering by resource type (#9641)

* feat: add resource_types to SearchAllResources, to allow filtering by resource type

PiperOrigin-RevId: 547834040

Source-Link: googleapis/googleapis@ecb3e47

Source-Link: googleapis/googleapis-gen@6869315
Copy-Tag: eyJwIjoiamF2YS1rbXNpbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6IjY4NjkzMTVmNjBmMWEyMDI5NjhmNjZmYjExYjA3NDgzYjExMTQ4ZmMifQ==

* 🦉 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] committed Jul 20, 2023
1 parent 0205042 commit 1e8aa17
Show file tree
Hide file tree
Showing 11 changed files with 620 additions and 43 deletions.
4 changes: 2 additions & 2 deletions java-kmsinventory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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.16.0</version>
<version>26.18.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-kmsinventory/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-kmsinventory.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kmsinventory/0.8.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kmsinventory/0.10.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceTypes(new ArrayList<String>())
* .build();
* for (ProtectedResource element :
* keyTrackingServiceClient.searchProtectedResources(request).iterateAll()) {
Expand Down Expand Up @@ -525,6 +526,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceTypes(new ArrayList<String>())
* .build();
* ApiFuture<ProtectedResource> future =
* keyTrackingServiceClient.searchProtectedResourcesPagedCallable().futureCall(request);
Expand Down Expand Up @@ -560,6 +562,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .addAllResourceTypes(new ArrayList<String>())
* .build();
* while (true) {
* SearchProtectedResourcesResponse response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public class HttpJsonKeyTrackingServiceStub extends KeyTrackingServiceStub {
serializer.putQueryParam(fields, "cryptoKey", request.getCryptoKey());
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(
fields, "resourceTypes", request.getResourceTypesList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,48 +102,49 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "s/{project}/locations/{location}/keyRing"
+ "s/{key_ring}/cryptoKeys/{crypto_key}/cry"
+ "ptoKeyVersions/{crypto_key_version}/prot"
+ "ectedResourcesSummary\"\262\001\n\037SearchProtecte"
+ "ectedResourcesSummary\"\320\001\n\037SearchProtecte"
+ "dResourcesRequest\022H\n\005scope\030\002 \001(\tB9\342A\001\002\372A"
+ "2\n0cloudresourcemanager.googleapis.com/O"
+ "rganization\022\036\n\ncrypto_key\030\001 \001(\tB\n\342A\001\002\372A\003"
+ "\n\001*\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001"
+ "(\t\"\212\001\n SearchProtectedResourcesResponse\022"
+ "M\n\023protected_resources\030\001 \003(\01320.google.cl"
+ "oud.kms.inventory.v1.ProtectedResource\022\027"
+ "\n\017next_page_token\030\002 \001(\t\"\372\003\n\021ProtectedRes"
+ "ource\022\014\n\004name\030\001 \001(\t\022\017\n\007project\030\002 \001(\t\022\022\n\n"
+ "project_id\030\t \001(\t\022\025\n\rcloud_product\030\010 \001(\t\022"
+ "\025\n\rresource_type\030\003 \001(\t\022\020\n\010location\030\004 \001(\t"
+ "\022L\n\006labels\030\005 \003(\0132<.google.cloud.kms.inve"
+ "ntory.v1.ProtectedResource.LabelsEntry\022I"
+ "\n\022crypto_key_version\030\006 \001(\tB-\372A*\n(cloudkm"
+ "s.googleapis.com/CryptoKeyVersion\022J\n\023cry"
+ "pto_key_versions\030\n \003(\tB-\372A*\n(cloudkms.go"
+ "ogleapis.com/CryptoKeyVersion\0225\n\013create_"
+ "time\030\007 \001(\0132\032.google.protobuf.TimestampB\004"
+ "\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu"
+ "e\030\002 \001(\t:\0028\001:\'\352A$\n\037cloudasset.googleapis."
+ "com/Asset\022\001*2\332\004\n\022KeyTrackingService\022\201\002\n\034"
+ "GetProtectedResourcesSummary\022B.google.cl"
+ "oud.kms.inventory.v1.GetProtectedResourc"
+ "esSummaryRequest\0328.google.cloud.kms.inve"
+ "ntory.v1.ProtectedResourcesSummary\"c\332A\004n"
+ "ame\202\323\344\223\002V\022T/v1/{name=projects/*/location"
+ "s/*/keyRings/*/cryptoKeys/**}/protectedR"
+ "esourcesSummary\022\356\001\n\030SearchProtectedResou"
+ "rces\022>.google.cloud.kms.inventory.v1.Sea"
+ "rchProtectedResourcesRequest\032?.google.cl"
+ "oud.kms.inventory.v1.SearchProtectedReso"
+ "urcesResponse\"Q\332A\021scope, crypto_key\202\323\344\223\002"
+ "7\0225/v1/{scope=organizations/*}/protected"
+ "Resources:search\032O\312A\033kmsinventory.google"
+ "apis.com\322A.https://www.googleapis.com/au"
+ "th/cloud-platformB\302\001\n!com.google.cloud.k"
+ "ms.inventory.v1B\027KeyTrackingServiceProto"
+ "P\001Z?cloud.google.com/go/kms/inventory/ap"
+ "iv1/inventorypb;inventorypb\370\001\001\252\002\035Google."
+ "Cloud.Kms.Inventory.V1\312\002\035Google\\Cloud\\Km"
+ "s\\Inventory\\V1b\006proto3"
+ "(\t\022\034\n\016resource_types\030\005 \003(\tB\004\342A\001\001\"\212\001\n Sea"
+ "rchProtectedResourcesResponse\022M\n\023protect"
+ "ed_resources\030\001 \003(\01320.google.cloud.kms.in"
+ "ventory.v1.ProtectedResource\022\027\n\017next_pag"
+ "e_token\030\002 \001(\t\"\372\003\n\021ProtectedResource\022\014\n\004n"
+ "ame\030\001 \001(\t\022\017\n\007project\030\002 \001(\t\022\022\n\nproject_id"
+ "\030\t \001(\t\022\025\n\rcloud_product\030\010 \001(\t\022\025\n\rresourc"
+ "e_type\030\003 \001(\t\022\020\n\010location\030\004 \001(\t\022L\n\006labels"
+ "\030\005 \003(\0132<.google.cloud.kms.inventory.v1.P"
+ "rotectedResource.LabelsEntry\022I\n\022crypto_k"
+ "ey_version\030\006 \001(\tB-\372A*\n(cloudkms.googleap"
+ "is.com/CryptoKeyVersion\022J\n\023crypto_key_ve"
+ "rsions\030\n \003(\tB-\372A*\n(cloudkms.googleapis.c"
+ "om/CryptoKeyVersion\0225\n\013create_time\030\007 \001(\013"
+ "2\032.google.protobuf.TimestampB\004\342A\001\003\032-\n\013La"
+ "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028"
+ "\001:\'\352A$\n\037cloudasset.googleapis.com/Asset\022"
+ "\001*2\332\004\n\022KeyTrackingService\022\201\002\n\034GetProtect"
+ "edResourcesSummary\022B.google.cloud.kms.in"
+ "ventory.v1.GetProtectedResourcesSummaryR"
+ "equest\0328.google.cloud.kms.inventory.v1.P"
+ "rotectedResourcesSummary\"c\332A\004name\202\323\344\223\002V\022"
+ "T/v1/{name=projects/*/locations/*/keyRin"
+ "gs/*/cryptoKeys/**}/protectedResourcesSu"
+ "mmary\022\356\001\n\030SearchProtectedResources\022>.goo"
+ "gle.cloud.kms.inventory.v1.SearchProtect"
+ "edResourcesRequest\032?.google.cloud.kms.in"
+ "ventory.v1.SearchProtectedResourcesRespo"
+ "nse\"Q\332A\021scope, crypto_key\202\323\344\223\0027\0225/v1/{sc"
+ "ope=organizations/*}/protectedResources:"
+ "search\032O\312A\033kmsinventory.googleapis.com\322A"
+ ".https://www.googleapis.com/auth/cloud-p"
+ "latformB\302\001\n!com.google.cloud.kms.invento"
+ "ry.v1B\027KeyTrackingServiceProtoP\001Z?cloud."
+ "google.com/go/kms/inventory/apiv1/invent"
+ "orypb;inventorypb\370\001\001\252\002\035Google.Cloud.Kms."
+ "Inventory.V1\312\002\035Google\\Cloud\\Kms\\Inventor"
+ "y\\V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down Expand Up @@ -212,7 +213,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_kms_inventory_v1_SearchProtectedResourcesRequest_descriptor,
new java.lang.String[] {
"Scope", "CryptoKey", "PageSize", "PageToken",
"Scope", "CryptoKey", "PageSize", "PageToken", "ResourceTypes",
});
internal_static_google_cloud_kms_inventory_v1_SearchProtectedResourcesResponse_descriptor =
getDescriptor().getMessageTypes().get(3);
Expand Down
Loading

0 comments on commit 1e8aa17

Please sign in to comment.