Repository navigation
[modelarmor] Expose Template filter version selector (filterVersionSelector) in the Java client #14546
Description
Issue Details
The Model Armor documentation describes pinning a template's filter version by setting
templateMetadata.filterVersionSelector (for example, alias FILTER_VERSION_ALIAS_STABLE):
https://docs.cloud.google.com/model-armor/set-filter-version
The Java client library doesn't expose this field, so there's no typed way to set or update the
filter version selector when creating (CreateTemplate) or updating (UpdateTemplate) a template.
What I checked in google-cloud-modelarmor 0.39.0 (latest on Maven Central as of this filing):
proto-google-cloud-modelarmor-v1andproto-google-cloud-modelarmor-v1betacontain no
FilterVersionSelectormessage and noFILTER_VERSION_ALIAS_*enum.Template.TemplateMetadata.Builderhas no filter version getter or setter in eitherv1or
v1beta.- The field is also missing from the published protos in
googleapis/googleapis
(google/cloud/modelarmor/v1/service.protoandv1beta/service.proto), so the gap appears to be
in the upstream API definition rather than in client generation.
I opened a Google Cloud support case first, and support directed me to file an issue here.
Requested change: expose the filter version selector in the Model Armor protos and Java client
so it can be set on template create and update, including through an update_mask path such as
template_metadata.filter_version_selector.
Environment
- OS Type and Version: macOS 26 (development)
- Java Version and JDK Vendor: Java 25 (Azul Zulu 25.0.3+9-LTS)
- (If using GraalVM) GraalVM Version: N/A, not using GraalVM
GCP deployment details: N/A. This is a missing API field in the client library, not an
environment-specific runtime failure.
Dependencies
Provide the versions of the relevant libraries:
- Libraries-Bom: not used
- Client Libraries:
com.google.cloud:google-cloud-modelarmor:0.39.0
(proto-google-cloud-modelarmor-v1:0.39.0,proto-google-cloud-modelarmor-v1beta:0.39.0)
- Client Libraries:
- Gax (gax / gax-grpc / gax-httpjson): 2.86.0
- Auth (google-auth-library-oauth2-http / google-auth-library-credentials): 1.53.0
- Any other relevant Java SDK dependencies:
- Google-Http-Java-Client: 2.2.0
- protobuf-java: 4.33.6
- grpc-api: 1.83.0
Reproducer
Steps to reproduce:
- Add
com.google.cloud:google-cloud-modelarmor:0.39.0to a Java project. - Try to set a filter version selector on a template's metadata, as described in the
documentation linked above. - There's no corresponding type or builder method to call, so the code doesn't compile.
Code snippet showing what I'd expect to be able to write (these types and methods don't exist in
0.39.0):
Template template =
Template.newBuilder()
.setFilterConfig(filterConfig)
.setTemplateMetadata(
Template.TemplateMetadata.newBuilder()
// Not available in v1 or v1beta as of 0.39.0:
.setFilterVersionSelector(
FilterVersionSelector.newBuilder()
.setAlias(FilterVersionAlias.FILTER_VERSION_ALIAS_STABLE)))
.build();
try (ModelArmorClient client = ModelArmorClient.create()) {
client.createTemplate(
CreateTemplateRequest.newBuilder()
.setParent(LocationName.of(projectId, location).toString())
.setTemplateId(templateId)
.setTemplate(template)
.build());
}To confirm the field is absent from the generated classes:
javap -cp proto-google-cloud-modelarmor-v1-0.39.0.jar \
'com.google.cloud.modelarmor.v1.Template$TemplateMetadata$Builder' | grep -i filterversion
# (no output)
Logs and Stack Trace
N/A.
Behavior
- When did the issue begin? The field has been missing in every version
- Is this behavior flaky? No, it's consistent: the API surface isn't there.
- Is this behavior related to the volume of data? No.
No workaround to setting this for us since we cannot call REST API directly in the deployed system
Activity
saloni-eng commentedon Oct 2, 2026
Hey,
I'd like to look into this, could you pls assign this to me or confirm no one else is working on the same?
Thanks!
jinseopkim0 commentedon Oct 2, 2026
If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response. We try to review GitHub issues on a regular basis, however we cannot guarantee an SLO.
bxie-box commentedon Oct 2, 2026
Hi Jin,
I created a Google Support Case actually, but was redirected here to create an issue instead. I will add this Github Issue back to the case.
lqiu96 commentedon Oct 20, 2026
Taking a look at this.
FilterVersionSelectorlooks to be field on the protos. These libraries are generated from upstream protos so any changes in the library will be overwritten on the next generation.Let me ask around to help get this field propagated to the library. Looks like there may have been a link missing here. I don't think this exists in any of the other languages, so this may just have been something that went wrong upstream.
lqiu96 commentedon Oct 21, 2026
Update: Talked to internal team and changes were accidentally left out. We are fixing this and the upstream changes are making their to the repo. We should be able to generate again with the proper changes soon.
Apologies for the issue and thanks for your patience :)
lqiu96 commentedon Oct 21, 2026
This should be generated in #14717. Marking this as closed and this should be part of the next release coming out this week. Will be updated in the next version of modelarmor