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-v1 and proto-google-cloud-modelarmor-v1beta contain no
FilterVersionSelector message and no FILTER_VERSION_ALIAS_* enum.
Template.TemplateMetadata.Builder has no filter version getter or setter in either v1 or
v1beta.
- The field is also missing from the published protos in
googleapis/googleapis
(google/cloud/modelarmor/v1/service.proto and v1beta/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)
- 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.0 to 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
Issue Details
The Model Armor documentation describes pinning a template's filter version by setting
templateMetadata.filterVersionSelector(for example, aliasFILTER_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-modelarmor0.39.0 (latest on Maven Central as of this filing):proto-google-cloud-modelarmor-v1andproto-google-cloud-modelarmor-v1betacontain noFilterVersionSelectormessage and noFILTER_VERSION_ALIAS_*enum.Template.TemplateMetadata.Builderhas no filter version getter or setter in eitherv1orv1beta.googleapis/googleapis(
google/cloud/modelarmor/v1/service.protoandv1beta/service.proto), so the gap appears to bein 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_maskpath such astemplate_metadata.filter_version_selector.Environment
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:
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)Reproducer
Steps to reproduce:
com.google.cloud:google-cloud-modelarmor:0.39.0to a Java project.documentation linked above.
Code snippet showing what I'd expect to be able to write (these types and methods don't exist in
0.39.0):
To confirm the field is absent from the generated classes:
Logs and Stack Trace
N/A.
Behavior
No workaround to setting this for us since we cannot call REST API directly in the deployed system