From 102db0ca1e3fe03322e74b4033912858006c79c6 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 20 Oct 2026 12:31:36 -0400 Subject: [PATCH 01/35] chore: update librarian version to v0.49.0 (#14700) Update librarian version to v0.49.0. ## Debug Info ### System Details - JDK version: javac 17.0.20.1 - Maven version: Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) - OS: Linux 7.1.6-1rodete1-amd64 x86_64 - Librarian version: v0.49.0 ### Commands Executed - `go run github.com/googleapis/librarian/cmd/librarian@latest update version` - `go run github.com/googleapis/librarian/cmd/librarian@v0.49.0 tidy` - `go run github.com/googleapis/librarian/cmd/librarian@v0.49.0 install` - `go run github.com/googleapis/librarian/cmd/librarian@v0.49.0 generate --all` - `git add .` - `git commit -m "chore: update librarian version to v0.49.0"` --- librarian.yaml | 268 +------------------------------------------------ 1 file changed, 1 insertion(+), 267 deletions(-) diff --git a/librarian.yaml b/librarian.yaml index 6331b586961a..0102e1667e6d 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. language: java -version: v0.48.0 +version: v0.49.0 repo: googleapis/google-cloud-java sources: googleapis: @@ -58,7 +58,6 @@ libraries: - path: google/cloud/accessapproval/v1 java: api_description_override: enables controlling access to your organization's data by Google personnel. - released_version: 2.100.0 name_pretty_override: Access Approval product_documentation_override: https://cloud.google.com/access-approval/docs/ - name: accesscontextmanager @@ -75,7 +74,6 @@ libraries: java: api_description_override: n/a artifact_id: google-identity-accesscontextmanager - released_version: 1.100.0 name_pretty_override: Identity Access Context Manager product_documentation_override: n/a - name: admanager @@ -87,7 +85,6 @@ libraries: api_description_override: The Ad Manager API enables an app to integrate with Google Ad Manager. You can read Ad Manager data and run reports using the API. artifact_id: ad-manager client_documentation_override: https://cloud.google.com/java/docs/reference/ad-manager/latest/overview - released_version: 0.58.0 library_type_override: GAPIC_AUTO name_pretty_override: Google Ad Manager API product_documentation_override: https://developers.google.com/ad-manager/api/beta @@ -99,7 +96,6 @@ libraries: omit_common_resources: true java: api_description_override: An API for accessing Advisory Notifications in Google Cloud. - released_version: 0.88.0 name_pretty_override: Advisory Notifications API product_documentation_override: https://cloud.google.com/advisory-notifications/ - name: agentidentity @@ -115,8 +111,6 @@ libraries: additional_protos: - path: google/cloud/location/locations.proto - path: google/iam/v1/iam_policy.proto - java: - released_version: 0.5.0 - name: agentregistry version: 0.7.0-SNAPSHOT apis: @@ -124,8 +118,6 @@ libraries: java: additional_protos: - path: google/cloud/location/locations.proto - java: - released_version: 0.6.0 - name: aiplatform version: 3.101.0-SNAPSHOT apis: @@ -153,7 +145,6 @@ libraries: - google-cloud-aiplatform/src/test/java/com/google/iam/v1/MockIAMPolicyImpl.java java: api_description_override: is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle. - released_version: 3.100.0 name_pretty_override: Vertex AI product_documentation_override: https://cloud.google.com/vertex-ai/docs - name: alloydb @@ -176,7 +167,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: AlloyDB is a fully managed, PostgreSQL-compatible database service with industry-leading performance, availability, and scale. - released_version: 0.88.0 name_pretty_override: AlloyDB product_documentation_override: https://cloud.google.com/alloydb/ - name: alloydb-connectors @@ -206,7 +196,6 @@ libraries: java: api_id_override: connectors.googleapis.com api_description_override: AlloyDB is a fully-managed, PostgreSQL-compatible database for demanding transactional workloads. It provides enterprise-grade performance and availability while maintaining 100% compatibility with open-source PostgreSQL. - released_version: 0.77.0 name_pretty_override: AlloyDB connectors product_documentation_override: https://cloud.google.com/alloydb/docs transport_override: grpc @@ -219,7 +208,6 @@ libraries: api_description_override: allows you to manage Google Analytics accounts and properties. artifact_id: google-analytics-admin codeowner_team: '@googleapis/analytics-dpe' - released_version: 0.109.0 name_pretty_override: Analytics Admin product_documentation_override: https://developers.google.com/analytics - name: analytics-data @@ -232,7 +220,6 @@ libraries: api_description_override: provides programmatic methods to access report data in Google Analytics App+Web properties. artifact_id: google-analytics-data codeowner_team: '@googleapis/analytics-dpe' - released_version: 0.110.0 name_pretty_override: Analytics Data product_documentation_override: https://developers.google.com/analytics/trusted-testing/analytics-data - name: analyticshub @@ -241,7 +228,6 @@ libraries: - path: google/cloud/bigquery/analyticshub/v1 java: api_description_override: TBD - released_version: 0.96.0 name_pretty_override: Analytics Hub API product_documentation_override: https://cloud.google.com/bigquery/TBD - name: api-gateway @@ -251,7 +237,6 @@ libraries: java: api_id_override: apigateway.googleapis.com api_description_override: enables you to provide secure access to your backend services through a well-defined REST API that is consistent across all of your services, regardless of the service implementation. Clients consume your REST APIS to implement standalone apps for a mobile device or tablet, through apps running in a browser, or through any other type of app that can make a request to an HTTP endpoint. - released_version: 2.99.0 name_pretty_override: API Gateway product_documentation_override: https://cloud.google.com/api-gateway/docs - name: apigee-connect @@ -260,7 +245,6 @@ libraries: - path: google/cloud/apigeeconnect/v1 java: api_description_override: allows the Apigee hybrid management plane to connect securely to the MART service in the runtime plane without requiring you to expose the MART endpoint on the internet. - released_version: 2.99.0 name_pretty_override: Apigee Connect product_documentation_override: https://cloud.google.com/apigee/docs/hybrid/v1.3/apigee-connect/ - name: apihub @@ -274,7 +258,6 @@ libraries: api_id_override: apihub.googleapis.com api_description_override: API hub lets you consolidate and organize information about all of the APIs of interest to your organization. API hub lets you capture critical information about APIs that allows developers to discover and evaluate them easily and leverage the work of other teams wherever possible. API platform teams can use API hub to have visibility into and manage their portfolio of APIs. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-apihub/latest/overview - released_version: 0.52.0 library_type_override: GAPIC_AUTO name_pretty_override: API hub API product_documentation_override: https://cloud.google.com/apigee/docs/apihub/what-is-api-hub @@ -284,7 +267,6 @@ libraries: - path: google/api/apikeys/v2 java: api_description_override: API Keys lets you create and manage your API keys for your projects. - released_version: 0.97.0 name_pretty_override: API Keys API product_documentation_override: https://cloud.google.com/api-keys/ - name: appengine-admin @@ -294,7 +276,6 @@ libraries: java: api_description_override: you to manage your App Engine applications. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.99.0 name_pretty_override: App Engine Admin API product_documentation_override: https://cloud.google.com/appengine/docs/admin-api/ - name: apphub @@ -307,7 +288,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: App Hub simplifies the process of building, running, and managing applications on Google Cloud. - released_version: 0.63.0 name_pretty_override: App Hub API product_documentation_override: https://cloud.google.com/app-hub/docs/overview - name: appoptimize @@ -321,7 +301,6 @@ libraries: api_id_override: appoptimize.googleapis.com api_description_override: The App Optimize API provides developers and platform teams with tools to monitor, analyze, and improve the performance and cost-efficiency of their cloud applications. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-appoptimize/latest/overview - released_version: 0.9.0 library_type_override: GAPIC_AUTO name_pretty_override: App Optimize API product_documentation_override: https://docs.cloud.google.com/app-optimize/overview @@ -332,8 +311,6 @@ libraries: java: additional_protos: - path: google/cloud/location/locations.proto - java: - released_version: 0.3.0 - name: area120-tables version: 0.104.0-SNAPSHOT apis: @@ -342,7 +319,6 @@ libraries: api_description_override: provides programmatic methods to the Area 120 Tables API. artifact_id: google-area120-tables group_id: com.google.area120 - released_version: 0.103.0 name_pretty_override: Area 120 Tables product_documentation_override: https://area120.google.com/ - name: artifact-registry @@ -359,7 +335,6 @@ libraries: java: api_description_override: provides a single place for your organization to manage container images and language packages (such as Maven and npm). It is fully integrated with Google Cloud's tooling and runtimes and comes with support for native artifact protocols. This makes it simple to integrate it with your CI/CD tooling to set up automated pipelines. codeowner_team: '@googleapis/aap-dpes' - released_version: 1.98.0 name_pretty_override: Artifact Registry product_documentation_override: https://cloud.google.com/artifact-registry - name: asset @@ -376,7 +351,6 @@ libraries: java: api_description_override: provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe. issue_tracker_override: https://issuetracker.google.com/issues/new?component=187210 - released_version: 3.103.0 name_pretty_override: Cloud Asset Inventory product_documentation_override: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview - name: assured-workloads @@ -386,7 +360,6 @@ libraries: - path: google/cloud/assuredworkloads/v1beta1 java: api_description_override: allows you to secure your government workloads and accelerate your path to running compliant workloads on Google Cloud with Assured Workloads for Government. - released_version: 2.99.0 name_pretty_override: Assured Workloads for Government product_documentation_override: https://cloud.google.com/assured-workloads/ - name: auditmanager @@ -400,7 +373,6 @@ libraries: api_id_override: auditmanager.googleapis.com api_description_override: Lists information about the supported locations for this service. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-auditmanager/latest/overview - released_version: 0.17.0 library_type_override: GAPIC_AUTO name_pretty_override: Audit Manager API product_documentation_override: https://cloud.google.com/audit-manager/docs @@ -417,7 +389,6 @@ libraries: api_id_override: backstory.googleapis.com api_description_override: Common Universal Data Model (UDM) and Entity protos used by Chronicle. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-backstory/latest/overview - released_version: 0.7.0 library_type_override: GAPIC_AUTO name_pretty_override: Malachite Common Protos product_documentation_override: https://cloud.google.com/chronicle/docs/secops/secops-overview @@ -438,7 +409,6 @@ libraries: api_id_override: backupdr.googleapis.com api_description_override: 'Backup and DR Service is a powerful, centralized, cloud-first backup and disaster recovery solution for cloud-based and hybrid workloads. ' client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-backupdr/latest/overview - released_version: 0.58.0 library_type_override: GAPIC_AUTO name_pretty_override: Backup and DR Service API product_documentation_override: https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-dr @@ -452,7 +422,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk. - released_version: 0.99.0 name_pretty_override: Bare Metal Solution product_documentation_override: https://cloud.google.com/bare-metal/docs - name: batch @@ -469,7 +438,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: n/a - released_version: 0.99.0 name_pretty_override: Cloud Batch product_documentation_override: https://cloud.google.com/ - name: beyondcorp-appconnections @@ -483,7 +451,6 @@ libraries: java: api_description_override: is Google's implementation of the zero trust model. It builds upon a decade of experience at Google, combined with ideas and best practices from the community. By shifting access controls from the network perimeter to individual users, BeyondCorp enables secure work from virtually any location without the need for a traditional VPN. api_shortname_override: beyondcorp-appconnections - released_version: 0.97.0 name_pretty_override: BeyondCorp AppConnections product_documentation_override: https://cloud.google.com/beyondcorp-enterprise/ - name: beyondcorp-appconnectors @@ -497,7 +464,6 @@ libraries: java: api_description_override: provides methods to manage (create/read/update/delete) BeyondCorp AppConnectors. api_shortname_override: beyondcorp-appconnectors - released_version: 0.97.0 name_pretty_override: BeyondCorp AppConnectors product_documentation_override: cloud.google.com/beyondcorp-enterprise/ - name: beyondcorp-appgateways @@ -512,7 +478,6 @@ libraries: api_id_override: beyondcorp.googleapis.com api_description_override: A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. api_shortname_override: beyondcorp-appgateways - released_version: 0.97.0 name_pretty_override: BeyondCorp AppGateways product_documentation_override: https://cloud.google.com/beyondcorp-enterprise/ - name: beyondcorp-clientconnectorservices @@ -527,7 +492,6 @@ libraries: api_id_override: beyondcorp.googleapis.com api_description_override: A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. api_shortname_override: beyondcorp-clientconnectorservices - released_version: 0.97.0 name_pretty_override: BeyondCorp ClientConnectorServices product_documentation_override: https://cloud.google.com/beyondcorp-enterprise/ - name: beyondcorp-clientgateways @@ -542,7 +506,6 @@ libraries: api_id_override: beyondcorp.googleapis.com api_description_override: A zero trust solution that enables secure access to applications and resources, and offers integrated threat and data protection. api_shortname_override: beyondcorp-clientgateways - released_version: 0.97.0 name_pretty_override: BeyondCorp ClientGateways product_documentation_override: https://cloud.google.com/beyondcorp-enterprise/ - name: biglake @@ -554,15 +517,12 @@ libraries: - path: google/cloud/bigquery/biglake/v1alpha1 java: api_description_override: The BigLake API provides access to BigLake Metastore, a serverless, fully managed, and highly available metastore for open-source data that can be used for querying Apache Iceberg tables in BigQuery. - released_version: 0.87.0 name_pretty_override: BigLake product_documentation_override: https://cloud.google.com/biglake - name: biglake-hive version: 0.5.0-SNAPSHOT apis: - path: google/cloud/biglake/hive/v1 - java: - released_version: 0.4.0 - name: bigquery-data-exchange version: 2.95.0-SNAPSHOT apis: @@ -572,7 +532,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: is a data exchange that allows you to efficiently and securely exchange data assets across organizations to address challenges of data reliability and cost. - released_version: 2.94.0 name_pretty_override: Analytics Hub product_documentation_override: https://cloud.google.com/analytics-hub - name: bigqueryconnection @@ -583,7 +542,6 @@ libraries: java: api_description_override: allows users to manage BigQuery connections to external data sources. client_documentation_override: https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1beta1 - released_version: 2.101.0 name_pretty_override: Cloud BigQuery Connection product_documentation_override: https://cloud.google.com/bigquery/docs/reference/bigqueryconnection/rest - name: bigquerydatapolicy @@ -595,7 +553,6 @@ libraries: - path: google/cloud/bigquery/datapolicies/v1beta1 java: api_description_override: Allows users to manage BigQuery data policies. - released_version: 0.96.0 name_pretty_override: BigQuery DataPolicy API product_documentation_override: https://cloud.google.com/bigquery/docs/reference/datapolicy/ - name: bigquerydatatransfer @@ -629,7 +586,6 @@ libraries: func_name: public static List toStringList(List<@Nullable RunName> values) java: api_description_override: transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis. - released_version: 2.99.0 name_pretty_override: BigQuery Data Transfer Service product_documentation_override: https://cloud.google.com/bigquery/transfer/ - name: bigquerymigration @@ -639,7 +595,6 @@ libraries: - path: google/cloud/bigquery/migration/v2alpha java: api_description_override: BigQuery Migration API - released_version: 0.102.0 name_pretty_override: BigQuery Migration product_documentation_override: https://cloud.google.com/bigquery/docs - name: bigqueryreservation @@ -648,7 +603,6 @@ libraries: - path: google/cloud/bigquery/reservation/v1 java: api_description_override: allows users to manage their flat-rate BigQuery reservations. - released_version: 2.100.0 name_pretty_override: Cloud BigQuery Reservation product_documentation_override: https://cloud.google.com/bigquery/docs/reference/reservations/rpc - name: bigquerystorage @@ -776,7 +730,6 @@ libraries: client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/history codeowner_team: '@googleapis/bigquery-team' issue_tracker_override: https://issuetracker.google.com/savedsearches/559654 - released_version: 3.35.0 library_type_override: GAPIC_COMBO name_pretty_override: BigQuery Storage product_documentation_override: https://cloud.google.com/bigquery/docs/reference/storage/ @@ -872,7 +825,6 @@ libraries: excluded_poms: - google-cloud-bigtable-bom issue_tracker_override: https://issuetracker.google.com/savedsearches/559777 - released_version: 2.85.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Bigtable product_documentation_override: https://cloud.google.com/bigtable @@ -888,7 +840,6 @@ libraries: java: api_description_override: allows developers to manage their billing accounts or browse the catalog of SKUs and pricing. issue_tracker_override: https://issuetracker.google.com/savedsearches/559770 - released_version: 2.99.0 name_pretty_override: Cloud Billing product_documentation_override: https://cloud.google.com/billing/docs - name: billingbudgets @@ -898,7 +849,6 @@ libraries: - path: google/cloud/billing/budgets/v1beta1 java: api_description_override: allows you to avoid surprises on your bill by creating budgets to monitor all your Google Cloud charges in one place. - released_version: 2.99.0 name_pretty_override: Cloud Billing Budgets product_documentation_override: https://cloud.google.com/billing/docs/how-to/budgets - name: binary-authorization @@ -910,7 +860,6 @@ libraries: api_id_override: binaryauthorization.googleapis.com api_description_override: ' is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and Anthos clusters on VMware' codeowner_team: '@googleapis/aap-dpes' - released_version: 1.98.0 name_pretty_override: Binary Authorization product_documentation_override: https://cloud.google.com/binary-authorization/docs - name: capacityplanner @@ -921,7 +870,6 @@ libraries: api_id_override: capacityplanner.googleapis.com api_description_override: Provides programmatic access to Capacity Planner features. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-capacityplanner/latest/overview - released_version: 0.22.0 library_type_override: GAPIC_AUTO name_pretty_override: Capacity Planner API product_documentation_override: https://cloud.google.com/capacity-planner/docs @@ -935,7 +883,6 @@ libraries: java: api_id_override: certificatemanager.googleapis.com api_description_override: lets you acquire and manage TLS (SSL) certificates for use with Cloud Load Balancing. - released_version: 0.102.0 name_pretty_override: Certificate Manager product_documentation_override: https://cloud.google.com/certificate-manager/docs - name: ces @@ -953,7 +900,6 @@ libraries: api_id_override: ces.googleapis.com api_description_override: Customer Experience Agent Studio (CX Agent Studio) is a minimal code conversational agent builder. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-ces/latest/overview - released_version: 0.15.0 library_type_override: GAPIC_AUTO name_pretty_override: Gemini Enterprise for Customer Experience API product_documentation_override: https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps @@ -963,7 +909,6 @@ libraries: - path: google/cloud/channel/v1 java: api_description_override: With Channel Services, Google Cloud partners and resellers have a single unified resale platform, with a unified resale catalog, customer management, order management, billing management, policy and authorization management, and cost management. - released_version: 3.103.0 name_pretty_override: Channel Services product_documentation_override: https://cloud.google.com/channel/docs - name: chat @@ -972,7 +917,6 @@ libraries: - path: google/chat/v1 java: api_description_override: The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. - released_version: 0.63.0 name_pretty_override: Google Chat API product_documentation_override: https://developers.google.com/chat/concepts - name: chronicle @@ -983,7 +927,6 @@ libraries: api_id_override: chronicle.googleapis.com api_description_override: The Google Cloud Security Operations API, popularly known as the Chronicle API, serves endpoints that enable security analysts to analyze and mitigate a security threat throughout its lifecycle client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-chronicle/latest/overview - released_version: 0.37.0 library_type_override: GAPIC_AUTO name_pretty_override: Chronicle API product_documentation_override: https://cloud.google.com/chronicle/docs/secops/secops-overview @@ -1002,7 +945,6 @@ libraries: api_id_override: cloudapiregistry.googleapis.com api_description_override: Cloud API Registry lets you discover, govern, use, and monitor Model Context Protocol (MCP) servers and tools provided by Google, or by your organization through Apigee API hub. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-cloudapiregistry/latest/overview - released_version: 0.18.0 library_type_override: GAPIC_AUTO name_pretty_override: Cloud API Registry API product_documentation_override: https://docs.cloud.google.com/api-registry/docs/overview @@ -1019,7 +961,6 @@ libraries: api_description_override: lets you build software quickly across all languages. Get complete control over defining custom workflows for building, testing, and deploying across multiple environments such as VMs, serverless, Kubernetes, or Firebase. artifact_id: google-cloud-build codeowner_team: '@googleapis/aap-dpes' - released_version: 3.101.0 name_pretty_override: Cloud Build product_documentation_override: https://cloud.google.com/cloud-build/ - name: cloudcommerceconsumerprocurement @@ -1029,7 +970,6 @@ libraries: - path: google/cloud/commerce/consumer/procurement/v1alpha1 java: api_description_override: Find top solutions integrated with Google Cloud to accelerate your digital transformation. Scale and simplify procurement for your organization with online discovery, flexible purchasing, and fulfillment of enterprise-grade cloud solutions. - released_version: 0.97.0 name_pretty_override: Cloud Commerce Consumer Procurement product_documentation_override: https://cloud.google.com/marketplace/ - name: cloudcontrolspartner @@ -1039,7 +979,6 @@ libraries: - path: google/cloud/cloudcontrolspartner/v1beta java: api_description_override: Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. - released_version: 0.63.0 name_pretty_override: Cloud Controls Partner API product_documentation_override: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners - name: cloudquotas @@ -1056,7 +995,6 @@ libraries: Cloud Quotas API provides GCP service consumers with management and observability for resource usage, quotas, and restrictions of the services they consume. - released_version: 0.67.0 name_pretty_override: Cloud Quotas API product_documentation_override: https://cloud.google.com/cloudquotas/docs/ - name: cloudsecuritycompliance @@ -1070,7 +1008,6 @@ libraries: api_id_override: cloudsecuritycompliance.googleapis.com api_description_override: Compliance Manager uses software-defined controls that let you assess support for multiple compliance programs and security requirements within a Google Cloud organization client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-cloudsecuritycompliance/latest/overview - released_version: 0.26.0 library_type_override: GAPIC_AUTO name_pretty_override: Cloud Security Compliance API product_documentation_override: https://cloud.google.com/security-command-center/docs/compliance-manager-overview @@ -1081,7 +1018,6 @@ libraries: - path: google/cloud/support/v2beta java: api_description_override: Manages Google Cloud technical support cases for Customer Care support offerings. - released_version: 0.83.0 name_pretty_override: Google Cloud Support API product_documentation_override: https://cloud.google.com/support/docs/reference/support-api/ - name: commerceproducer @@ -1091,8 +1027,6 @@ libraries: java: additional_protos: - path: google/cloud/location/locations.proto - java: - released_version: 0.5.0 - name: common-protos version: 2.79.0-SNAPSHOT apis: @@ -1193,7 +1127,6 @@ libraries: - proto-google-common-protos-bom - proto-google-common-protos group_id: com.google.api.grpc - released_version: 2.78.0 library_type_override: OTHER name_pretty_override: Common Protos product_documentation_override: https://github.com/googleapis/api-common-protos @@ -1216,7 +1149,6 @@ libraries: api_description_override: 'delivers virtual machines running in Google''s innovative data centers and worldwide fiber network. Compute Engine''s tooling and workflow support enable scaling from single instances to global, load-balanced cloud computing. Compute Engine''s VMs boot quickly, come with persistent disk storage, deliver consistent performance and are available in many configurations. ' excluded_poms: - grpc-google-cloud-compute-v1 - released_version: 1.109.0 name_pretty_override: Compute Engine product_documentation_override: https://cloud.google.com/compute/ - name: confidentialcomputing @@ -1232,7 +1164,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Protect data in-use with Confidential VMs, Confidential GKE, Confidential Dataproc, and Confidential Space. - released_version: 0.85.0 name_pretty_override: Confidential Computing API product_documentation_override: https://cloud.google.com/confidential-computing/ - name: configdelivery @@ -1250,7 +1181,6 @@ libraries: api_id_override: configdelivery.googleapis.com api_description_override: ConfigDelivery service manages the deployment of kubernetes configuration to a fleet of kubernetes clusters. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-configdelivery/latest/overview - released_version: 0.33.0 library_type_override: GAPIC_AUTO name_pretty_override: Config Delivery API product_documentation_override: https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages @@ -1262,7 +1192,6 @@ libraries: api_id_override: connectgateway.googleapis.com api_description_override: The Connect Gateway service allows connectivity from external parties to connected Kubernetes clusters. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-connectgateway/latest/overview - released_version: 0.51.0 library_type_override: GAPIC_AUTO name_pretty_override: Connect Gateway API product_documentation_override: https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway @@ -1273,7 +1202,6 @@ libraries: java: api_description_override: ' helps users detect and visualize patterns in their contact center data.' codeowner_team: '@googleapis/api-contact-center-insights' - released_version: 2.99.0 name_pretty_override: CCAI Insights product_documentation_override: https://cloud.google.com/dialogflow/priv/docs/insights/ - name: container @@ -1288,7 +1216,6 @@ libraries: api_description_override: is an enterprise-grade platform for containerized applications, including stateful and stateless, AI and ML, Linux and Windows, complex and simple web apps, API, and backend services. Leverage industry-first features like four-way auto-scaling and no-stress management. Optimize GPU and TPU provisioning, use integrated developer tools, and get multi-cluster support from SREs. codeowner_team: '@googleapis/cloud-sdk-java-team' issue_tracker_override: https://issuetracker.google.com/savedsearches/559777 - released_version: 2.102.0 name_pretty_override: Kubernetes Engine product_documentation_override: https://cloud.google.com/kubernetes-engine/ - name: containeranalysis @@ -1327,7 +1254,6 @@ libraries: java: api_description_override: is a service that provides vulnerability scanning and metadata storage for software artifacts. The service performs vulnerability scans on built software artifacts, such as the images in Container Registry, then stores the resulting metadata and makes it available for consumption through an API. The metadata may come from several sources, including vulnerability scanning, other Cloud services, and third-party providers. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.100.0 name_pretty_override: Cloud Container Analysis product_documentation_override: https://cloud.google.com/container-registry/docs/container-analysis - name: contentwarehouse @@ -1336,7 +1262,6 @@ libraries: - path: google/cloud/contentwarehouse/v1 java: api_description_override: Document AI Warehouse is an integrated cloud-native GCP platform to store, search, organize, govern and analyze documents and their structured metadata. - released_version: 0.95.0 name_pretty_override: Document AI Warehouse product_documentation_override: https://cloud.google.com/document-warehouse/docs/overview - name: data-fusion @@ -1346,7 +1271,6 @@ libraries: - path: google/cloud/datafusion/v1beta1 java: api_description_override: is a fully managed, cloud-native, enterprise data integration service for quickly building and managing data pipelines. - released_version: 1.99.0 name_pretty_override: Cloud Data Fusion product_documentation_override: https://cloud.google.com/data-fusion/docs - name: databasecenter @@ -1357,7 +1281,6 @@ libraries: api_id_override: databasecenter.googleapis.com api_description_override: Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center's fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-databasecenter/latest/overview - released_version: 0.20.0 library_type_override: GAPIC_AUTO name_pretty_override: Database Center API product_documentation_override: https://cloud.google.com/database-center/docs/overview @@ -1367,7 +1290,6 @@ libraries: - path: google/dataflow/v1beta3 java: api_description_override: is a managed service for executing a wide variety of data processing patterns. - released_version: 0.103.0 name_pretty_override: Dataflow product_documentation_override: https://cloud.google.com/dataflow/docs - name: dataform @@ -1385,7 +1307,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: Help analytics teams manage data inside BigQuery using SQL. - released_version: 0.98.0 name_pretty_override: Cloud Dataform product_documentation_override: https://cloud.google.com/dataform/docs - name: datalineage @@ -1395,7 +1316,6 @@ libraries: - path: google/cloud/datacatalog/lineage/configmanagement/v1 java: api_description_override: Lineage is used to track data flows between assets over time. - released_version: 0.91.0 name_pretty_override: Data Lineage product_documentation_override: https://cloud.google.com/dataplex/docs/about-data-lineage - name: datamanager @@ -1407,7 +1327,6 @@ libraries: api_description_override: A unified ingestion API for data partners, agencies and advertisers to connect first-party data across Google advertising products. artifact_id: data-manager client_documentation_override: https://cloud.google.com/java/docs/reference/data-manager/latest/overview - released_version: 0.20.0 library_type_override: GAPIC_AUTO name_pretty_override: Data Manager API product_documentation_override: https://developers.google.com/data-manager @@ -1421,7 +1340,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: provides intelligent data fabric that enables organizations to centrally manage, monitor, and govern their data across data lakes, data warehouses, and data marts with consistent controls, providing access to trusted data and powering analytics at scale. - released_version: 1.97.0 name_pretty_override: Cloud Dataplex product_documentation_override: https://cloud.google.com/dataplex - name: dataproc @@ -1434,7 +1352,6 @@ libraries: java: api_description_override: is a faster, easier, more cost-effective way to run Apache Spark and Apache Hadoop. codeowner_team: '@googleapis/api-dataproc' - released_version: 4.96.0 name_pretty_override: Dataproc product_documentation_override: https://cloud.google.com/dataproc - name: dataproc-metastore @@ -1457,7 +1374,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: is a fully managed, highly available, autoscaled, autohealing, OSS-native metastore service that greatly simplifies technical metadata management. Dataproc Metastore service is based on Apache Hive metastore and serves as a critical component towards enterprise data lakes. - released_version: 2.100.0 name_pretty_override: Dataproc Metastore product_documentation_override: https://cloud.google.com/dataproc-metastore/docs - name: datastore @@ -1477,7 +1393,6 @@ libraries: client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-datastore/latest/history excluded_poms: - grpc-google-cloud-datastore-v1 - released_version: 3.7.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Datastore product_documentation_override: https://cloud.google.com/datastore @@ -1493,7 +1408,6 @@ libraries: - path: google/cloud/datastream/v1alpha1 java: api_description_override: is a serverless and easy-to-use change data capture (CDC) and replication service. It allows you to synchronize data across heterogeneous databases and applications reliably, and with minimal latency and downtime. - released_version: 1.98.0 name_pretty_override: Datastream product_documentation_override: https://cloud.google.com/datastream/docs - name: deploy @@ -1507,7 +1421,6 @@ libraries: java: api_description_override: is a service that automates delivery of your applications to a series of target environments in a defined sequence codeowner_team: '@googleapis/aap-dpes' - released_version: 1.97.0 name_pretty_override: Google Cloud Deploy product_documentation_override: https://cloud.google.com/deploy/docs - name: developerconnect @@ -1521,7 +1434,6 @@ libraries: api_id_override: developerconnect.googleapis.com api_description_override: Connect third-party source code management to Google client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-developerconnect/latest/overview - released_version: 0.56.0 library_type_override: GAPIC_AUTO name_pretty_override: Developer Connect API product_documentation_override: https://cloud.google.com/developer-connect/docs/overview @@ -1534,7 +1446,6 @@ libraries: api_description_override: The Developer Knowledge API provides access to Google's developer knowledge artifact_id: google-cloud-developer-knowledge client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-developer-knowledge/latest/overview - released_version: 0.7.0 library_type_override: GAPIC_AUTO name_pretty_override: Developer Knowledge API product_documentation_override: https://developers.google.com/knowledge @@ -1546,7 +1457,6 @@ libraries: api_id_override: devicestreaming.googleapis.com api_description_override: The Cloud API for device streaming usage. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-devicestreaming/latest/overview - released_version: 0.39.0 library_type_override: GAPIC_AUTO name_pretty_override: Device Streaming API product_documentation_override: https://cloud.google.com/device-streaming/docs @@ -1622,7 +1532,6 @@ libraries: java: api_description_override: is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. Dialogflow Enterprise Edition users have access to Google Cloud Support and a service level agreement (SLA) for production deployments. issue_tracker_override: https://issuetracker.google.com/savedsearches/5300385 - released_version: 4.105.0 name_pretty_override: Dialogflow API product_documentation_override: https://cloud.google.com/dialogflow-enterprise/ - name: dialogflow-cx @@ -1639,7 +1548,6 @@ libraries: java: api_description_override: provides a new way of designing agents, taking a state machine approach to agent design. This gives you clear and explicit control over a conversation, a better end-user experience, and a better development workflow. api_shortname_override: dialogflow-cx - released_version: 0.110.0 name_pretty_override: Dialogflow CX product_documentation_override: https://cloud.google.com/dialogflow/cx/docs - name: discoveryengine @@ -1659,7 +1567,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: A Cloud API that offers search and recommendation discoverability for documents from different industry verticals (e.g. media, retail, etc.). - released_version: 0.95.0 name_pretty_override: Discovery Engine API product_documentation_override: https://cloud.google.com/discovery-engine/media/docs - name: distributedcloudedge @@ -1673,7 +1580,6 @@ libraries: api_id_override: edgecontainer.googleapis.com api_description_override: Google Distributed Cloud Edge allows you to run Kubernetes clusters on dedicated hardware provided and maintained by Google that is separate from the Google Cloud data center. api_shortname_override: distributedcloudedge - released_version: 0.96.0 name_pretty_override: Google Distributed Cloud Edge product_documentation_override: https://cloud.google.com/distributed-cloud/edge/latest/ - name: dlp @@ -1718,7 +1624,6 @@ libraries: java: api_description_override: provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams, like text blocks and images. issue_tracker_override: https://issuetracker.google.com/savedsearches/5548083 - released_version: 3.103.0 name_pretty_override: Cloud Data Loss Prevention product_documentation_override: https://cloud.google.com/dlp/docs/ - name: dms @@ -1728,7 +1633,6 @@ libraries: java: api_id_override: datamigration.googleapis.com api_description_override: makes it easier for you to migrate your data to Google Cloud. This service helps you lift and shift your MySQL and PostgreSQL workloads into Cloud SQL. - released_version: 2.98.0 name_pretty_override: Database Migration Service product_documentation_override: https://cloud.google.com/database-migration/docs - name: document-ai @@ -1745,7 +1649,6 @@ libraries: java: api_description_override: allows developers to unlock insights from your documents with machine learning. issue_tracker_override: https://issuetracker.google.com/savedsearches/559755 - released_version: 2.103.0 name_pretty_override: Document AI product_documentation_override: https://cloud.google.com/compute/docs/documentai/ - name: domains @@ -1756,7 +1659,6 @@ libraries: - path: google/cloud/domains/v1alpha2 java: api_description_override: allows you to register and manage domains by using Cloud Domains. - released_version: 1.96.0 name_pretty_override: Cloud Domains product_documentation_override: https://cloud.google.com/domains - name: edgenetwork @@ -1768,7 +1670,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Network management API for Distributed Cloud Edge. - released_version: 0.67.0 name_pretty_override: Distributed Cloud Edge Network API product_documentation_override: https://cloud.google.com/distributed-cloud/edge/latest/docs/overview - name: enterpriseknowledgegraph @@ -1777,7 +1678,6 @@ libraries: - path: google/cloud/enterpriseknowledgegraph/v1 java: api_description_override: Enterprise Knowledge Graph organizes siloed information into organizational knowledge, which involves consolidating, standardizing, and reconciling data in an efficient and useful way. - released_version: 0.95.0 name_pretty_override: Enterprise Knowledge Graph product_documentation_override: https://cloud.google.com/enterprise-knowledge-graph/docs/overview - name: errorreporting @@ -1830,7 +1730,6 @@ libraries: } java: api_description_override: 'counts, analyzes, and aggregates the crashes in your running cloud services. A centralized error management interface displays the results with sorting and filtering capabilities. A dedicated view shows the error details: time chart, occurrences, affected user count, first- and last-seen dates and a cleaned exception stack trace. Opt in to receive email and mobile alerts on new errors.' - released_version: 0.220.0-beta name_pretty_override: Error Reporting product_documentation_override: https://cloud.google.com/error-reporting billing_not_required: true @@ -1840,7 +1739,6 @@ libraries: - path: google/cloud/essentialcontacts/v1 java: api_description_override: helps you customize who receives notifications by providing your own list of contacts in many Google Cloud services. - released_version: 2.99.0 name_pretty_override: Essential Contacts API product_documentation_override: https://cloud.google.com/resource-manager/docs/managing-notification-contacts/ - name: eventarc @@ -1854,7 +1752,6 @@ libraries: java: api_description_override: lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes. Eventarc requires no infrastructure management, you can optimize productivity and costs while building a modern, event-driven solution. codeowner_team: '@googleapis/aap-dpes' - released_version: 1.99.0 name_pretty_override: Eventarc product_documentation_override: https://cloud.google.com/eventarc/docs - name: eventarc-publishing @@ -1864,7 +1761,6 @@ libraries: java: api_id_override: eventarc-publishing.googleapis.com api_description_override: lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes. - released_version: 0.99.0 name_pretty_override: Eventarc Publishing product_documentation_override: https://cloud.google.com/eventarc/docs - name: filestore @@ -1882,7 +1778,6 @@ libraries: generate_proto_classes: true java: api_description_override: instances are fully managed NFS file servers on Google Cloud for use with applications running on Compute Engine virtual machines (VMs) instances or Google Kubernetes Engine clusters. - released_version: 1.100.0 name_pretty_override: Cloud Filestore API product_documentation_override: https://cloud.google.com/filestore/docs - name: financialservices @@ -1896,7 +1791,6 @@ libraries: api_id_override: financialservices.googleapis.com api_description_override: Google Cloud's Anti Money Laundering AI (AML AI) product is an API that scores AML risk. Use it to identify more risk, more defensibly, with fewer false positives and reduced time per review. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-financialservices/latest/overview - released_version: 0.40.0 library_type_override: GAPIC_AUTO name_pretty_override: Financial Services API product_documentation_override: https://cloud.google.com/financial-services/anti-money-laundering/docs/concepts/overview @@ -1959,7 +1853,6 @@ libraries: excluded_poms: - google-cloud-firestore - google-cloud-firestore-bom - released_version: 3.49.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Firestore product_documentation_override: https://cloud.google.com/firestore @@ -1973,8 +1866,6 @@ libraries: java: additional_protos: - path: google/cloud/location/locations.proto - java: - released_version: 0.4.0 - name: functions version: 2.102.0-SNAPSHOT apis: @@ -2001,7 +1892,6 @@ libraries: java: api_description_override: is a scalable pay as you go Functions-as-a-Service (FaaS) to run your code with zero server management. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.101.0 name_pretty_override: Cloud Functions product_documentation_override: https://cloud.google.com/functions - name: gdchardwaremanagement @@ -2015,7 +1905,6 @@ libraries: api_id_override: gdchardwaremanagement.googleapis.com api_description_override: Google Distributed Cloud connected allows you to run Kubernetes clusters on dedicated hardware provided and maintained by Google that is separate from the Google Cloud data center. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-gdchardwaremanagement/latest/overview - released_version: 0.54.0 library_type_override: GAPIC_AUTO name_pretty_override: GDC Hardware Management API product_documentation_override: https://cloud.google.com/distributed-cloud/edge/latest/docs @@ -2034,7 +1923,6 @@ libraries: api_id_override: geminidataanalytics.googleapis.com api_description_override: Use Conversational Analytics API to build an artificial intelligence (AI)-powered chat interface, or data agent, that answers questions about structured data using natural language. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-geminidataanalytics/latest/overview - released_version: 0.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Data Analytics API with Gemini product_documentation_override: https://cloud.google.com/gemini/docs/conversational-analytics-api/overview @@ -2050,7 +1938,6 @@ libraries: api_id_override: gkebackup.googleapis.com api_description_override: is a service for backing up and restoring workloads in GKE. api_shortname_override: gke-backup - released_version: 0.98.0 name_pretty_override: Backup for GKE product_documentation_override: 'https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke ' - name: gke-connect-gateway @@ -2059,7 +1946,6 @@ libraries: - path: google/cloud/gkeconnect/gateway/v1beta1 java: api_description_override: builds on the power of fleets to let Anthos users connect to and run commands against registered Anthos clusters in a simple, consistent, and secured way, whether the clusters are on Google Cloud, other public clouds, or on premises, and makes it easier to automate DevOps processes across all your clusters. - released_version: 0.100.0 name_pretty_override: Connect Gateway API product_documentation_override: https://cloud.google.com/anthos/multicluster-management/gateway/ - name: gke-multi-cloud @@ -2070,7 +1956,6 @@ libraries: api_id_override: gkemulticloud.googleapis.com api_description_override: enables you to provision and manage GKE clusters running on AWS and Azure infrastructure through a centralized Google Cloud backed control plane. api_shortname_override: gke-multi-cloud - released_version: 0.98.0 name_pretty_override: Anthos Multicloud product_documentation_override: https://cloud.google.com/anthos/clusters/docs/multi-cloud - name: gkehub @@ -2102,7 +1987,6 @@ libraries: samples: false java: api_description_override: provides a unified way to work with Kubernetes clusters as part of Anthos, extending GKE to work in multiple environments. You have consistent, unified, and secure infrastructure, cluster, and container management, whether you're using Anthos on Google Cloud (with traditional GKE), hybrid cloud, or multiple public clouds. - released_version: 1.99.0 name_pretty_override: GKE Hub API product_documentation_override: https://cloud.google.com/anthos/gke/docs/ - name: gkerecommender @@ -2113,20 +1997,15 @@ libraries: api_id_override: gkerecommender.googleapis.com api_description_override: lets you analyze the performance and cost-efficiency of your inference workloads, and make data-driven decisions about resource allocation and model deployment strategies. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-gkerecommender/latest/overview - released_version: 0.19.0 library_type_override: GAPIC_AUTO name_pretty_override: GKE Recommender API product_documentation_override: https://cloud.google.com/kubernetes-engine/docs/how-to/machine-learning/inference-quickstart - name: google-cloud-java version: 1.94.0-SNAPSHOT skip_generate: true - java: - released_version: 1.93.0 - name: google-cloud-pom-parent version: 1.94.0-SNAPSHOT skip_generate: true - java: - released_version: 1.93.0 - name: grafeas version: 2.101.0-SNAPSHOT apis: @@ -2152,7 +2031,6 @@ libraries: client_documentation_override: https://cloud.google.com/java/docs/reference/grafeas/latest/overview codeowner_team: '@googleapis/aap-dpes' group_id: io.grafeas - released_version: 2.100.0 name_pretty_override: Grafeas product_documentation_override: https://grafeas.io skip_pom_updates: true @@ -2210,7 +2088,6 @@ libraries: samples: false java: api_description_override: are customized applications that integrate with Google Workspace productivity applications. - released_version: 2.99.0 name_pretty_override: Google Workspace Add-ons API product_documentation_override: https://developers.google.com/workspace/add-ons/overview - name: health @@ -2222,7 +2099,6 @@ libraries: api_id_override: health.googleapis.com api_description_override: The Google Health API lets you view and manage health and fitness metrics and measurement data. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-health/latest/overview - released_version: 0.8.0 library_type_override: GAPIC_AUTO name_pretty_override: Google Health API product_documentation_override: https://developers.google.com/health/api @@ -2241,7 +2117,6 @@ libraries: api_id_override: hypercomputecluster.googleapis.com api_description_override: simplifies cluster management across compute, network, and storage client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-hypercomputecluster/latest/overview - released_version: 0.19.0 library_type_override: GAPIC_AUTO name_pretty_override: Cluster Director API product_documentation_override: https://cloud.google.com/blog/products/compute/managed-slurm-and-other-cluster-director-enhancements @@ -2295,7 +2170,6 @@ libraries: - google-iam-policy - proto-google-iam-v1 group_id: com.google.api.grpc - released_version: 1.73.0 library_type_override: OTHER name_pretty_override: IAM product_documentation_override: https://cloud.google.com/iam @@ -2309,7 +2183,6 @@ libraries: api_description_override: you to manage your Service Accounts and IAM bindings. api_shortname_override: iam-admin artifact_id: google-iam-admin - released_version: 3.94.0 name_pretty_override: IAM Admin API product_documentation_override: https://cloud.google.com/iam/docs/apis - name: iam-policy @@ -2353,7 +2226,6 @@ libraries: - proto-google-iam-v1-bom - google-iam-policy - proto-google-iam-v1 - released_version: 1.96.0 name_pretty_override: Cloud IAM Policy product_documentation_override: n/a - name: iamcredentials @@ -2363,7 +2235,6 @@ libraries: java: api_description_override: creates short-lived, limited-privilege credentials for IAM service accounts. issue_tracker_override: https://issuetracker.google.com/issues/new?component=187161 - released_version: 2.99.0 name_pretty_override: IAM Service Account Credentials API product_documentation_override: https://cloud.google.com/iam/credentials/reference/rest/ billing_not_required: true @@ -2375,7 +2246,6 @@ libraries: api_id_override: iap.googleapis.com api_description_override: Controls access to cloud applications running on Google Cloud Platform. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-iap/latest/overview - released_version: 0.55.0 library_type_override: GAPIC_AUTO name_pretty_override: Cloud Identity-Aware Proxy API product_documentation_override: https://cloud.google.com/iap @@ -2385,7 +2255,6 @@ libraries: - path: google/cloud/ids/v1 java: api_description_override: ' monitors your networks, and it alerts you when it detects malicious activity. Cloud IDS is powered by Palo Alto Networks.' - released_version: 1.98.0 name_pretty_override: Intrusion Detection System product_documentation_override: https://cloud.google.com/intrusion-detection-system/docs - name: infra-manager @@ -2399,7 +2268,6 @@ libraries: java: api_id_override: config.googleapis.com api_description_override: Creates and manages Google Cloud Platform resources and infrastructure. - released_version: 0.76.0 name_pretty_override: Infrastructure Manager API product_documentation_override: https://cloud.google.com/infrastructure-manager/docs/overview - name: iot @@ -2409,7 +2277,6 @@ libraries: java: api_description_override: is a complete set of tools to connect, process, store, and analyze data both at the edge and in the cloud. The platform consists of scalable, fully-managed cloud services; an integrated software stack for edge/on-premises computing with machine learning capabilities for all your IoT needs. issue_tracker_override: https://issuetracker.google.com/issues?q=status:open%20componentid:310170 - released_version: 2.99.0 name_pretty_override: Cloud Internet of Things (IoT) Core product_documentation_override: https://cloud.google.com/iot - name: kms @@ -2634,7 +2501,6 @@ libraries: } java: api_description_override: a cloud-hosted key management service that lets you manage cryptographic keys for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256, RSA 2048, RSA 3072, RSA 4096, EC P256, and EC P384 cryptographic keys. Cloud KMS is integrated with Cloud IAM and Cloud Audit Logging so that you can manage permissions on individual keys and monitor how these are used. Use Cloud KMS to protect secrets and other sensitive data that you need to store in Google Cloud Platform. - released_version: 2.102.0 name_pretty_override: Cloud Key Management Service product_documentation_override: https://cloud.google.com/kms - name: kmsinventory @@ -2643,7 +2509,6 @@ libraries: - path: google/cloud/kms/inventory/v1 java: api_description_override: KMS Inventory API. - released_version: 0.88.0 name_pretty_override: KMS Inventory API product_documentation_override: https://cloud.google.com/kms/docs/ - name: language @@ -2654,7 +2519,6 @@ libraries: - path: google/cloud/language/v1beta2 java: api_description_override: provides natural language understanding technologies to developers, including sentiment analysis, entity analysis, entity sentiment analysis, content classification, and syntax analysis. This API is part of the larger Cloud Machine Learning API family. - released_version: 2.100.0 name_pretty_override: Natural Language product_documentation_override: https://cloud.google.com/natural-language/docs/ - name: licensemanager @@ -2668,7 +2532,6 @@ libraries: api_id_override: licensemanager.googleapis.com api_description_override: License Manager is a tool to manage and track third-party licenses on Google Cloud. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-licensemanager/latest/overview - released_version: 0.32.0 library_type_override: GAPIC_AUTO name_pretty_override: License Manager API product_documentation_override: https://cloud.google.com/compute/docs/instances/windows/ms-licensing @@ -2681,7 +2544,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: is a suite of services and tools for managing, processing, and transforming life sciences data. - released_version: 0.101.0 name_pretty_override: Cloud Life Sciences product_documentation_override: https://cloud.google.com/life-sciences/docs - name: locationfinder @@ -2692,7 +2554,6 @@ libraries: api_id_override: locationfinder.googleapis.com api_description_override: Cloud Location Finder is a public API that offers a repository of all Google Cloud and Google Distributed Cloud locations, as well as cloud locations for other cloud providers. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-locationfinder/latest/overview - released_version: 0.24.0 library_type_override: GAPIC_AUTO name_pretty_override: Cloud Location Finder API product_documentation_override: https://cloud.google.com/location-finder/docs/overview @@ -2854,7 +2715,6 @@ libraries: api_description_override: allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-logging/latest/history codeowner_team: '@googleapis/cloud-sdk-java-team' - released_version: 3.40.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Logging product_documentation_override: https://cloud.google.com/logging/docs @@ -2871,7 +2731,6 @@ libraries: api_id_override: lustre.googleapis.com api_description_override: Google Cloud Managed Lustre delivers a high-performance, fully managed parallel file system optimized for AI and HPC applications. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-lustre/latest/overview - released_version: 0.39.0 library_type_override: GAPIC_AUTO name_pretty_override: Google Cloud Managed Lustre API product_documentation_override: https://cloud.google.com/managed-lustre/docs @@ -2890,7 +2749,6 @@ libraries: api_id_override: maintenance.googleapis.com api_description_override: The Maintenance API provides a centralized view of planned disruptive maintenance events across supported Google Cloud products. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-maintenance/latest/overview - released_version: 0.33.0 library_type_override: GAPIC_AUTO name_pretty_override: Maintenance API product_documentation_override: https://cloud.google.com/unified-maintenance/docs/overview @@ -2901,7 +2759,6 @@ libraries: java: api_id_override: managedidentities.googleapis.com api_description_override: is a highly available, hardened Google Cloud service running actual Microsoft AD that enables you to manage authentication and authorization for your AD-dependent workloads, automate AD server maintenance and security configuration, and connect your on-premises AD domain to the cloud. - released_version: 1.97.0 name_pretty_override: Managed Service for Microsoft Active Directory product_documentation_override: https://cloud.google.com/managed-microsoft-ad/ - name: managedkafka @@ -2915,7 +2772,6 @@ libraries: api_id_override: managedkafka.googleapis.com api_description_override: Manage Apache Kafka clusters and resources. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-managedkafka/latest/overview - released_version: 0.55.0 library_type_override: GAPIC_AUTO name_pretty_override: Managed Service for Apache Kafka product_documentation_override: https://cloud.google.com/managed-kafka @@ -2928,7 +2784,6 @@ libraries: api_description_override: The Address Validation API allows developers to verify the accuracy of addresses. Given an address, it returns information about the correctness of the components of the parsed address, a geocode, and a verdict on the deliverability of the parsed address. api_shortname_override: maps-addressvalidation artifact_id: google-maps-addressvalidation - released_version: 0.93.0 name_pretty_override: Address Validation API product_documentation_override: https://developers.google.com/maps/documentation/address-validation/ - name: maps-area-insights @@ -2941,7 +2796,6 @@ libraries: api_shortname_override: maps-area-insights artifact_id: google-maps-area-insights client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-area-insights/latest/overview - released_version: 0.50.0 library_type_override: GAPIC_AUTO name_pretty_override: Places Insights API product_documentation_override: https://developers.google.com/maps/documentation/places-insights @@ -2955,7 +2809,6 @@ libraries: api_shortname_override: maps-fleetengine artifact_id: google-maps-fleetengine client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-fleetengine/latest/overview - released_version: 0.46.0 library_type_override: GAPIC_AUTO name_pretty_override: Local Rides and Deliveries API product_documentation_override: https://developers.google.com/maps/documentation/transportation-logistics/mobility @@ -2969,7 +2822,6 @@ libraries: api_shortname_override: maps-fleetengine-delivery artifact_id: google-maps-fleetengine-delivery client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-fleetengine-delivery/latest/overview - released_version: 0.46.0 library_type_override: GAPIC_AUTO name_pretty_override: Last Mile Fleet Solution Delivery API product_documentation_override: https://developers.google.com/maps/documentation/transportation-logistics/mobility @@ -2982,7 +2834,6 @@ libraries: api_description_override: The Geocoding API is a service that accepts a place as an address, latitude and longitude coordinates, or Place ID. artifact_id: google-maps-geocode client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-geocode/latest/overview - released_version: 0.11.0 library_type_override: GAPIC_AUTO name_pretty_override: Geocoding API product_documentation_override: https://developers.google.com/maps/documentation/geocoding/overview @@ -2993,7 +2844,6 @@ libraries: java: artifact_id: google-maps-isochrones group_id: com.google.maps - released_version: 0.5.0 - name: maps-mapmanagement version: 0.9.0-SNAPSHOT apis: @@ -3005,7 +2855,6 @@ libraries: artifact_id: google-maps-mapmanagement client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-mapmanagement/latest/overview group_id: com.google.maps - released_version: 0.8.0 library_type_override: GAPIC_AUTO name_pretty_override: Map Management API product_documentation_override: https://developers.google.com/maps/documentation/mapmanagement/overview @@ -3020,7 +2869,6 @@ libraries: that they can use to enrich their experience of Maps Platform solutions (e.g. styling, routing). api_shortname_override: maps-mapsplatformdatasets artifact_id: google-maps-mapsplatformdatasets - released_version: 0.88.0 name_pretty_override: Maps Platform Datasets API product_documentation_override: https://developers.google.com/maps/documentation - name: maps-navconnect @@ -3030,7 +2878,6 @@ libraries: java: artifact_id: google-maps-navconnect group_id: com.google.maps - released_version: 0.5.0 - name: maps-places version: 0.71.0-SNAPSHOT apis: @@ -3042,7 +2889,6 @@ libraries: api_description_override: The Places API allows developers to access a variety of search and retrieval endpoints for a Place. api_shortname_override: maps-places artifact_id: google-maps-places - released_version: 0.70.0 name_pretty_override: Places API (New) product_documentation_override: https://developers.google.com/maps/documentation/places/web-service/ - name: maps-routeoptimization @@ -3054,7 +2900,6 @@ libraries: api_description_override: The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals. artifact_id: google-maps-routeoptimization client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-routeoptimization/latest/overview - released_version: 0.57.0 library_type_override: GAPIC_AUTO name_pretty_override: Route Optimization API product_documentation_override: https://developers.google.com/maps/documentation/route-optimization @@ -3067,7 +2912,6 @@ libraries: api_description_override: Routes API is the next generation, performance optimized version of the existing Directions API and Distance Matrix API. It helps you find the ideal route from A to Z, calculates ETAs and distances for matrices of origin and destination locations, and also offers new features. api_shortname_override: maps-routing artifact_id: google-maps-routing - released_version: 1.84.0 name_pretty_override: Routes API product_documentation_override: https://developers.google.com/maps/documentation/routes - name: maps-solar @@ -3080,7 +2924,6 @@ libraries: api_shortname_override: maps-solar artifact_id: google-maps-solar client_documentation_override: https://cloud.google.com/java/docs/reference/google-maps-solar/latest/overview - released_version: 0.58.0 library_type_override: GAPIC_AUTO name_pretty_override: Solar API product_documentation_override: https://developers.google.com/maps/documentation/solar/overview @@ -3096,7 +2939,6 @@ libraries: artifact_id: admin client_documentation_override: https://cloud.google.com/java/docs/reference/admin/latest/overview group_id: com.google.ads-marketingplatform - released_version: 0.48.0 library_type_override: GAPIC_AUTO name_pretty_override: Google Marketing Platform Admin API product_documentation_override: https://developers.google.com/analytics/devguides/config/gmp/v1 @@ -3106,7 +2948,6 @@ libraries: - path: google/cloud/mediatranslation/v1beta1 java: api_description_override: provides enterprise quality translation from/to various media types. - released_version: 0.105.0 name_pretty_override: Media Translation API product_documentation_override: https://cloud.google.com/ billing_not_required: true @@ -3117,7 +2958,6 @@ libraries: - path: google/apps/meet/v2beta java: api_description_override: The Google Meet REST API lets you create and manage meetings for Google Meet and offers entry points to your users directly from your app - released_version: 0.66.0 name_pretty_override: Google Meet API product_documentation_override: https://developers.google.com/meet/api/guides/overview - name: memcache @@ -3133,7 +2973,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: is a fully-managed in-memory data store service for Memcache. - released_version: 2.99.0 name_pretty_override: Cloud Memcache product_documentation_override: https://cloud.google.com/memorystore/ billing_not_required: true @@ -3146,7 +2985,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Google Cloud Migration Center is a unified platform that helps you accelerate your end-to-end cloud journey from your current on-premises or cloud environments to Google Cloud - released_version: 0.81.0 name_pretty_override: Migration Center API product_documentation_override: https://cloud.google.com/migration-center/docs/migration-center-overview - name: modelarmor @@ -3164,7 +3002,6 @@ libraries: api_id_override: modelarmor.googleapis.com api_description_override: Model Armor helps you protect against risks like prompt injection, harmful content, and data leakage in generative AI applications by letting you define policies that filter user prompts and model responses. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-modelarmor/latest/overview - released_version: 0.40.0 library_type_override: GAPIC_AUTO name_pretty_override: Model Armor API product_documentation_override: https://cloud.google.com/security-command-center/docs/model-armor-overview @@ -3214,7 +3051,6 @@ libraries: replacement: ResourceName java: api_description_override: collects metrics, events, and metadata from Google Cloud, Amazon Web Services (AWS), hosted uptime probes, and application instrumentation. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premise systems, and hybrid cloud systems. Stackdriver ingests that data and generates insights via dashboards, charts, and alerts. BindPlane is included with your Google Cloud project at no additional cost. - released_version: 3.100.0 name_pretty_override: Stackdriver Monitoring product_documentation_override: https://cloud.google.com/monitoring/docs - name: monitoring-dashboards @@ -3230,7 +3066,6 @@ libraries: api_description_override: are one way for you to view and analyze metric data. The Cloud Console provides predefined dashboards that require no setup or configuration. You can also define custom dashboards. With custom dashboards, you have complete control over the charts that are displayed and their configuration. api_shortname_override: monitoring-dashboards artifact_id: google-cloud-monitoring-dashboard - released_version: 2.101.0 name_pretty_override: Monitoring Dashboards product_documentation_override: https://cloud.google.com/monitoring/charts/dashboards - name: monitoring-metricsscope @@ -3241,7 +3076,6 @@ libraries: api_id_override: monitoring.googleapis.com api_description_override: The metrics scope defines the set of Google Cloud projects whose metrics the current Google Cloud project can access. api_shortname_override: monitoring-metricsscope - released_version: 0.93.0 name_pretty_override: Monitoring Metrics Scopes product_documentation_override: https://cloud.google.com/monitoring/api/ref_v3/rest/v1/locations.global.metricsScopes - name: netapp @@ -3253,7 +3087,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Google Cloud NetApp Volumes is a fully-managed, cloud-based data storage service that provides advanced data management capabilities and highly scalable performance with global availability. - released_version: 0.78.0 name_pretty_override: NetApp API product_documentation_override: https://cloud.google.com/netapp/volumes/docs/discover/overview - name: network-management @@ -3509,7 +3342,6 @@ libraries: public void testIamPermissionsTest() throws Exception { java: api_description_override: provides a collection of network performance monitoring and diagnostic capabilities. - released_version: 1.100.0 name_pretty_override: Network Management API product_documentation_override: https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/reference/networkmanagement/rest/ - name: network-security @@ -3527,7 +3359,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: n/a - released_version: 0.102.0 name_pretty_override: Network Security API product_documentation_override: https://cloud.google.com/traffic-director/docs/reference/network-security/rest - name: networkconnectivity @@ -3546,7 +3377,6 @@ libraries: - path: google/cloud/networkconnectivity/v1alpha1 java: api_description_override: Google's suite of products that provide enterprise connectivity from your on-premises network or from another cloud provider to your Virtual Private Cloud (VPC) network - released_version: 1.98.0 name_pretty_override: Network Connectivity Center product_documentation_override: https://cloud.google.com/network-connectivity/docs - name: networkservices @@ -3566,7 +3396,6 @@ libraries: api_id_override: networkservices.googleapis.com api_description_override: Google Cloud offers a broad portfolio of networking services built on top of planet-scale infrastructure that leverages automation, advanced AI, and programmability, enabling enterprises to connect, scale, secure, modernize and optimize their infrastructure. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-networkservices/latest/overview - released_version: 0.55.0 library_type_override: GAPIC_AUTO name_pretty_override: Network Services API product_documentation_override: https://cloud.google.com/products/networking @@ -3590,7 +3419,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: is a managed service that offers an integrated and secure JupyterLab environment for data scientists and machine learning developers to experiment, develop, and deploy models into production. Users can create instances running JupyterLab that come pre-installed with the latest data science and machine learning frameworks in a single click. - released_version: 1.97.0 name_pretty_override: AI Platform Notebooks product_documentation_override: https://cloud.google.com/ai-platform-notebooks - name: optimization @@ -3599,7 +3427,6 @@ libraries: - path: google/cloud/optimization/v1 java: api_description_override: is a managed routing service that takes your list of orders, vehicles, constraints, and objectives and returns the most efficient plan for your entire fleet in near real-time. - released_version: 1.97.0 name_pretty_override: Cloud Fleet Routing product_documentation_override: https://cloud.google.com/optimization/docs - name: oracledatabase @@ -3613,7 +3440,6 @@ libraries: api_id_override: oracledatabase.googleapis.com api_description_override: The Oracle Database@Google Cloud API provides a set of APIs to manage Oracle database services, such as Exadata and Autonomous Databases. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-oracledatabase/latest/overview - released_version: 0.48.0 library_type_override: GAPIC_AUTO name_pretty_override: Oracle Database@Google Cloud API product_documentation_override: https://cloud.google.com/oracle/database/docs @@ -3626,7 +3452,6 @@ libraries: api_id_override: composer.googleapis.com api_description_override: is a managed Apache Airflow service that helps you create, schedule, monitor and manage workflows. Cloud Composer automation helps you create Airflow environments quickly and use Airflow-native tools, such as the powerful Airflow web interface and command line tools, so you can focus on your workflows and not your infrastructure. api_shortname_override: orchestration-airflow - released_version: 1.99.0 name_pretty_override: Cloud Composer product_documentation_override: https://cloud.google.com/composer/docs - name: orgpolicy @@ -3642,7 +3467,6 @@ libraries: java: api_description_override: n/a client_documentation_override: https://cloud.google.com/java/docs/reference/proto-google-cloud-orgpolicy-v1/latest/overview - released_version: 2.99.0 name_pretty_override: Cloud Organization Policy product_documentation_override: n/a - name: os-config @@ -3654,7 +3478,6 @@ libraries: java: api_id_override: osconfig.googleapis.com api_description_override: provides OS management tools that can be used for patch management, patch compliance, and configuration management on VM instances. - released_version: 2.101.0 name_pretty_override: OS Config API product_documentation_override: https://cloud.google.com/compute/docs/os-patch-management billing_not_required: true @@ -3730,7 +3553,6 @@ libraries: dst: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java java: api_description_override: manages OS login configuration for Directory API users. - released_version: 2.98.0 name_pretty_override: Cloud OS Login product_documentation_override: https://cloud.google.com/compute/docs/oslogin/ - name: parallelstore @@ -3748,7 +3570,6 @@ libraries: api_id_override: parallelstore.googleapis.com api_description_override: 'Parallelstore is based on Intel DAOS and delivers up to 6.3x greater read throughput performance compared to competitive Lustre scratch offerings. ' client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-parallelstore/latest/overview - released_version: 0.62.0 library_type_override: GAPIC_AUTO name_pretty_override: Parallelstore API product_documentation_override: https://cloud/parallelstore?hl=en @@ -3763,7 +3584,6 @@ libraries: api_id_override: parametermanager.googleapis.com api_description_override: (Public Preview) Parameter Manager is a single source of truth to store, access and manage the lifecycle of your workload parameters. Parameter Manager aims to make management of sensitive application parameters effortless for customers without diminishing focus on security. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-parametermanager/latest/overview - released_version: 0.43.0 library_type_override: GAPIC_AUTO name_pretty_override: Parameter Manager API product_documentation_override: https://cloud.google.com/secret-manager/parameter-manager/docs/overview @@ -3773,7 +3593,6 @@ libraries: - path: google/cloud/phishingprotection/v1beta1 java: api_description_override: helps prevent users from accessing phishing sites by identifying various signals associated with malicious content, including the use of your brand assets, classifying malicious content that uses your brand and reporting the unsafe URLs to Google Safe Browsing. Once a site is propagated to Safe Browsing, users will see warnings across more than 4 billion devices. - released_version: 0.130.0 name_pretty_override: Phishing Protection product_documentation_override: https://cloud.google.com/phishing-protection/docs/ billing_not_required: true @@ -3785,7 +3604,6 @@ libraries: java: api_id_override: policytroubleshooter.googleapis.com api_description_override: makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter examines all Identity and Access Management (IAM) policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. - released_version: 1.98.0 name_pretty_override: IAM Policy Troubleshooter API product_documentation_override: https://cloud.google.com/iam/docs/troubleshooting-access - name: policysimulator @@ -3794,7 +3612,6 @@ libraries: - path: google/cloud/policysimulator/v1 java: api_description_override: Policy Simulator is a collection of endpoints for creating, running, and viewing a Replay. - released_version: 0.78.0 name_pretty_override: Policy Simulator API product_documentation_override: https://cloud.google.com/policysimulator/docs/overview - name: private-catalog @@ -3804,7 +3621,6 @@ libraries: java: api_id_override: privatecatalog.googleapis.com api_description_override: allows developers and cloud admins to make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. - released_version: 0.101.0 name_pretty_override: Private Catalog product_documentation_override: https://cloud.google.com/private-catalog/docs - name: privilegedaccessmanager @@ -3818,7 +3634,6 @@ libraries: api_id_override: privilegedaccessmanager.googleapis.com api_description_override: Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse orabuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-privilegedaccessmanager/latest/overview - released_version: 0.53.0 library_type_override: GAPIC_AUTO name_pretty_override: Privileged Access Manager API product_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-privilegedaccessmanager/latest/overview @@ -3826,8 +3641,6 @@ libraries: version: 0.6.0-SNAPSHOT apis: - path: google/cloud/productregistry/v1 - java: - released_version: 0.5.0 - name: profiler version: 2.100.0-SNAPSHOT apis: @@ -3835,7 +3648,6 @@ libraries: java: api_id_override: cloudprofiler.googleapis.com api_description_override: is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. - released_version: 2.99.0 name_pretty_override: Cloud Profiler product_documentation_override: https://cloud.google.com/profiler/docs - name: publicca @@ -3845,7 +3657,6 @@ libraries: - path: google/cloud/security/publicca/v1beta1 java: api_description_override: The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority. - released_version: 0.96.0 name_pretty_override: Public Certificate Authority API product_documentation_override: https://cloud.google.com/certificate-manager/docs/public-ca - name: pubsub @@ -5008,7 +4819,6 @@ libraries: client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-pubsub/latest/history codeowner_team: '@googleapis/pubsub-team' issue_tracker_override: https://issuetracker.google.com/savedsearches/559741 - released_version: 1.157.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Pub/Sub product_documentation_override: https://cloud.google.com/pubsub/docs/ @@ -5022,7 +4832,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Rapid Migration Assessment API - released_version: 0.82.0 name_pretty_override: Rapid Migration Assessment API product_documentation_override: https://cloud.google.com/migration-center/docs - name: recaptchaenterprise @@ -5032,7 +4841,6 @@ libraries: - path: google/cloud/recaptchaenterprise/v1beta1 java: api_description_override: is a service that protects your site from spam and abuse. - released_version: 3.96.0 name_pretty_override: reCAPTCHA Enterprise product_documentation_override: https://cloud.google.com/recaptcha-enterprise/docs/ billing_not_required: true @@ -5042,7 +4850,6 @@ libraries: - path: google/cloud/recommendationengine/v1beta1 java: api_description_override: delivers highly personalized product recommendations at scale. - released_version: 0.106.0 name_pretty_override: Recommendations AI product_documentation_override: https://cloud.google.com/recommendations-ai/ - name: recommender @@ -5052,7 +4859,6 @@ libraries: - path: google/cloud/recommender/v1beta1 java: api_description_override: delivers highly personalized product recommendations at scale. - released_version: 2.101.0 name_pretty_override: Recommender product_documentation_override: https://cloud.google.com/recommendations/ - name: redis @@ -5066,7 +4872,6 @@ libraries: java: api_description_override: is a fully managed Redis service for the Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. issue_tracker_override: https://issuetracker.google.com/savedsearches/5169231 - released_version: 2.102.0 name_pretty_override: Cloud Redis product_documentation_override: https://cloud.google.com/memorystore/docs/redis/ - name: redis-cluster @@ -5083,7 +4888,6 @@ libraries: java: api_description_override: Creates and manages Redis instances on the Google Cloud Platform. api_shortname_override: redis-cluster - released_version: 0.71.0 name_pretty_override: Google Cloud Memorystore for Redis API product_documentation_override: https://cloud.google.com/memorystore/docs/cluster - name: resourcemanager @@ -5094,7 +4898,6 @@ libraries: omit_common_resources: true java: api_description_override: enables you to programmatically manage resources by project, folder, and organization. - released_version: 1.101.0 name_pretty_override: Resource Manager API product_documentation_override: https://cloud.google.com/resource-manager billing_not_required: true @@ -5115,7 +4918,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Retail solutions API. - released_version: 2.101.0 name_pretty_override: Cloud Retail product_documentation_override: https://cloud.google.com/solutions/retail - name: run @@ -5127,7 +4929,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: is a managed compute platform that enables you to run containers that are invocable via requests or events. - released_version: 0.99.0 name_pretty_override: Cloud Run product_documentation_override: https://cloud.google.com/run/docs - name: saasservicemgmt @@ -5141,7 +4942,6 @@ libraries: api_id_override: saasservicemgmt.googleapis.com api_description_override: "Model, deploy, and operate your SaaS at scale.\t" client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-saasservicemgmt/latest/overview - released_version: 0.29.0 library_type_override: GAPIC_AUTO name_pretty_override: App Lifecycle Manager product_documentation_override: https://cloud.google.com/saas-runtime/docs/overview @@ -5161,7 +4961,6 @@ libraries: - proto-google-cloud-scheduler-v1beta1/src/main/java/com/google/cloud/scheduler/v1beta1/ProjectName.java java: api_description_override: lets you set up scheduled units of work to be executed at defined times or regular intervals. These work units are commonly known as cron jobs. Typical use cases might include sending out a report email on a daily basis, updating some cached data every 10 minutes, or updating some summary information once an hour. - released_version: 2.99.0 name_pretty_override: Google Cloud Scheduler product_documentation_override: https://cloud.google.com/scheduler/docs billing_not_required: true @@ -5179,7 +4978,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: allows you to encrypt, store, manage, and audit infrastructure and application-level secrets. - released_version: 2.99.0 name_pretty_override: Secret Management product_documentation_override: https://cloud.google.com/solutions/secrets-management/ billing_not_required: true @@ -5195,7 +4993,6 @@ libraries: api_description_override: |- Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. - released_version: 0.69.0 name_pretty_override: Secure Source Manager API product_documentation_override: https://cloud.google.com/secure-source-manager/docs/overview - name: security-private-ca @@ -5210,7 +5007,6 @@ libraries: java: api_id_override: privateca.googleapis.com api_description_override: simplifies the deployment and management of private CAs without managing infrastructure. - released_version: 2.101.0 name_pretty_override: Certificate Authority Service product_documentation_override: https://cloud.google.com/certificate-authority-service/docs - name: securitycenter @@ -5229,7 +5025,6 @@ libraries: java: api_description_override: makes it easier for you to prevent, detect, and respond to threats. Identify security misconfigurations in virtual machines, networks, applications, and storage buckets from a centralized dashboard. Take action on them before they can potentially result in business damage or loss. Built-in capabilities can quickly surface suspicious activity in your Stackdriver security logs or indicate compromised virtual machines. Respond to threats by following actionable recommendations or exporting logs to your SIEM for further investigation. issue_tracker_override: https://issuetracker.google.com/savedsearches/559748 - released_version: 2.107.0 name_pretty_override: Security Command Center product_documentation_override: https://cloud.google.com/security-command-center billing_not_required: true @@ -5240,7 +5035,6 @@ libraries: java: api_id_override: securitycenter-settings.googleapis.com api_description_override: is the canonical security and data risk database for Google Cloud. Security Command Center enables you to understand your security and data attack surface by providing asset inventory, discovery, search, and management. - released_version: 0.102.0 name_pretty_override: Security Command Center Settings API product_documentation_override: https://cloud.google.com/security-command-center/ billing_not_required: true @@ -5253,7 +5047,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Security Center Management API - released_version: 0.67.0 name_pretty_override: Security Center Management API product_documentation_override: https://cloud.google.com/securitycentermanagement/docs/overview - name: securityposture @@ -5265,7 +5058,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Security Posture is a comprehensive framework of policy sets that empowers organizations to define, assess early, deploy, and monitor their security measures in a unified way and helps simplify governance and reduces administrative toil. - released_version: 0.64.0 name_pretty_override: Security Posture API product_documentation_override: https://cloud.google.com/security-command-center/docs/security-posture-overview - name: service-control @@ -5275,7 +5067,6 @@ libraries: - path: google/api/servicecontrol/v1 java: api_description_override: ' is a foundational platform for creating, managing, securing, and consuming APIs and services across organizations. It is used by Google APIs, Cloud APIs, Cloud Endpoints, and API Gateway.' - released_version: 1.99.0 name_pretty_override: Service Control API product_documentation_override: https://cloud.google.com/service-infrastructure/docs/overview/ - name: service-management @@ -5290,7 +5081,6 @@ libraries: java: api_id_override: servicemanagement.googleapis.com api_description_override: is a foundational platform for creating, managing, securing, and consuming APIs and services across organizations. It is used by Google APIs, Cloud APIs, Cloud Endpoints, and API Gateway. Service Infrastructure provides a wide range of features to service consumers and service producers, including authentication, authorization, auditing, rate limiting, analytics, billing, logging, and monitoring. - released_version: 3.97.0 name_pretty_override: Service Management API product_documentation_override: https://cloud.google.com/service-infrastructure/docs/overview/ - name: service-usage @@ -5300,7 +5090,6 @@ libraries: - path: google/api/serviceusage/v1beta1 java: api_description_override: is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. - released_version: 2.99.0 name_pretty_override: Service Usage product_documentation_override: https://cloud.google.com/service-usage/docs/overview - name: servicedirectory @@ -5316,7 +5105,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: allows the registration and lookup of service endpoints. - released_version: 2.100.0 name_pretty_override: Service Directory product_documentation_override: https://cloud.google.com/service-directory/ billing_not_required: true @@ -5329,7 +5117,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. - released_version: 0.66.0 name_pretty_override: Service Health API product_documentation_override: https://cloud.google.com/service-health/docs/overview - name: shell @@ -5339,7 +5126,6 @@ libraries: java: api_description_override: is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.98.0 name_pretty_override: Cloud Shell product_documentation_override: https://cloud.google.com/shell/docs - name: shopping-css @@ -5349,7 +5135,6 @@ libraries: java: api_description_override: The CSS API is used to manage your CSS and control your CSS Products portfolio artifact_id: google-shopping-css - released_version: 0.67.0 name_pretty_override: CSS API product_documentation_override: https://developers.google.com/comparison-shopping-services/api - name: shopping-merchant-accounts @@ -5362,7 +5147,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-accounts client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-accounts/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5377,7 +5161,6 @@ libraries: api_shortname_override: shopping-merchant-conversions artifact_id: google-shopping-merchant-conversions client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-conversions/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant Conversions API product_documentation_override: https://developers.google.com/merchant/api @@ -5391,7 +5174,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-datasources client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5403,7 +5185,6 @@ libraries: java: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-inventories - released_version: 1.27.0 name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api - name: shopping-merchant-issue-resolution @@ -5416,7 +5197,6 @@ libraries: api_description_override: Programatically manage your Merchant Issues artifact_id: google-shopping-merchant-issue-resolution client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-issue-resolution/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant Issue Resolution API product_documentation_override: https://developers.google.com/merchant/api @@ -5431,7 +5211,6 @@ libraries: api_shortname_override: shopping-merchant-lfp artifact_id: google-shopping-merchant-lfp client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-lfp/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant LFP API product_documentation_override: https://developers.google.com/merchant/api @@ -5442,7 +5221,6 @@ libraries: java: artifact_id: google-shopping-merchant-loyaltycustomers group_id: com.google.shopping - released_version: 0.3.0 - name: shopping-merchant-notifications version: 1.28.0-SNAPSHOT apis: @@ -5454,7 +5232,6 @@ libraries: api_shortname_override: shopping-merchant-notifications artifact_id: google-shopping-merchant-notifications client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-notifications/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant Notifications API product_documentation_override: https://developers.google.com/merchant/api @@ -5468,7 +5245,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center Accounts artifact_id: google-shopping-merchant-order-tracking client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-order-tracking/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant Order Tracking API product_documentation_override: https://developers.google.com/merchant/api @@ -5481,7 +5257,6 @@ libraries: api_description_override: Programmatically manage your products. artifact_id: google-shopping-merchant-productstudio client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-productstudio/latest/overview - released_version: 0.39.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5495,7 +5270,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-products client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-products/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5509,7 +5283,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-promotions client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-promotions/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5524,7 +5297,6 @@ libraries: api_shortname_override: shopping-merchant-quota artifact_id: google-shopping-merchant-quota client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-quota/latest/overview - released_version: 1.27.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant Quota API product_documentation_override: https://developers.google.com/merchant/api @@ -5537,7 +5309,6 @@ libraries: java: api_description_override: Programmatically manage your Merchant Center accounts. artifact_id: google-shopping-merchant-reports - released_version: 1.27.0 name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api - name: shopping-merchant-reviews @@ -5548,7 +5319,6 @@ libraries: api_description_override: Programmatically manage your Merchant Center Accounts. artifact_id: google-shopping-merchant-reviews client_documentation_override: https://cloud.google.com/java/docs/reference/google-shopping-merchant-reviews/latest/overview - released_version: 0.45.0 library_type_override: GAPIC_AUTO name_pretty_override: Merchant API product_documentation_override: https://developers.google.com/merchant/api @@ -5614,7 +5384,6 @@ libraries: - google-cloud-spanner-bom - google-cloud-spanner issue_tracker_override: https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open - released_version: 6.124.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Spanner product_documentation_override: https://cloud.google.com/spanner/docs/ @@ -5629,7 +5398,6 @@ libraries: api_description_override: The Cloud Spanner Adapter service allows native drivers of supported database dialects to interact directly with Cloud Spanner by wrapping the underlying wire protocol used by the driver in a gRPC stream. api_shortname_override: spanneradapter client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-spanneradapter/latest/overview - released_version: 0.35.0 library_type_override: GAPIC_AUTO name_pretty_override: Cloud Spanner Adapter API product_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-spanneradapter/latest/overview @@ -5649,7 +5417,6 @@ libraries: - google-cloud-speech/src/test/resources/hello.flac java: api_description_override: enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service. - released_version: 4.94.0 name_pretty_override: Cloud Speech product_documentation_override: https://cloud.google.com/speech-to-text/docs/ billing_not_required: true @@ -5665,8 +5432,6 @@ libraries: additional_protos: - path: google/cloud/location/locations.proto skip_generate: true - java: - released_version: 0.5.0 - name: storage version: 2.76.0-SNAPSHOT apis: @@ -5700,7 +5465,6 @@ libraries: - google-cloud-storage-bom - google-cloud-storage issue_tracker_override: https://issuetracker.google.com/savedsearches/559782 - released_version: 2.75.0 library_type_override: GAPIC_COMBO name_pretty_override: Cloud Storage product_documentation_override: https://cloud.google.com/storage @@ -5712,7 +5476,6 @@ libraries: - path: google/storagetransfer/v1 java: api_description_override: Secure, low-cost services for transferring data from cloud or on-premises sources. - released_version: 1.99.0 name_pretty_override: Storage Transfer Service product_documentation_override: https://cloud.google.com/storage-transfer-service - name: storagebatchoperations @@ -5726,7 +5489,6 @@ libraries: api_id_override: storagebatchoperations.googleapis.com api_description_override: Storage batch operations is a Cloud Storage management feature that performs operations on billions of Cloud Storage objects in a serverless manner. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/overview - released_version: 0.39.0 library_type_override: GAPIC_AUTO name_pretty_override: Storage Batch Operations API product_documentation_override: https://cloud.google.com/storage/docs/batch-operations/overview @@ -5739,7 +5501,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: Provides insights capability on Google Cloud Storage - released_version: 0.84.0 name_pretty_override: Storage Insights API product_documentation_override: https://cloud.google.com/storage/docs/insights/storage-insights/ - name: talent @@ -5749,7 +5510,6 @@ libraries: - path: google/cloud/talent/v4beta1 java: api_description_override: allows you to transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience. Learn more about Cloud Talent Solution from the product overview page. - released_version: 2.100.0 name_pretty_override: Talent Solution product_documentation_override: https://cloud.google.com/solutions/talent-solution/ - name: tasks @@ -5861,7 +5621,6 @@ libraries: java: api_description_override: a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.99.0 name_pretty_override: Cloud Tasks product_documentation_override: https://cloud.google.com/tasks/docs/ - name: telcoautomation @@ -5877,7 +5636,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: APIs to automate 5G deployment and management of cloud infrastructure and network functions. - released_version: 0.69.0 name_pretty_override: Telco Automation API product_documentation_override: https://cloud.google.com/telecom-network-automation - name: texttospeech @@ -5890,7 +5648,6 @@ libraries: - google-cloud-texttospeech/src/test/java/com/google/cloud/texttospeech/v1beta1/TextToSpeechSmokeTest.java java: api_description_override: enables easy integration of Google text recognition technologies into developer applications. Send text and receive synthesized audio output from the Cloud Text-to-Speech API service. - released_version: 2.100.0 name_pretty_override: Cloud Text-to-Speech product_documentation_override: https://cloud.google.com/text-to-speech billing_not_required: true @@ -5911,7 +5668,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. - released_version: 2.100.0 name_pretty_override: Cloud TPU product_documentation_override: https://cloud.google.com/tpu/docs - name: trace @@ -5924,7 +5680,6 @@ libraries: - google-cloud-trace/src/test/java/com/google/cloud/trace/v2/VPCServiceControlTest.java java: api_description_override: is a distributed tracing system that collects latency data from your applications and displays it in the Google Cloud Platform Console. You can track how requests propagate through your application and receive detailed near real-time performance insights. - released_version: 2.99.0 name_pretty_override: Stackdriver Trace product_documentation_override: https://cloud.google.com/trace/docs/ billing_not_required: true @@ -5936,7 +5691,6 @@ libraries: java: api_id_override: translate.googleapis.com api_description_override: can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. - released_version: 2.99.0 name_pretty_override: Cloud Translation product_documentation_override: https://cloud.google.com/translate/docs/ - name: valkey @@ -5954,7 +5708,6 @@ libraries: api_id_override: memorystore.googleapis.com api_description_override: Memorystore for Valkey is a fully managed Valkey Cluster service for Google Cloud. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-memorystore/latest/overview - released_version: 0.45.0 library_type_override: GAPIC_AUTO name_pretty_override: Memorystore API product_documentation_override: https://cloud.google.com/memorystore/docs/valkey @@ -5973,7 +5726,6 @@ libraries: api_id_override: vectorsearch.googleapis.com api_description_override: The Vector Search API provides a fully-managed, highly performant, and scalable vector database designed to power next-generation search, recommendation, and generative AI applications. It allows you to store, index, and query your data and its corresponding vector embeddings through a simple, intuitive interface. With Vector Search, you can define custom schemas for your data, insert objects with associated metadata, automatically generate embeddings from your data, and perform fast approximate nearest neighbor (ANN) searches to find semantically similar items at scale. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-vectorsearch/latest/overview - released_version: 0.21.0 library_type_override: GAPIC_AUTO name_pretty_override: Vector Search API product_documentation_override: https://docs.cloud.google.com/vertex-ai/docs/vector-search/overview @@ -5987,7 +5739,6 @@ libraries: - path: google/cloud/videointelligence/v1beta2 java: api_description_override: allows developers to use Google video analysis technology as part of their applications. - released_version: 2.98.0 name_pretty_override: Cloud Video Intelligence product_documentation_override: https://cloud.google.com/video-intelligence/docs/ - name: video-live-stream @@ -6000,7 +5751,6 @@ libraries: java: api_description_override: transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. artifact_id: google-cloud-live-stream - released_version: 0.101.0 name_pretty_override: Live Stream API product_documentation_override: https://cloud.google.com/livestream/ - name: video-stitcher @@ -6009,7 +5759,6 @@ libraries: - path: google/cloud/video/stitcher/v1 java: api_description_override: allows you to manipulate video content to dynamically insert ads prior to delivery to client devices. - released_version: 0.99.0 name_pretty_override: Video Stitcher API product_documentation_override: https://cloud.google.com/video-stitcher/ - name: video-transcoder @@ -6019,7 +5768,6 @@ libraries: java: api_id_override: transcoder.googleapis.com api_description_override: allows you to transcode videos into a variety of formats. The Transcoder API benefits broadcasters, production companies, businesses, and individuals looking to transform their video content for use across a variety of user devices. - released_version: 1.98.0 name_pretty_override: Video Transcoder product_documentation_override: https://cloud.google.com/transcoder/docs - name: vision @@ -6042,7 +5790,6 @@ libraries: - proto-google-cloud-vision-v1/src/main/java/com/google/cloud/vision/v1/ImageName.java java: api_description_override: allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. - released_version: 3.97.0 name_pretty_override: Cloud Vision product_documentation_override: https://cloud.google.com/vision/docs/ - name: visionai @@ -6057,7 +5804,6 @@ libraries: api_id_override: visionai.googleapis.com api_description_override: Vertex AI Vision is an AI-powered platform to ingest, analyze and store video data. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-visionai/latest/overview - released_version: 0.56.0 library_type_override: GAPIC_AUTO name_pretty_override: Vision AI API product_documentation_override: https://cloud.google.com/vision-ai/docs @@ -6071,7 +5817,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: helps customers migrating VMs to GCP at no additional cost, as well as an extensive ecosystem of partners to help with discovery and assessment, planning, migration, special use cases, and more. - released_version: 1.99.0 name_pretty_override: VM Migration product_documentation_override: n/a - name: vmwareengine @@ -6084,7 +5829,6 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: Easily lift and shift your VMware-based applications to Google Cloud without changes to your apps, tools, or processes. - released_version: 0.93.0 name_pretty_override: Google Cloud VMware Engine product_documentation_override: https://cloud.google.com/vmware-engine/ - name: vpcaccess @@ -6096,7 +5840,6 @@ libraries: - path: google/cloud/location/locations.proto java: api_description_override: enables you to connect from a serverless environment on Google Cloud directly to your VPC network. This connection makes it possible for your serverless environment to access resources in your VPC network via internal IP addresses. - released_version: 2.100.0 name_pretty_override: Serverless VPC Access product_documentation_override: https://cloud.google.com/vpc/docs/serverless-vpc-access - name: webrisk @@ -6106,7 +5849,6 @@ libraries: - path: google/cloud/webrisk/v1beta1 java: api_description_override: is a Google Cloud service that lets client applications check URLs against Google's constantly updated lists of unsafe web resources. Unsafe web resources include social engineering sites - such as phishing and deceptive sites - and sites that host malware or unwanted software. With the Web Risk API, you can quickly identify known bad sites, warn users before they click infected links, and prevent users from posting links to known infected pages from your site. The Web Risk API includes data on more than a million unsafe URLs and stays up to date by examining billions of URLs each day. - released_version: 2.98.0 name_pretty_override: Web Risk product_documentation_override: https://cloud.google.com/web-risk/docs/ billing_not_required: true @@ -6121,7 +5863,6 @@ libraries: - google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/it/v1beta/VPCServiceControlPositiveTest.java java: api_description_override: identifies security vulnerabilities in your App Engine, Compute Engine, and Google Kubernetes Engine web applications. It crawls your application, following all links within the scope of your starting URLs, and attempts to exercise as many user inputs and event handlers as possible. - released_version: 2.99.0 name_pretty_override: Cloud Security Scanner product_documentation_override: https://cloud.google.com/security-scanner/docs/ billing_not_required: true @@ -6133,7 +5874,6 @@ libraries: java: api_description_override: allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.99.0 name_pretty_override: Cloud Workflow Executions product_documentation_override: https://cloud.google.com/workflows - name: workflows @@ -6150,7 +5890,6 @@ libraries: java: api_description_override: allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. codeowner_team: '@googleapis/aap-dpes' - released_version: 2.99.0 name_pretty_override: Cloud Workflows product_documentation_override: https://cloud.google.com/workflows - name: workloadidentity @@ -6160,8 +5899,6 @@ libraries: java: additional_protos: - path: google/cloud/location/locations.proto - java: - released_version: 0.4.0 - name: workloadmanager version: 0.16.0-SNAPSHOT apis: @@ -6173,7 +5910,6 @@ libraries: api_id_override: workloadmanager.googleapis.com api_description_override: Workload Manager is a service that provides tooling for enterprise workloads to automate the deployment and validation of your workloads against best practices and recommendations. client_documentation_override: https://cloud.google.com/java/docs/reference/google-cloud-workloadmanager/latest/overview - released_version: 0.15.0 library_type_override: GAPIC_AUTO name_pretty_override: Workload Manager API product_documentation_override: https://docs.cloud.google.com/workload-manager/docs @@ -6184,7 +5920,6 @@ libraries: - path: google/apps/events/subscriptions/v1beta java: api_description_override: The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications. - released_version: 0.63.0 name_pretty_override: Google Workspace Events API product_documentation_override: https://developers.google.com/workspace/events - name: workstations @@ -6202,6 +5937,5 @@ libraries: - path: google/iam/v1/iam_policy.proto java: api_description_override: Fully managed development environments built to meet the needs of security-sensitive enterprises. It enhances the security of development environments while accelerating developer onboarding and productivity. - released_version: 0.87.0 name_pretty_override: Cloud Workstations product_documentation_override: https://cloud.google.com/workstations From 725f47a2a86870492c2f0b46ef49baa92c7108ee Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Tue, 20 Oct 2026 13:23:27 -0400 Subject: [PATCH 02/35] chore(compute): disable flaky ITComputeGoldenSignals.testComputeOperationTracing (#14675) Disable flaky `ITComputeGoldenSignals.testComputeOperationTracing`. b/574587624 --- .../cloud/compute/v1/integration/ITComputeGoldenSignals.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java b/java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java index d4734a7269d9..d92be8412431 100644 --- a/java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java +++ b/java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java @@ -79,6 +79,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.slf4j.LoggerFactory; import org.slf4j.event.KeyValuePair; @@ -238,6 +239,7 @@ private Span createRootSpan(String traceId) { * Tests that a successful compute operation generates traces that are correctly exported to Cloud * Trace. */ + @Ignore("Flaky test: b/574587624") @Test public void testComputeOperationTracing() throws Exception { String localTraceId = generateRandomHexString(32); From efeaff9d7f9ff463f5d77892278b433497fbcb1a Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 20 Oct 2026 14:07:34 -0400 Subject: [PATCH 03/35] test(gax): disable jitter in CancellationTest SLOW_RETRY_SETTINGS (#14702) Fixes #14539 --- .../google/api/gax/rpc/CancellationTest.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java index 70ec14611ce7..52fa081a3f2c 100644 --- a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java +++ b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java @@ -69,6 +69,13 @@ class CancellationTest { .setTotalTimeoutDuration(java.time.Duration.ofMillis(20L)) .build(); + // Disable jitter so ExponentialRetryAlgorithm.createNextAttempt always schedules the full + // 3000ms retry delay instead of picking a random delay in [0, 3000) ms via + // ThreadLocalRandom.current().nextLong(bound), which can otherwise expire before the + // cancellation thread calls resultFuture.cancel(true). + // totalTimeoutDuration must exceed initialRetryDelayDuration (10000ms > 3000ms) because + // ExponentialRetryAlgorithm.shouldRetry checks (totalTimeout - timeElapsed - retryDelay) > 0 + // before scheduling the next attempt. private static final RetrySettings SLOW_RETRY_SETTINGS = RetrySettings.newBuilder() .setInitialRetryDelayDuration(java.time.Duration.ofMillis(3000L)) @@ -77,7 +84,8 @@ class CancellationTest { .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(3000L)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(3000L)) - .setTotalTimeoutDuration(java.time.Duration.ofMillis(3000L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10000L)) + .setJittered(false) .build(); private FakeApiClock fakeClock; @@ -197,6 +205,10 @@ void cancellationDuringRetryDelay() throws Exception { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); CancellationTrackingFuture innerFuture = CancellationTrackingFuture.create(); + // Attempt 1 fails immediately with UNAVAILABLE, causing CallbackChainRetryingFuture to + // schedule Attempt 2 on the executor with SLOW_RETRY_SETTINGS's retry delay. + // innerFuture is queued in Mockito for Attempt 2 and is only returned if the retry delay + // expires and AttemptCallable.call() invokes callInt.futureCall() a second time. Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(throwable)) .thenReturn(innerFuture); @@ -220,6 +232,12 @@ void cancellationDuringRetryDelay() throws Exception { Truth.assertThat(gotException).isNotNull(); Truth.assertThat(resultFuture.isDone()).isTrue(); Truth.assertThat(resultFuture.isCancelled()).isTrue(); + // CallbackChainRetryingFuture replaces its active attemptFuture at each step of the retry + // loop (Attempt 1 future -> scheduled retry-delay timer future -> Attempt 2 future via + // AttemptCallable.call()). While waiting in the retry delay, attemptFuture points to the + // scheduled timer future from ScheduledRetryingExecutor.submit(). Cancelling resultFuture + // during this delay cancels that timer task before AttemptCallable.call() runs Attempt 2, + // so callInt.futureCall() is never called a second time and innerFuture is never cancelled. Truth.assertThat(innerFuture.isCancelled()).isFalse(); scheduler.shutdownNow(); From c702438f7d93af7fe30c94316240e2341819ccd4 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 20 Oct 2026 14:30:27 -0400 Subject: [PATCH 04/35] feat(bigquery-jdbc): Add clearcut telemetry client (#14607) --- java-bigquery-jdbc/.gitignore | 2 + java-bigquery-jdbc/README.MD | 58 ++ java-bigquery-jdbc/pom.xml | 24 + .../BigQueryConversionException.java | 5 +- .../BigQueryJdbcCoercionException.java | 36 - ...BigQueryJdbcCoercionNotFoundException.java | 40 -- .../exception/BigQueryJdbcException.java | 32 +- .../exception/BigQueryJdbcExceptionUtils.java | 47 ++ ...ryJdbcSqlFeatureNotSupportedException.java | 4 +- .../exception/BigQueryJdbcSqlStates.java | 64 ++ .../BigQueryJdbcSqlSyntaxErrorException.java | 7 +- .../bigquery/jdbc/BigQueryBaseResultSet.java | 7 + .../bigquery/jdbc/BigQueryConnection.java | 22 + .../cloud/bigquery/jdbc/BigQueryDriver.java | 32 +- .../jdbc/BigQueryJdbcContextProxy.java | 6 + .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 10 + .../jdbc/BigQueryParameterHandler.java | 9 + .../jdbc/BigQueryPooledConnection.java | 6 +- .../jdbc/BigQueryPreparedStatement.java | 32 + .../bigquery/jdbc/BigQueryStatement.java | 61 +- .../cloud/bigquery/jdbc/DataSource.java | 22 + .../jdbc/PooledConnectionDataSource.java | 4 + .../jdbc/telemetry/v1/ClearcutTransport.java | 129 ++++ .../v1/DriverEnvironmentDetector.java | 178 +++++ .../jdbc/telemetry/v1/TelemetryBatcher.java | 663 ++++++++++++++++++ .../telemetry/v1/TelemetryConfiguration.java | 189 +++++ .../jdbc/telemetry/v1/TelemetryManager.java | 339 +++++++++ .../v1/TelemetryPropertyUtility.java | 76 ++ .../jdbc/telemetry/v1/TransportResult.java | 71 ++ .../utils/BigQueryJdbcVersionUtility.java | 8 + .../jdbc/telemetry/v1/clientanalytics.proto | 41 ++ .../jdbc/telemetry/v1/telemetry.proto | 196 ++++++ .../exception/BigQueryJdbcExceptionTest.java | 7 +- .../bigquery/jdbc/BigQueryDriverTest.java | 50 ++ .../jdbc/BigQueryJdbcContextProxyTest.java | 13 + .../jdbc/BigQueryJdbcUrlUtilityTest.java | 24 + .../v1/BigQueryJdbcPropertyUtilityTest.java | 50 ++ .../telemetry/v1/ClearcutTransportTest.java | 263 +++++++ .../v1/DriverEnvironmentDetectorTest.java | 148 ++++ .../telemetry/v1/TelemetryBatcherTest.java | 608 ++++++++++++++++ .../v1/TelemetryConfigurationTest.java | 84 +++ .../telemetry/v1/TelemetryManagerTest.java | 250 +++++++ .../jdbc/telemetry/v1/TelemetryTestUtils.java | 28 + 43 files changed, 3845 insertions(+), 100 deletions(-) delete mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java delete mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlStates.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransport.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetector.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcher.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfiguration.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManager.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryPropertyUtility.java create mode 100644 java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TransportResult.java create mode 100644 java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/clientanalytics.proto create mode 100644 java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/telemetry.proto create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/BigQueryJdbcPropertyUtilityTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransportTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetectorTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcherTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfigurationTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManagerTest.java create mode 100644 java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryTestUtils.java diff --git a/java-bigquery-jdbc/.gitignore b/java-bigquery-jdbc/.gitignore index 4d2063438a20..b919e39bbe0f 100644 --- a/java-bigquery-jdbc/.gitignore +++ b/java-bigquery-jdbc/.gitignore @@ -9,6 +9,8 @@ tools/**/*.class tools/**/drivers/** tools/**/logs/** tools/**/*.jfr +tools/**/odbc/ +tools/**/native_odbc_perf # Gemini/Jetski agent custom skills .agents/ \ No newline at end of file diff --git a/java-bigquery-jdbc/README.MD b/java-bigquery-jdbc/README.MD index 3b2d085ed91c..34bbb7b38c54 100644 --- a/java-bigquery-jdbc/README.MD +++ b/java-bigquery-jdbc/README.MD @@ -44,6 +44,64 @@ See the [Authentication][authentication] section in the base directory's README. The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired BigQuery JDBC APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the BigQuery JDBC API calls. +## Client-side usage telemetry + +The JDBC driver for BigQuery includes client-side telemetry that +automatically collects anonymous usage and diagnostic metrics to help Google +improve driver stability and features. Client-side usage telemetry collection is +designed to run in the background without affecting driver performance or JDBC +functionality. Any telemetry transmission failures fail silently and don't +surface errors to the application or incur any cost. + +Client-side usage telemetry never collects SQL query text, parameter values, +database schema information, or data contents. Telemetry collection doesn't work +in environments using custom endpoint URLs or restricted network access that +blocks outbound connections to Google's public logging services. + +### Collected diagnostics + +The driver collects the following information: + +* Environment information: The Driver version, JVM major version, operating +system platform and version, and an anonymous device correlation ID stored +locally in the `~/.bigquery-jdbc/telemetry-tag` folder. +* Connection metrics: Connection outcome status (success, failure, or +cancellation) and authentication method used (such as service account, ADC, +or token). +* Execution metrics: High-level query operation types (such as `SELECT`, +INSERT, and CREATE TABLE), execution engine substrate used (standard REST API +or high-throughput API), and duration latency distributions. +* Error and feature metrics: Internal exception codes, origin methods, and +feature usage counters (such as prepared statements, batching, and connection +pooling). + + +### Client-side usage telemetry configuration + +Client-side usage telemetry behaves as a global background service for +the application's JVM. Settings can be configured using JDBC connection +properties, environment variables, or Java system properties. The driver +resolves settings in the following priority: system property > environment +variable > JDBC connection property. + +Due to its global nature, client-side usage telemetry connection properties +exhibit the following lifecycle behaviors: + +* Opt-Out Control: If client-side usage telemetry is disabled at any point using +a connection property (`EnableDiagnosticTelemetry=0`), environment variable, +or system property, the service immediately shuts down and remains permanently +off for the remainder of the JVM lifecycle. It will only restart when +the JVM restarts. + +#### Configuration Keys + +To configure these properties, you can use the following keys: + +* Opt-Out Control: + * Connection Property: `EnableDiagnosticTelemetry=0;` + * Environment Variable: `BIGQUERY_JDBC_TELEMETRY_ENABLED=false` + * System Property: `-DBIGQUERY_JDBC_TELEMETRY_ENABLED=false` + ## Developer Guide ### Prerequisites diff --git a/java-bigquery-jdbc/pom.xml b/java-bigquery-jdbc/pom.xml index 8907cfe934e4..2f344bd29c0a 100644 --- a/java-bigquery-jdbc/pom.xml +++ b/java-bigquery-jdbc/pom.xml @@ -36,6 +36,13 @@ + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + src/main/resources @@ -225,6 +232,23 @@ + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier} + true + + + + + compile + test-compile + + + + diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java index ea78a4f11330..f8bc25442a78 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java @@ -24,6 +24,9 @@ public class BigQueryConversionException extends SQLException { public BigQueryConversionException(String message, Throwable cause) { - super(BigQueryJdbcExceptionUtils.formatMessage(message, cause), cause); + super( + BigQueryJdbcExceptionUtils.formatMessage(message, cause), + BigQueryJdbcSqlStates.DATA_EXCEPTION, + cause); } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java deleted file mode 100644 index defbbfcca784..000000000000 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.bigquery.exception; - -import com.google.api.core.InternalApi; - -/** - * Thrown to indicate that the coercion was attempted but couldn't be performed successfully because - * of some error. - */ -@InternalApi -public class BigQueryJdbcCoercionException extends RuntimeException { - - /** - * Construct a new exception with the specified cause. - * - * @param cause the actual cause which was thrown while performing the coercion. - */ - public BigQueryJdbcCoercionException(Exception cause) { - super(BigQueryJdbcExceptionUtils.formatMessage("Coercion error", cause), cause); - } -} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java deleted file mode 100644 index b4eafb2ee583..000000000000 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.bigquery.exception; - -import com.google.api.core.InternalApi; - -/** - * Thrown to indicate that the current TypeCoercer can not perform the coercion as the Coercion - * implementation is not registered for the mentioned source and target type. - */ -@InternalApi -public class BigQueryJdbcCoercionNotFoundException extends RuntimeException { - - /** - * Construct a new exception. - * - * @param source the source type. - * @param target the target type. - */ - public BigQueryJdbcCoercionNotFoundException(Class source, Class target) { - super( - String.format( - "Coercion not found for [%s -> %s] conversion", - source.getCanonicalName(), target.getCanonicalName())); - } -} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java index 7467183e56eb..8d8dd2078589 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java @@ -28,7 +28,7 @@ public class BigQueryJdbcException extends SQLException { * @param message The detail message. */ public BigQueryJdbcException(String message) { - super(message); + super(message, BigQueryJdbcSqlStates.GENERAL_ERROR); } /** @@ -37,7 +37,7 @@ public BigQueryJdbcException(String message) { * @param ex The InterruptedException to be thrown. */ public BigQueryJdbcException(InterruptedException ex) { - super(ex); + super(ex.getMessage(), BigQueryJdbcSqlStates.QUERY_CANCELED, ex); } /** @@ -47,7 +47,10 @@ public BigQueryJdbcException(InterruptedException ex) { * @param ex The BigQueryException to be thrown. */ public BigQueryJdbcException(String message, BigQueryException ex) { - super(BigQueryJdbcExceptionUtils.formatMessage(message, ex), ex); + super( + BigQueryJdbcExceptionUtils.formatMessage(message, ex), + BigQueryJdbcExceptionUtils.sqlStateForCause(ex), + ex); this.bigQueryException = ex; } @@ -58,7 +61,10 @@ public BigQueryJdbcException(String message, BigQueryException ex) { * @param cause Throwable that is being converted. */ public BigQueryJdbcException(String message, Throwable cause) { - super(BigQueryJdbcExceptionUtils.formatMessage(message, cause), cause); + super( + BigQueryJdbcExceptionUtils.formatMessage(message, cause), + BigQueryJdbcExceptionUtils.sqlStateForCause(cause), + cause); } /** @@ -70,13 +76,23 @@ public BigQueryJdbcException(String message, Throwable cause) { */ public BigQueryJdbcException(Throwable cause) { super( - cause instanceof BigQueryJdbcException ? cause.getMessage() : String.valueOf(cause), - cause instanceof SQLException ? ((SQLException) cause).getSQLState() : null, - cause instanceof SQLException ? ((SQLException) cause).getErrorCode() : 0, + cause == null + ? null + : (cause instanceof BigQueryJdbcException + ? cause.getMessage() + : (cause.getMessage() != null ? cause.getMessage() : cause.toString())), + cause instanceof SQLException && ((SQLException) cause).getSQLState() != null + ? ((SQLException) cause).getSQLState() + : BigQueryJdbcExceptionUtils.sqlStateForCause(cause), + cause instanceof SQLException + ? ((SQLException) cause).getErrorCode() + : (cause instanceof BigQueryException ? ((BigQueryException) cause).getCode() : 0), cause instanceof BigQueryJdbcException ? cause.getCause() : cause); if (cause instanceof BigQueryJdbcException) { - bigQueryException = ((BigQueryJdbcException) cause).bigQueryException; + this.bigQueryException = ((BigQueryJdbcException) cause).bigQueryException; setStackTrace(cause.getStackTrace()); + } else if (cause instanceof BigQueryException) { + this.bigQueryException = (BigQueryException) cause; } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionUtils.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionUtils.java index 2ec3788d3c00..04632e1871a3 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionUtils.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionUtils.java @@ -16,6 +16,8 @@ package com.google.cloud.bigquery.exception; +import com.google.cloud.bigquery.BigQueryException; + /** Utility class for JDBC exceptions. */ final class BigQueryJdbcExceptionUtils { @@ -37,4 +39,49 @@ public static String formatMessage(String message, Throwable cause) { ? "\n" + (cause.getMessage() != null ? cause.getMessage() : cause.toString()) : ""); } + + /** + * Maps a cause to a standard SQL:2003 SQLState. + * + *

Returns {@code HY000} (general error) for anything unrecognised, so the result is always a + * valid 5-character state and never null. + * + * @param cause the underlying cause, may be null. + * @return a 5-character SQLState. + */ + static String sqlStateForCause(Throwable cause) { + if (!(cause instanceof BigQueryException)) { + return BigQueryJdbcSqlStates.GENERAL_ERROR; + } + String reason = ((BigQueryException) cause).getReason(); + if (reason == null) { + return BigQueryJdbcSqlStates.GENERAL_ERROR; + } + switch (reason) { + case "invalidQuery": + case "invalid": + case "badRequest": + return BigQueryJdbcSqlStates.SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION; + case "accessDenied": + return BigQueryJdbcSqlStates.INSUFFICIENT_PRIVILEGE; + case "invalidUser": + return BigQueryJdbcSqlStates.INVALID_AUTHORIZATION; + case "quotaExceeded": + case "rateLimitExceeded": + case "resourcesExceeded": + return BigQueryJdbcSqlStates.INSUFFICIENT_RESOURCES; + case "responseTooLarge": + return BigQueryJdbcSqlStates.PROGRAM_LIMIT_EXCEEDED; + case "stopped": + return BigQueryJdbcSqlStates.QUERY_CANCELED; + case "backendError": + case "internalError": + case "jobInternalError": + return BigQueryJdbcSqlStates.SYSTEM_ERROR; + case "notImplemented": + return BigQueryJdbcSqlStates.FEATURE_NOT_SUPPORTED; + default: + return BigQueryJdbcSqlStates.GENERAL_ERROR; + } + } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java index 8039dcd53495..da84cc4abd52 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java @@ -27,7 +27,7 @@ public class BigQueryJdbcSqlFeatureNotSupportedException extends SQLFeatureNotSu * @param message The detail message. */ public BigQueryJdbcSqlFeatureNotSupportedException(String message) { - super(message); + super(message, BigQueryJdbcSqlStates.FEATURE_NOT_SUPPORTED); } /** @@ -36,6 +36,6 @@ public BigQueryJdbcSqlFeatureNotSupportedException(String message) { * @param ex The BigQueryException to be thrown. */ public BigQueryJdbcSqlFeatureNotSupportedException(BigQueryException ex) { - super(ex); + super(ex.getMessage(), BigQueryJdbcSqlStates.FEATURE_NOT_SUPPORTED, ex); } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlStates.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlStates.java new file mode 100644 index 000000000000..ad7eb7e309c6 --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlStates.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +/** + * Standard SQL:2003 SQLState codes used by the driver. + * + *

A SQLState is a 5-character code: a 2-character class followed by a 3-character subclass. + * These values are defined by the SQL standard and are portable across databases; nothing here is + * BigQuery-specific. {@code BigQueryDatabaseMetaData.getSQLStateType()} declares that the driver + * emits SQL:2003 states, so do not mix in X/Open or ODBC-only codes. + */ +final class BigQueryJdbcSqlStates { + + /** 08 — connection exception. */ + static final String CONNECTION_EXCEPTION = "08006"; + + /** 0A — feature not supported. */ + static final String FEATURE_NOT_SUPPORTED = "0A000"; + + /** 22 — data exception (bad value, failed conversion). */ + static final String DATA_EXCEPTION = "22000"; + + /** 28 — invalid authorization specification (authentication failed). */ + static final String INVALID_AUTHORIZATION = "28000"; + + /** 42 — syntax error or access rule violation. */ + static final String SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = "42000"; + + static final String INSUFFICIENT_PRIVILEGE = "42501"; + + /** 53 — insufficient resources. */ + static final String INSUFFICIENT_RESOURCES = "53000"; + + /** 54 — program limit exceeded. */ + static final String PROGRAM_LIMIT_EXCEEDED = "54000"; + + /** 57 — operator intervention. */ + static final String QUERY_CANCELED = "57014"; + + /** 58 — system error. */ + static final String SYSTEM_ERROR = "58000"; + + /** HY — general error; the fallback when nothing more specific applies. */ + static final String GENERAL_ERROR = "HY000"; + + private BigQueryJdbcSqlStates() { + // Utility class, prevent instantiation + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java index 6d51e656542a..4006b4187254 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java @@ -32,10 +32,13 @@ public class BigQueryJdbcSqlSyntaxErrorException extends SQLSyntaxErrorException * @param ex The BigQueryException to be thrown. */ public BigQueryJdbcSqlSyntaxErrorException(BigQueryException ex) { - super(ex.getMessage(), "Incorrect SQL syntax."); + super(ex.getMessage(), BigQueryJdbcSqlStates.SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION, ex); } public BigQueryJdbcSqlSyntaxErrorException(String message, BigQueryException ex) { - super(BigQueryJdbcExceptionUtils.formatMessage(message, ex), ex); + super( + BigQueryJdbcExceptionUtils.formatMessage(message, ex), + BigQueryJdbcSqlStates.SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION, + ex); } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java index 9d9d5063cf00..d409eb79724c 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java @@ -28,6 +28,8 @@ import com.google.cloud.bigquery.StandardSQLTypeName; import com.google.cloud.bigquery.exception.BigQueryConversionException; import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanContext; import io.opentelemetry.context.Context; @@ -265,6 +267,11 @@ public ResultSetMetaData getMetaData() throws SQLException { metaData = BigQueryResultSetMetadata.of(this.schema.getFields(), this.statement); } } + + TelemetryManager.recordFeatureUsage( + DriverFeature.DRIVER_FEATURE_METADATA_RETRIEVAL, + "DRIVER_FEATURE_RESULTSET_METADATA_RETRIEVAL"); + return BigQueryJdbcContextProxy.wrap(metaData, ResultSetMetaData.class, connectionId); } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 92234dd3ac44..1e1c84c8e88c 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -41,6 +41,8 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; import com.google.cloud.bigquery.storage.v1.BigQueryReadSettings; import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; @@ -496,6 +498,9 @@ public Statement createStatement() throws SQLException { BigQueryStatement currentStatement = new BigQueryStatement(this); LOG.fine("Statement %s created.", currentStatement); addOpenStatements(currentStatement); + + TelemetryManager.recordFeatureUsage( + DriverFeature.DRIVER_FEATURE_CUSTOM, "DRIVER_FEATURE_REGULAR_STATEMENT"); return currentStatement; } @@ -554,6 +559,9 @@ public PreparedStatement prepareStatement(String sql) throws SQLException { PreparedStatement currentStatement = new BigQueryPreparedStatement(this, sql); LOG.fine("Prepared Statement %s created.", currentStatement); addOpenStatements(currentStatement); + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_PREPARED_STATEMENT); + return currentStatement; } @@ -695,6 +703,8 @@ private void beginTransaction() throws BigQueryJdbcException { TableResult transactionResult = this.bigQuery.query(transactionBeginJobConfig.build()); initSessionInfo(transactionResult.getSessionInfo().getSessionId()); this.transactionStarted = true; + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_TRANSACTIONS); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new BigQueryJdbcException("Failed to begin transaction", ex); @@ -952,6 +962,12 @@ public void setAutoCommit(boolean autoCommit) throws SQLException { if (!this.autoCommit) { beginTransaction(); } + + if (autoCommit) { + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_AUTOCOMMIT_ENABLED); + } else { + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_AUTOCOMMIT_DISABLED); + } } @Override @@ -1007,6 +1023,9 @@ public DatabaseMetaData getMetaData() throws SQLException { if (databaseMetaData == null) { databaseMetaData = new BigQueryDatabaseMetaData(this); } + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_METADATA_RETRIEVAL); + return databaseMetaData; } @@ -1572,6 +1591,9 @@ public CallableStatement prepareCall(String sql) throws SQLException { CallableStatement currentStatement = new BigQueryCallableStatement(this, sql); LOG.fine("Callable Statement %s created.", currentStatement); addOpenStatements(currentStatement); + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_CALLABLE_STATEMENT); + return currentStatement; } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java index 8c748b1f52bc..140636632316 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -18,6 +18,9 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.AuthenticationType; +import com.google.cloud.bigquery.jdbc.telemetry.v1.Status; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.cloud.bigquery.jdbc.utils.BigQueryJdbcVersionUtility; import io.grpc.LoadBalancerRegistry; import io.grpc.internal.PickFirstLoadBalancerProvider; @@ -124,6 +127,7 @@ public static BigQueryDriver getRegisteredDriver() throws IllegalStateException @Override public Connection connect(String url, Properties info) throws SQLException { LOG.finest("++enter++"); + AuthenticationType authType = AuthenticationType.AUTHENTICATION_TYPE_UNSPECIFIED; try { if (acceptsURL(url)) { Properties connectInfo = info == null ? new Properties() : (Properties) info.clone(); @@ -132,6 +136,17 @@ public Connection connect(String url, Properties info) throws SQLException { String connectionUri = BigQueryJdbcUrlUtility.appendPropertiesToURL( url.substring(5), this.toString(), connectInfo); + + String telemetryOptOut = + BigQueryJdbcUrlUtility.parseUriPropertyWithoutValidation( + connectionUri, BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME); + + if (telemetryOptOut != null) { + connectInfo.setProperty( + BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME, telemetryOptOut); + } + TelemetryManager.getInstance(connectInfo); + Level logLevel; String logPath; try { @@ -200,14 +215,25 @@ public Connection connect(String url, Properties info) throws SQLException { logLevel, logPath, this.toString()); - return BigQueryJdbcContextProxy.wrap(connection, Connection.class); + + Connection wrapped = BigQueryJdbcContextProxy.wrap(connection, Connection.class); + + authType = TelemetryManager.toAuthenticationType(ds.getOAuthType()); + TelemetryManager.recordConnectionAttempt(Status.STATUS_SUCCESS, 0, authType); + return wrapped; } else { return null; } } catch (IOException e) { - LOG.warning("Getting a warning: " + e.getMessage()); + TelemetryManager.recordConnectionAttempt( + Status.STATUS_ERROR, TelemetryManager.extractErrorCode(e), authType); + LOG.warning("Getting a warning: %s", e.getMessage()); + return null; + } catch (Throwable t) { + TelemetryManager.recordConnectionAttempt( + Status.STATUS_ERROR, TelemetryManager.extractErrorCode(t), authType); + throw t; } - return null; } /** diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxy.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxy.java index 360fba0a8ed1..fc724e53e543 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxy.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxy.java @@ -16,6 +16,7 @@ package com.google.cloud.bigquery.jdbc; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -177,6 +178,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl LOG.severe("Exception occurred during " + methodName + ": " + errMsg, cause); } + TelemetryManager.recordError( + TelemetryManager.extractErrorCode(cause), + TelemetryManager.extractSqlState(cause), + methodName); + throw cause; } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index ea022c7c9e51..ef7c9363c68d 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -20,6 +20,7 @@ import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryPropertyUtility; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.net.UrlEscapers; @@ -175,6 +176,7 @@ protected boolean removeEldestEntry(Map.Entry> eldes static final boolean DEFAULT_ENABLE_GCP_LOG_EXPORTER_VALUE = false; static final String USE_GLOBAL_OTEL_PROPERTY_NAME = "useGlobalOpenTelemetry"; static final boolean DEFAULT_USE_GLOBAL_OTEL_VALUE = false; + static final String ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME = "EnableDiagnosticTelemetry"; private static final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(BigQueryJdbcUrlUtility.class.getName()); static final String FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME = @@ -681,6 +683,14 @@ protected boolean removeEldestEntry(Map.Entry> eldes .setDescription( "Enables usage of the Global OpenTelemetry instance when true. Default is false.") .setDefaultValue(String.valueOf(DEFAULT_USE_GLOBAL_OTEL_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME) + .setDescription( + "Enables or disables client-side diagnostic telemetry. Enabled by default.") + .setDefaultValue( + String.valueOf( + TelemetryPropertyUtility.DEFAULT_ENABLE_DIAGNOSTIC_TELEMETRY_VALUE)) .build()))); private static final List NETWORK_PROPERTIES = diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java index 0edf6fd73b78..74f0fdc5a10d 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java @@ -21,6 +21,8 @@ import com.google.cloud.bigquery.StandardSQLTypeName; import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import java.math.BigInteger; import java.sql.Date; import java.sql.SQLException; @@ -221,6 +223,8 @@ void setNullParameter(int parameterIndex, Class declaredJavaType) { parameter.setParamType(BigQueryStatementParameterType.UNSPECIFIED); parameter.setScale(-1); + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_PARAMETER_BINDING); + LOG.finest("Parameter set { %s }", parameter.toString()); } @@ -330,6 +334,9 @@ void setParameter( if (parameter.getIndex() == -1) { parametersList.add(parameter); } + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_PARAMETER_BINDING); + LOG.finest("Parameter set { %s }", parameter.toString()); } @@ -354,6 +361,8 @@ void setParameter( parameter.setParamType(paramType); parameter.setScale(scale); + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_PARAMETER_BINDING); + LOG.finest("Parameter set { %s }", parameter.toString()); } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java index 99dea20e21ce..ad62ee76bcdb 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java @@ -16,8 +16,11 @@ package com.google.cloud.bigquery.jdbc; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.common.annotations.VisibleForTesting; import java.sql.Connection; +import java.sql.DatabaseMetaData; import java.sql.SQLException; import java.util.UUID; import java.util.concurrent.Executor; @@ -231,7 +234,8 @@ public void rollback() throws SQLException { } @Override - public java.sql.DatabaseMetaData getMetaData() throws SQLException { + public DatabaseMetaData getMetaData() throws SQLException { + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_METADATA_RETRIEVAL); return bqConnectionDelegate.getMetaData(); } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java index e26c07c2f5da..bfbf17c52607 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java @@ -28,6 +28,9 @@ import com.google.cloud.bigquery.TableId; import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.StatementExecution; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; import com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; @@ -431,19 +434,41 @@ public int[] executeBatch() throws SQLException { } if (useWriteAPI()) { + long startTime = System.currentTimeMillis(); + StatementExecution.Builder writeApiExecutionBuilder = + StatementExecution.newBuilder() + .setStatementType( + com.google.cloud.bigquery.jdbc.telemetry.v1.StatementType.STATEMENT_TYPE_INSERT) + .setQueryApiType( + com.google.cloud.bigquery.jdbc.telemetry.v1.QueryApiType + .QUERY_API_TYPE_WRITE_API); try (BigQueryWriteClient writeClient = this.connection.getBigQueryWriteClient()) { LOG.info("Using Write API for bulk INSERT operation."); long rowCount = bulkInsertWithWriteAPI(writeClient); int[] insertArray = new int[Math.toIntExact(rowCount)]; Arrays.fill(insertArray, 1); + + writeApiExecutionBuilder.setStatus( + com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_SUCCESS); + return insertArray; } catch (InterruptedException e) { Thread.currentThread().interrupt(); + writeApiExecutionBuilder + .setStatus(com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_ERROR) + .setErrorCode(TelemetryManager.extractErrorCode(e)); throw new BigQueryJdbcException("Interrupted during Write API batch", e); } catch (DescriptorValidationException | IOException e) { + writeApiExecutionBuilder + .setStatus(com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_ERROR) + .setErrorCode(TelemetryManager.extractErrorCode(e)); throw new BigQueryJdbcException("Failed to execute batch with Write API", e); + } finally { + long durationMs = System.currentTimeMillis() - startTime; + TelemetryManager.recordStatementExecution(writeApiExecutionBuilder, durationMs); + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_BATCH_OPERATIONS); } } else { @@ -472,6 +497,8 @@ public int[] executeBatch() throws SQLException { return result; } catch (SQLException e) { throw new BigQueryJdbcException("SQL error during individual INSERT batch", e); + } finally { + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_BATCH_OPERATIONS); } } } @@ -625,6 +652,11 @@ public ResultSetMetaData getMetaData() throws SQLException { if (this.resultSchema == null) { return null; } + + TelemetryManager.recordFeatureUsage( + DriverFeature.DRIVER_FEATURE_METADATA_RETRIEVAL, + "DRIVER_FEATURE_RESULTSET_METADATA_RETRIEVAL"); + return BigQueryResultSetMetadata.of(this.resultSchema.getFields(), this); } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index a5a8f4f4890a..af50bf8b8df3 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -47,6 +47,10 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlSyntaxErrorException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.QueryApiType; +import com.google.cloud.bigquery.jdbc.telemetry.v1.StatementExecution; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; import com.google.cloud.bigquery.storage.v1.ArrowSchema; import com.google.cloud.bigquery.storage.v1.ArrowSerializationOptions; @@ -105,6 +109,9 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { private static final String JDBC_JOB_PREFIX = "google-jdbc-"; private static final int MAX_RETRY_COUNT = 5; private static final long RETRY_DELAY_MS = 2000L; + // Reported when a failure carries no BigQuery or SQL error code, matching the fallback used by + // TelemetryManager#extractErrorCode. + private static final int UNKNOWN_ERROR_CODE = 1000; protected ResultSet currentResultSet; protected long currentUpdateCount = -1; protected List jobIds = new ArrayList<>(); @@ -148,6 +155,8 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { private static final ThreadFactory JDBC_THREAD_FACTORY = new BigQueryThreadFactory("BigQuery-Thread-"); + protected StatementExecution.Builder currentExecutionBuilder = StatementExecution.newBuilder(); + static { BigQueryDaemonPollingTask.startGcDaemonTask( referenceQueueArrowRs, @@ -170,6 +179,8 @@ private void resetStatementFields() { this.parentJobId = null; this.currentJobIdIndex = -1; this.currentUpdateCount = -1; + + this.currentExecutionBuilder = StatementExecution.newBuilder(); } private BigQuerySettings generateBigQuerySettings() throws SQLException { @@ -473,6 +484,8 @@ public void cancel() throws SQLException { // If a ResultSet exists, then it will be closed as well, closing the // ownedThreads closeStatementResources(); + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_STATEMENT_CANCEL); } @Override @@ -560,6 +573,7 @@ ExecuteResult executeJob(QueryJobConfiguration jobConfiguration) if (result instanceof TableResult) { TableResult tableResult = (TableResult) result; saveSessionIdIfPresent(tableResult); + this.currentExecutionBuilder.setQueryApiType(QueryApiType.QUERY_API_TYPE_JOBLESS_QUERY); return new ExecuteResult(tableResult, null); } @@ -590,6 +604,7 @@ ExecuteResult executeJob(QueryJobConfiguration jobConfiguration) job = refreshedJob; } } + this.currentExecutionBuilder.setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API); return new ExecuteResult(tableResult, job); } @@ -640,20 +655,54 @@ void runQuery(String query, QueryJobConfiguration jobConfiguration) throws SQLEx jobConfiguration.toBuilder().setJobTimeoutMs(Long.valueOf(queryTimeout) * 1000).build(); } + long startTime = System.currentTimeMillis(); + // Overwritten by the catch blocks below. The initial value covers failures that reach none of + // them, such as an uncaught RuntimeException, so a failure is never reported without a code. + int errorCode = UNKNOWN_ERROR_CODE; + try { resetStatementFields(); ExecuteResult executeResult = executeJob(jobConfiguration); StatementType statementType = getStatementType(executeResult); + + this.currentExecutionBuilder.setStatementType( + TelemetryManager.toStatementType(statementType)); + SqlType queryType = getQueryType(jobConfiguration, statementType); handleQueryResult(query, executeResult.tableResult, queryType, executeResult.job); + + this.currentExecutionBuilder.setStatus( + com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_SUCCESS); + } catch (InterruptedException ex) { + errorCode = TelemetryManager.extractErrorCode(ex); Thread.currentThread().interrupt(); throw new BigQueryJdbcException("Interrupted during runQuery", ex); } catch (BigQueryException ex) { + errorCode = TelemetryManager.extractErrorCode(ex); if (ex.getMessage().contains("Syntax error")) { throw new BigQueryJdbcSqlSyntaxErrorException("BigQueryException during runQuery", ex); } throw new BigQueryJdbcException("BigQueryException during runQuery", ex); + } catch (SQLException | RuntimeException ex) { + errorCode = TelemetryManager.extractErrorCode(ex); + throw ex; + } finally { + long durationMs = System.currentTimeMillis() - startTime; + + // Any path that did not reach STATUS_SUCCESS is a failure, whether it was caught above or + // propagated as an uncaught RuntimeException, so failures are never reported as UNSPECIFIED. + if (this.currentExecutionBuilder.getStatus() + == com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_UNSPECIFIED) { + this.currentExecutionBuilder + .setStatus( + isCanceled + ? com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_CANCELLED + : com.google.cloud.bigquery.jdbc.telemetry.v1.Status.STATUS_ERROR) + .setErrorCode(errorCode); + } + + TelemetryManager.recordStatementExecution(this.currentExecutionBuilder, durationMs); } } @@ -817,7 +866,6 @@ private QueryStatistics getQueryStatisticsFromJob(TableResult results, Job job) } private void updateAffectedRowCount(Long count) throws SQLException { - // TODO(neenu): check if this need to be closed vs removed) if (this.currentResultSet != null) { try { this.currentResultSet.close(); @@ -1056,6 +1104,7 @@ void processQueryResponse(String query, TableResult results, Job job) throws SQL try { LOG.info("Using ReadAPI to read the data."); resultSet = processArrowResultSet(results, job); + this.currentExecutionBuilder.setQueryApiType(QueryApiType.QUERY_API_TYPE_READ_API); } catch (SQLException e) { if (!isPermissionDeniedException(e)) { throw e; @@ -1067,6 +1116,13 @@ void processQueryResponse(String query, TableResult results, Job job) throws SQL if (resultSet == null) { LOG.info("Using Standard API to read the data."); resultSet = processJsonResultSet(results, job); + + // Jobless vs Standard REST + if (jobId == null) { + this.currentExecutionBuilder.setQueryApiType(QueryApiType.QUERY_API_TYPE_JOBLESS_QUERY); + } else { + this.currentExecutionBuilder.setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API); + } } this.currentResultSet = resultSet; this.currentUpdateCount = -1; @@ -1716,6 +1772,9 @@ private int[] executeBatchImpl(String combinedQueries) throws SQLException { } clearBatch(); + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_BATCH_OPERATIONS); + return result; } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java index 033cc54e2256..d0485584e15d 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java @@ -18,6 +18,7 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryPropertyUtility; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -128,6 +129,7 @@ public class DataSource implements javax.sql.DataSource { BigQueryJdbcUrlUtility.DEFAULT_ENABLE_GCP_LOG_EXPORTER_VALUE; private OpenTelemetry customOpenTelemetry; private boolean useGlobalOpenTelemetry = BigQueryJdbcUrlUtility.DEFAULT_USE_GLOBAL_OTEL_VALUE; + private Boolean enableDiagnosticTelemetry; // Make sure the JDBC driver class is loaded. static { @@ -387,6 +389,12 @@ public class DataSource implements javax.sql.DataSource { ds.setUseGlobalOpenTelemetry( BigQueryJdbcUrlUtility.convertIntToBoolean( val, BigQueryJdbcUrlUtility.USE_GLOBAL_OTEL_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME, + (ds, val) -> + ds.setEnableDiagnosticTelemetry( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME))) .build(); public static DataSource fromUrl(String url) { @@ -729,6 +737,9 @@ Properties createProperties() { BigQueryJdbcUrlUtility.USE_GLOBAL_OTEL_PROPERTY_NAME, String.valueOf(this.useGlobalOpenTelemetry)); } + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME, + String.valueOf(getEnableDiagnosticTelemetry())); return connectionProperties; } @@ -1575,4 +1586,15 @@ private static void validateMin(long val, long min, String propertyName) { "Invalid value for %s. It must be greater than or equal to %d.", propertyName, min)); } } + + public Boolean getEnableDiagnosticTelemetry() { + if (this.enableDiagnosticTelemetry != null) { + return this.enableDiagnosticTelemetry; + } + return TelemetryPropertyUtility.DEFAULT_ENABLE_DIAGNOSTIC_TELEMETRY_VALUE; + } + + public void setEnableDiagnosticTelemetry(Boolean enableDiagnosticTelemetry) { + this.enableDiagnosticTelemetry = enableDiagnosticTelemetry; + } } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java index 7de4516427c3..0a986bd860b5 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java @@ -17,6 +17,8 @@ package com.google.cloud.bigquery.jdbc; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.DriverFeature; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; import com.google.common.annotations.VisibleForTesting; import java.sql.Connection; import java.sql.SQLException; @@ -54,6 +56,8 @@ public PooledConnection getPooledConnection() throws SQLException { } BigQueryPooledConnection bqPooledConnection = new BigQueryPooledConnection(physicalConnection); bqPooledConnection.addConnectionEventListener(connectionPoolManager); + + TelemetryManager.recordFeatureUsage(DriverFeature.DRIVER_FEATURE_CONNECTION_POOLING); return bqPooledConnection; } diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransport.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransport.java new file mode 100644 index 000000000000..660efde8ea13 --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransport.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import com.google.api.client.http.ByteArrayContent; +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpContent; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger; +import java.io.IOException; +import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; + +final class ClearcutTransport { + private static final Logger logger = + new BigQueryJdbcCustomLogger(ClearcutTransport.class.getName()); + private static final String CONTENT_TYPE_PROTOBUF = "application/x-protobuf"; + private static final int DEFAULT_CONNECT_TIMEOUT_MS = 10_000; + private static final int DEFAULT_READ_TIMEOUT_MS = 10_000; + + private final HttpTransport httpTransport; + private final TelemetryConfiguration config; + private final HttpRequestFactory requestFactory; + + ClearcutTransport(TelemetryConfiguration config) { + this(new NetHttpTransport(), config); + } + + // Package-private constructor for testing overrides + ClearcutTransport(HttpTransport httpTransport, TelemetryConfiguration config) { + this.httpTransport = httpTransport; + this.config = config; + this.requestFactory = this.httpTransport.createRequestFactory(); + } + + TransportResult send(TelemetryPayload payload) { + if (!config.isEnabled()) { + return TransportResult.disabled(); + } + if (payload == null) { + logger.log(Level.WARNING, "Cannot send null telemetry payload to Clearcut"); + return TransportResult.disabled(); + } + + long now = System.currentTimeMillis(); + LogRequest logRequest = + LogRequest.newBuilder() + .setClientInfo( + ClientInfo.newBuilder() + .setClientType(TelemetryConfiguration.DEFAULT_CLIENT_TYPE) + .build()) + .setLogSource(config.getLogSource()) + .setRequestTimeMs(now) + .addLogEvents( + LogEvent.newBuilder() + .setEventTimeMs(now) + .setSourceExtension(payload.toByteString()) + .build()) + .build(); + + byte[] requestBytes = logRequest.toByteArray(); + HttpContent content = new ByteArrayContent(CONTENT_TYPE_PROTOBUF, requestBytes); + GenericUrl url = new GenericUrl(config.getEndpointUrl()); + + long nextRequestWaitMillis = -1; + + try { + HttpRequest request = requestFactory.buildPostRequest(url, content); + request.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT_MS); + request.setReadTimeout(DEFAULT_READ_TIMEOUT_MS); + request.setThrowExceptionOnExecuteError(false); + + HttpResponse response = null; + try { + response = request.execute(); + int statusCode = response.getStatusCode(); + + if (response.getContent() != null) { + try (InputStream is = response.getContent()) { + LogResponse logResponse = LogResponse.parseFrom(is); + if (logResponse.getNextRequestWaitMillis() > 0) { + nextRequestWaitMillis = logResponse.getNextRequestWaitMillis(); + } + } catch (IOException ignored) { + // Ignore non-protobuf content from error bodies + } + } + + boolean success = statusCode >= 200 && statusCode < 300; + if (success) { + logger.log(Level.FINE, "Successfully uploaded telemetry payload to Clearcut"); + } else { + logger.log( + Level.FINE, String.format("Clearcut upload failed with status code: %d", statusCode)); + } + return new TransportResult(success, nextRequestWaitMillis); + } finally { + if (response != null) { + response.disconnect(); + } + } + } catch (IOException e) { + logger.log(Level.FINE, "IOException sending telemetry payload to Clearcut", e); + return new TransportResult(false, nextRequestWaitMillis); + } catch (Throwable t) { + logger.log(Level.FINE, "Unexpected error sending telemetry payload to Clearcut", t); + return new TransportResult(false, nextRequestWaitMillis); + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetector.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetector.java new file mode 100644 index 000000000000..8dd6e0b3ba0e --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetector.java @@ -0,0 +1,178 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import com.google.cloud.bigquery.jdbc.utils.BigQueryJdbcVersionUtility; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** Utility builder for constructing {@link DriverEnvironment} telemetry protos. */ +final class DriverEnvironmentDetector { + private static final Logger logger = Logger.getLogger(DriverEnvironmentDetector.class.getName()); + + static final String DRIVER_NAME = "Google-BigQuery-JDBC-Driver"; + static final String CLIENT_LANGUAGE = "java"; + static final String DEFAULT_TELEMETRY_TAG_DIR = ".bigquery-jdbc"; + static final String DEFAULT_TELEMETRY_TAG_FILE = "telemetry-tag"; + static final String UNKNOWN = "unknown"; + static final String RESTRICTED = "restricted"; + + private DriverEnvironmentDetector() {} + + static DriverEnvironment build() { + return build(null); + } + + static DriverEnvironment build(Path customTelemetryTagPath) { + return DriverEnvironment.newBuilder() + .setDriverName(DRIVER_NAME) + .setDriverVersion(BigQueryJdbcVersionUtility.getSanitizedDriverVersion()) + .setClientLanguage(CLIENT_LANGUAGE) + .setClientLanguageVersion(getMajorJavaVersion()) + .setOsType(detectOsType()) + .setOsVersion(getMajorOsVersion()) + .setTelemetryTag(getOrCreateTelemetryTag(customTelemetryTagPath)) + .build(); + } + + static String getMajorJavaVersion() { + try { + return getMajorJavaVersion(System.getProperty("java.version")); + } catch (SecurityException e) { + return RESTRICTED; + } + } + + static String getMajorJavaVersion(String versionProperty) { + if (versionProperty == null || versionProperty.trim().isEmpty()) { + return UNKNOWN; + } + String version = versionProperty.trim(); + if (version.startsWith("1.")) { + // Legacy Java version format (e.g. 1.8.0_292 -> 8) + String[] parts = version.split("\\."); + if (parts.length >= 2) { + return parts[1]; + } + } else { + // Modern Java version format (e.g. 11.0.12 -> 11 or 17.0.1 -> 17) + int firstDot = version.indexOf('.'); + if (firstDot > 0) { + return version.substring(0, firstDot); + } + } + return version; + } + + static DriverEnvironment.OsType detectOsType() { + try { + return detectOsType(System.getProperty("os.name")); + } catch (SecurityException e) { + return DriverEnvironment.OsType.OS_TYPE_UNSPECIFIED; + } + } + + static DriverEnvironment.OsType detectOsType(String osNameProperty) { + if (osNameProperty == null || osNameProperty.trim().isEmpty()) { + return DriverEnvironment.OsType.OS_TYPE_UNKNOWN; + } + String osName = osNameProperty.toLowerCase(); + if (osName.contains("mac") || osName.contains("darwin")) { + return DriverEnvironment.OsType.OS_TYPE_MACOS; + } else if (osName.contains("win")) { + return DriverEnvironment.OsType.OS_TYPE_WINDOWS; + } else if (osName.contains("nux") || osName.contains("nix")) { + return DriverEnvironment.OsType.OS_TYPE_LINUX; + } else if (osName.contains("solaris") || osName.contains("sunos")) { + return DriverEnvironment.OsType.OS_TYPE_SOLARIS; + } else if (osName.contains("freebsd")) { + return DriverEnvironment.OsType.OS_TYPE_FREEBSD; + } else if (osName.contains("openbsd")) { + return DriverEnvironment.OsType.OS_TYPE_OPENBSD; + } else if (osName.contains("netbsd")) { + return DriverEnvironment.OsType.OS_TYPE_NETBSD; + } else if (osName.contains("aix")) { + return DriverEnvironment.OsType.OS_TYPE_AIX; + } + return DriverEnvironment.OsType.OS_TYPE_UNKNOWN; + } + + static String getMajorOsVersion() { + try { + return getMajorOsVersion(System.getProperty("os.version")); + } catch (SecurityException e) { + return RESTRICTED; + } + } + + static String getMajorOsVersion(String osVersionProperty) { + if (osVersionProperty == null || osVersionProperty.trim().isEmpty()) { + return UNKNOWN; + } + String version = osVersionProperty.trim(); + int firstDot = version.indexOf('.'); + if (firstDot > 0) { + return version.substring(0, firstDot); + } + return version; + } + + static String getOrCreateTelemetryTag(Path customFilePath) { + try { + Path idFilePath = customFilePath; + if (idFilePath == null) { + String userHome = System.getProperty("user.home"); + if (userHome == null || userHome.trim().isEmpty()) { + return UUID.randomUUID().toString(); + } + idFilePath = Paths.get(userHome, DEFAULT_TELEMETRY_TAG_DIR, DEFAULT_TELEMETRY_TAG_FILE); + } + + if (Files.exists(idFilePath)) { + try { + String content = + new String(Files.readAllBytes(idFilePath), StandardCharsets.UTF_8).trim(); + // Validate existing content is a valid UUID + UUID.fromString(content); + return content; + } catch (Exception e) { + logger.log( + Level.FINE, "Failed to read or parse telemetry tag from file, regenerating", e); + } + } + + String newId = UUID.randomUUID().toString(); + try { + if (idFilePath.getParent() != null) { + Files.createDirectories(idFilePath.getParent()); + } + Files.write(idFilePath, newId.getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + logger.log(Level.FINE, "Failed to persist telemetry tag to file", e); + } + return newId; + } catch (RuntimeException e) { + return UUID.randomUUID().toString(); + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcher.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcher.java new file mode 100644 index 000000000000..d5b602fb9bb0 --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcher.java @@ -0,0 +1,663 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger; +import com.google.common.annotations.VisibleForTesting; +import com.google.protobuf.Message; +import com.google.protobuf.Timestamp; +import java.time.Instant; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.LongAdder; +import java.util.concurrent.locks.ReentrantLock; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** High-performance, non-blocking telemetry event batcher and periodic dispatcher. */ +final class TelemetryBatcher implements AutoCloseable { + private static final Logger logger = + new BigQueryJdbcCustomLogger(TelemetryBatcher.class.getName()); + private static final int PROFILE_CAP_MULTIPLIER = 2; + + /** Cap used when no usable threshold is configured. */ + private static final int FALLBACK_PROFILE_CAP = 3000; + + /** Maximum time {@link #close()} waits for the final flush. */ + private static final long CLOSE_TIMEOUT_MS = 2_000; + + private final TelemetryConfiguration config; + private final ClearcutTransport transport; + private final DriverEnvironment driverEnvironment; + private final ScheduledExecutorService executorService; + private final boolean ownsExecutor; + private final ReentrantLock flushLock = new ReentrantLock(); + + // Live telemetry accumulator. Lock-free to eliminate object allocation and GC overhead. + private volatile ConcurrentHashMap metricsMap = + new ConcurrentHashMap<>(); + + /** Derived from {@code batchSizeThreshold}; see {@link #PROFILE_CAP_MULTIPLIER}. */ + private final int maxUniqueProfiles; + + /** Set while the last flush failed, to stop the size trigger hammering a failing endpoint. */ + private volatile boolean backoffActive; + + private final AtomicBoolean isClosed = new AtomicBoolean(false); + private final AtomicBoolean flushPending = new AtomicBoolean(); + private final AtomicLong currentScheduleDelayMs = new AtomicLong(-1); + private volatile ScheduledFuture scheduledTask; + + // Constructors & Lifecycle + TelemetryBatcher(TelemetryConfiguration config, ClearcutTransport transport) { + this( + config, + transport, + (config != null && config.isEnabled()) ? createDefaultExecutor() : null, + config != null && config.isEnabled()); + } + + TelemetryBatcher( + TelemetryConfiguration config, + ClearcutTransport transport, + ScheduledExecutorService executorService, + boolean ownsExecutor) { + this.config = config; + this.transport = transport; + this.driverEnvironment = config != null ? config.getDriverEnvironment() : null; + this.executorService = executorService; + this.ownsExecutor = ownsExecutor; + this.maxUniqueProfiles = computeProfileCap(config); + + if (this.config != null && this.config.isEnabled()) { + reschedule(this.config.getUploadIntervalMs()); + } + } + + /** + * Derives the hard profile cap from the configured queue-size threshold. Package-private so that + * the invariant {@code threshold < cap} can be asserted directly in tests. + */ + static int computeProfileCap(TelemetryConfiguration config) { + if (config == null) { + return FALLBACK_PROFILE_CAP; + } + int threshold = config.getBatchSizeThreshold(); + if (threshold <= 0) { + return FALLBACK_PROFILE_CAP; + } + return (int) Math.min((long) threshold * PROFILE_CAP_MULTIPLIER, Integer.MAX_VALUE); + } + + private static ScheduledExecutorService createDefaultExecutor() { + return Executors.newSingleThreadScheduledExecutor( + r -> { + Thread t = new Thread(r, "jdbc-telemetry-batcher"); + t.setDaemon(true); + return t; + }); + } + + TelemetryConfiguration getConfig() { + return config; + } + + private boolean isConfigured() { + return config != null && config.isEnabled() && transport != null; + } + + @Override + public void close() { + if (isClosed.compareAndSet(false, true)) { + if (scheduledTask != null) { + scheduledTask.cancel(false); + } + boolean flushed = flushOnClose(); + if (ownsExecutor && executorService != null) { + if (flushed) { + executorService.shutdown(); + } else { + executorService.shutdownNow(); + } + } + } + } + + // Ingestion Methods + void offer(Message metric) { + offer(metric, 0); + } + + void offer(Message metric, long durationMs) { + if (isClosed.get() || !isConfigured()) { + return; + } + TelemetryKey key = TelemetryKey.from(metric); + TelemetryAccumulator acc = getOrAddAccumulator(key); + if (acc != null) { + acc.accumulate(durationMs); + } + maybeFlushOnSize(); + } + + /** + * Flushes out of band once the pending queue reaches {@code batchSizeThreshold} entries, so a + * batch is dispatched on size as well as on the scheduled interval. Always dispatched to the + * batcher thread so that no JDBC caller thread performs network I/O. + */ + private void maybeFlushOnSize() { + if (backoffActive) { + return; + } + int threshold = config != null ? config.getBatchSizeThreshold() : 0; + if (threshold <= 0 || metricsMap.size() < threshold) { + return; + } + if (executorService == null || executorService.isShutdown()) { + return; + } + if (flushPending.compareAndSet(false, true)) { + executorService.execute( + () -> { + try { + flush(); + } finally { + flushPending.set(false); + } + }); + } + } + + private A getOrAddAccumulator(TelemetryKey key) { + if (isClosed.get() || !isConfigured()) { + return null; + } + if (metricsMap.size() >= maxUniqueProfiles && !metricsMap.containsKey(key)) { + return null; + } + return (A) metricsMap.computeIfAbsent(key, TelemetryKey::createAccumulator); + } + + // Dispatch & Flushing Methods + TransportResult flush() { + flushLock.lock(); + try { + if (!isConfigured()) { + return TransportResult.disabled(); + } + + // Atomic Map Swap: Freeze current counts for flushing and start fresh lock-free maps. + ConcurrentHashMap snapMetrics = this.metricsMap; + this.metricsMap = new ConcurrentHashMap<>(); + + if (snapMetrics.isEmpty()) { + return TransportResult.disabled(); + } + + Instant now = Instant.now(); + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()).setNanos(now.getNano()).build(); + TelemetryPayload.Builder payloadBuilder = + TelemetryPayload.newBuilder().setEventTime(timestamp); + + if (driverEnvironment != null) { + payloadBuilder.setDriverEnvironment(driverEnvironment); + } + + for (TelemetryAccumulator accumulator : snapMetrics.values()) { + accumulator.addToPayload(payloadBuilder); + } + + TransportResult result; + try { + result = transport.send(payloadBuilder.build()); + } catch (Throwable t) { + logger.log(Level.WARNING, "Unexpected exception during telemetry flush", t); + result = new TransportResult(false, -1); + } + + if (!result.isSuccess()) { + // Suppress the size trigger until a flush succeeds; reschedule() below spaces the retries. + backoffActive = true; + // Simple requeue logic for failed requests + remergeFailedMetrics(snapMetrics); + } else { + backoffActive = false; + } + + long uploadIntervalMs = config != null ? config.getUploadIntervalMs() : 300_000L; + long newDelayMs = + result.getNextRequestWaitMillis() > 0 + ? Math.max(uploadIntervalMs, result.getNextRequestWaitMillis()) + : uploadIntervalMs; + reschedule(newDelayMs); + + return result; + } finally { + flushLock.unlock(); + } + } + + /** + * Runs the final flush on the batcher thread and waits at most {@link #CLOSE_TIMEOUT_MS}, so a + * slow or unreachable endpoint cannot delay close() or JVM shutdown. + */ + private boolean flushOnClose() { + if (executorService == null || executorService.isShutdown()) { + flush(); + return true; + } + Future finalFlush = executorService.submit(this::flush); + try { + finalFlush.get(CLOSE_TIMEOUT_MS, TimeUnit.MILLISECONDS); + return true; + } catch (TimeoutException e) { + logger.log(Level.FINE, "Final telemetry flush did not complete within the close timeout"); + } catch (ExecutionException e) { + logger.log(Level.FINE, "Final telemetry flush failed", e.getCause()); + return true; + } catch (InterruptedException e) { + // No-op + } + return false; + } + + /** + * Re-queues metrics from a failed flush. Counts for profiles already in the live map are always + * merged; new profiles are subject to the same {@link #maxUniqueProfiles} cap as {@link + * #getOrAddAccumulator}, so a persistently failing endpoint cannot grow the map past the cap. + */ + private void remergeFailedMetrics(Map snapshot) { + int dropped = 0; + for (Map.Entry entry : snapshot.entrySet()) { + TelemetryAccumulator failed = entry.getValue(); + + TelemetryAccumulator merged = + metricsMap.computeIfPresent( + entry.getKey(), + (k, v) -> { + v.merge(failed); + return v; + }); + if (merged != null) { + continue; + } + + if (metricsMap.size() >= maxUniqueProfiles) { + dropped++; + continue; + } + // A caller thread may have added the same key since computeIfPresent; merge into theirs. + TelemetryAccumulator raced = metricsMap.putIfAbsent(entry.getKey(), failed); + if (raced != null) { + raced.merge(failed); + } + } + if (dropped > 0) { + logger.log( + Level.FINE, + String.format("Dropped %d telemetry profiles on re-queue; profile cap reached", dropped)); + } + } + + private void reschedule(long delayMs) { + if (isClosed.get()) { + return; + } + long current = currentScheduleDelayMs.get(); + if (current == delayMs && scheduledTask != null && !scheduledTask.isDone()) { + return; + } + if (scheduledTask != null) { + scheduledTask.cancel(false); + } + if (executorService != null && !executorService.isShutdown()) { + currentScheduleDelayMs.set(delayMs); + scheduledTask = executorService.schedule(this::flush, delayMs, TimeUnit.MILLISECONDS); + } + } + + // Telemetry Interfaces + interface TelemetryKey { + TelemetryAccumulator createAccumulator(); + + static TelemetryKey from(Message message) { + if (message instanceof StatementExecution) { + return new StatementKey((StatementExecution) message); + } else if (message instanceof ConnectionAttempt) { + return new ConnectionKey((ConnectionAttempt) message); + } else if (message instanceof ErrorMetric) { + return new ErrorKey((ErrorMetric) message); + } else if (message instanceof FeatureUsage) { + return new FeatureKey((FeatureUsage) message); + } + throw new IllegalArgumentException("Unsupported metric type: " + message.getClass()); + } + } + + interface TelemetryAccumulator { + void accumulate(long value); + + void merge(TelemetryAccumulator other); + + void addToPayload(TelemetryPayload.Builder payloadBuilder); + } + + // Telemetry Keys + static final class StatementKey implements TelemetryKey { + final StatementType type; + final QueryApiType api; + final Status status; + final int errorCode; + + StatementKey(StatementExecution statementExecution) { + this.type = statementExecution.getStatementType(); + this.api = statementExecution.getQueryApiType(); + this.status = statementExecution.getStatus(); + this.errorCode = statementExecution.getErrorCode(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof StatementKey)) { + return false; + } + StatementKey that = (StatementKey) o; + return errorCode == that.errorCode + && type == that.type + && api == that.api + && status == that.status; + } + + @Override + public int hashCode() { + return Objects.hash(type, api, status, errorCode); + } + + @Override + public TelemetryAccumulator createAccumulator() { + return new StatementAccumulator(this); + } + + StatementExecution.Builder toBuilder() { + return StatementExecution.newBuilder() + .setStatementType(type) + .setQueryApiType(api) + .setStatus(status) + .setErrorCode(errorCode); + } + } + + static final class ConnectionKey implements TelemetryKey { + final AuthenticationType authType; + final Status status; + final int errorCode; + + ConnectionKey(ConnectionAttempt connectionAttempt) { + this.authType = connectionAttempt.getAuthType(); + this.status = connectionAttempt.getStatus(); + this.errorCode = connectionAttempt.getErrorCode(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ConnectionKey)) { + return false; + } + ConnectionKey that = (ConnectionKey) o; + return errorCode == that.errorCode && authType == that.authType && status == that.status; + } + + @Override + public int hashCode() { + return Objects.hash(authType, status, errorCode); + } + + @Override + public TelemetryAccumulator createAccumulator() { + return new ConnectionAccumulator(this); + } + + ConnectionAttempt.Builder toBuilder() { + return ConnectionAttempt.newBuilder() + .setAuthType(authType) + .setStatus(status) + .setErrorCode(errorCode); + } + } + + static final class ErrorKey implements TelemetryKey { + final int errorCode; + final int errorXdbcCode; + final String errorSqlState; + final String methodName; + + ErrorKey(ErrorMetric errorMetric) { + this.errorCode = errorMetric.getErrorCode(); + this.errorXdbcCode = errorMetric.getErrorXdbcCode(); + this.errorSqlState = errorMetric.getErrorSqlState(); + this.methodName = errorMetric.getMethodName(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ErrorKey)) { + return false; + } + ErrorKey errorKey = (ErrorKey) o; + return errorCode == errorKey.errorCode + && errorXdbcCode == errorKey.errorXdbcCode + && Objects.equals(errorSqlState, errorKey.errorSqlState) + && Objects.equals(methodName, errorKey.methodName); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorXdbcCode, errorSqlState, methodName); + } + + @Override + public TelemetryAccumulator createAccumulator() { + return new ErrorAccumulator(this); + } + + ErrorMetric.Builder toBuilder() { + return ErrorMetric.newBuilder() + .setErrorCode(errorCode) + .setErrorXdbcCode(errorXdbcCode) + .setErrorSqlState(errorSqlState == null ? "" : errorSqlState) + .setMethodName(methodName); + } + } + + static final class FeatureKey implements TelemetryKey { + final DriverFeature driverFeature; + final String customFeatureName; + + FeatureKey(FeatureUsage featureUsage) { + this.driverFeature = featureUsage.getDriverFeature(); + this.customFeatureName = featureUsage.getCustomFeatureName(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof FeatureKey)) { + return false; + } + FeatureKey that = (FeatureKey) o; + return driverFeature == that.driverFeature + && Objects.equals(customFeatureName, that.customFeatureName); + } + + @Override + public int hashCode() { + return Objects.hash(driverFeature, customFeatureName); + } + + @Override + public TelemetryAccumulator createAccumulator() { + return new FeatureAccumulator(this); + } + + FeatureUsage.Builder toBuilder() { + return FeatureUsage.newBuilder() + .setDriverFeature(driverFeature) + .setCustomFeatureName(customFeatureName == null ? "" : customFeatureName); + } + } + + // Telemetry Accumulators + abstract static class CountAccumulator implements TelemetryAccumulator { + protected final LongAdder count = new LongAdder(); + + @Override + public void accumulate(long unused) { + count.increment(); + } + + @Override + public void merge(TelemetryAccumulator other) { + this.count.add(((CountAccumulator) other).count.sum()); + } + } + + static final class StatementAccumulator implements TelemetryAccumulator { + @VisibleForTesting + static final double[] HISTOGRAM_BOUNDS = { + 50.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 10000.0, 30000.0, 60000.0, 120000.0, + 300000.0, 600000.0, 1200000.0, 1800000.0, 3600000.0 + }; + + private final StatementKey key; + private final LongAdder count = new LongAdder(); + private final LongAdder durationSum = new LongAdder(); + private final LongAdder[] bucketCounts = new LongAdder[HISTOGRAM_BOUNDS.length + 1]; + + StatementAccumulator(StatementKey key) { + this.key = key; + for (int i = 0; i < bucketCounts.length; i++) { + bucketCounts[i] = new LongAdder(); + } + } + + @Override + public void accumulate(long durationMs) { + count.increment(); + durationSum.add(durationMs); + int bucket = calculateBucket(durationMs); + bucketCounts[bucket].increment(); + } + + @VisibleForTesting + static int calculateBucket(long durationMs) { + for (int i = 0; i < HISTOGRAM_BOUNDS.length; i++) { + if (durationMs < HISTOGRAM_BOUNDS[i]) { + return i; + } + } + return HISTOGRAM_BOUNDS.length; + } + + @Override + public void merge(TelemetryAccumulator other) { + StatementAccumulator o = (StatementAccumulator) other; + count.add(o.count.sum()); + durationSum.add(o.durationSum.sum()); + for (int i = 0; i < bucketCounts.length; i++) { + bucketCounts[i].add(o.bucketCounts[i].sum()); + } + } + + @Override + public void addToPayload(TelemetryPayload.Builder payloadBuilder) { + long totalCount = count.sum(); + DurationHistogram.Builder durBuilder = + DurationHistogram.newBuilder().setCount(totalCount).setSum(durationSum.sum()); + + for (double bound : HISTOGRAM_BOUNDS) { + durBuilder.addExplicitBounds(bound); + } + for (LongAdder bucket : bucketCounts) { + durBuilder.addBucketCounts(bucket.sum()); + } + + payloadBuilder.addStatementExecutions( + key.toBuilder().setCount(totalCount).setDuration(durBuilder).build()); + } + } + + static final class ConnectionAccumulator extends CountAccumulator { + final ConnectionKey key; + + ConnectionAccumulator(ConnectionKey key) { + this.key = key; + } + + @Override + public void addToPayload(TelemetryPayload.Builder payloadBuilder) { + payloadBuilder.addConnectionAttempts(key.toBuilder().setCount(count.sum()).build()); + } + } + + static final class ErrorAccumulator extends CountAccumulator { + final ErrorKey key; + + ErrorAccumulator(ErrorKey key) { + this.key = key; + } + + @Override + public void addToPayload(TelemetryPayload.Builder payloadBuilder) { + payloadBuilder.addErrors(key.toBuilder().setCount(count.sum()).build()); + } + } + + static final class FeatureAccumulator extends CountAccumulator { + final FeatureKey key; + + FeatureAccumulator(FeatureKey key) { + this.key = key; + } + + @Override + public void addToPayload(TelemetryPayload.Builder payloadBuilder) { + payloadBuilder.addFeatureUsages(key.toBuilder().setCount(count.sum()).build()); + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfiguration.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfiguration.java new file mode 100644 index 000000000000..72ce8fe396fe --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfiguration.java @@ -0,0 +1,189 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import java.util.Objects; +import java.util.Properties; + +/** Configuration settings for the BigQuery JDBC driver telemetry client. */ +final class TelemetryConfiguration { + + static final int DEFAULT_LOG_SOURCE = 3071; + static final int DEFAULT_CLIENT_TYPE = 52; + static final String DEFAULT_ENDPOINT_URL = "https://play.googleapis.com/log"; + + private final boolean enabled; + private final int logSource; + private final String endpointUrl; + private final long uploadIntervalMs; + private final int batchSizeThreshold; + private final DriverEnvironment driverEnvironment; + + private TelemetryConfiguration(Builder builder) { + this.enabled = builder.enabled; + this.logSource = builder.logSource; + this.endpointUrl = builder.endpointUrl; + this.uploadIntervalMs = builder.uploadIntervalMs; + this.batchSizeThreshold = builder.batchSizeThreshold; + this.driverEnvironment = builder.driverEnvironment; + } + + boolean isEnabled() { + return enabled; + } + + int getLogSource() { + return logSource; + } + + String getEndpointUrl() { + return endpointUrl; + } + + long getUploadIntervalMs() { + return uploadIntervalMs; + } + + int getBatchSizeThreshold() { + return batchSizeThreshold; + } + + DriverEnvironment getDriverEnvironment() { + return driverEnvironment; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TelemetryConfiguration that = (TelemetryConfiguration) o; + return enabled == that.enabled + && logSource == that.logSource + && uploadIntervalMs == that.uploadIntervalMs + && batchSizeThreshold == that.batchSizeThreshold + && Objects.equals(endpointUrl, that.endpointUrl) + && Objects.equals(driverEnvironment, that.driverEnvironment); + } + + @Override + public int hashCode() { + return Objects.hash( + enabled, logSource, endpointUrl, uploadIntervalMs, batchSizeThreshold, driverEnvironment); + } + + @Override + public String toString() { + return "TelemetryConfiguration{" + + "enabled=" + + enabled + + ", logSource=" + + logSource + + ", endpointUrl='" + + endpointUrl + + '\'' + + ", uploadIntervalMs=" + + uploadIntervalMs + + ", batchSizeThreshold=" + + batchSizeThreshold + + ", driverEnvironment=" + + driverEnvironment + + '}'; + } + + static Builder newBuilder() { + return new Builder(); + } + + static Builder builder() { + return new Builder(); + } + + /** Builder for {@link TelemetryConfiguration}. */ + static class Builder { + private boolean enabled = TelemetryPropertyUtility.DEFAULT_ENABLE_DIAGNOSTIC_TELEMETRY_VALUE; + private int logSource = DEFAULT_LOG_SOURCE; + private String endpointUrl = DEFAULT_ENDPOINT_URL; + private long uploadIntervalMs = + TelemetryPropertyUtility.DEFAULT_TELEMETRY_UPLOAD_INTERVAL_VALUE; + private int batchSizeThreshold = TelemetryPropertyUtility.DEFAULT_TELEMETRY_BATCH_SIZE_VALUE; + private DriverEnvironment driverEnvironment; + + Builder setEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + Builder setLogSource(int logSource) { + this.logSource = logSource; + return this; + } + + Builder setEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + Builder setUploadIntervalMs(long uploadIntervalMs) { + this.uploadIntervalMs = uploadIntervalMs; + return this; + } + + Builder setBatchSizeThreshold(int batchSizeThreshold) { + this.batchSizeThreshold = batchSizeThreshold; + return this; + } + + Builder setDriverEnvironment(DriverEnvironment driverEnvironment) { + this.driverEnvironment = driverEnvironment; + return this; + } + + Builder resolveProperties(Properties connectionProperties) { + // 1. Connection Properties (lowest precedence) + if (connectionProperties != null) { + String enableStr = connectionProperties.getProperty("EnableDiagnosticTelemetry"); + this.enabled = TelemetryPropertyUtility.convertStringToBoolean(enableStr, this.enabled); + } + + // 2. Environment Variables (overrides connection properties) + try { + String envEnabled = System.getenv("BIGQUERY_JDBC_TELEMETRY_ENABLED"); + this.enabled = TelemetryPropertyUtility.convertStringToBoolean(envEnabled, enabled); + } catch (SecurityException e) { + // Ignore and proceed + } + + // 3. JVM System Properties (highest precedence) + try { + String sysEnabled = System.getProperty("BIGQUERY_JDBC_TELEMETRY_ENABLED"); + this.enabled = TelemetryPropertyUtility.convertStringToBoolean(sysEnabled, enabled); + } catch (SecurityException e) { + // Ignore and proceed + } + + return this; + } + + TelemetryConfiguration build() { + return new TelemetryConfiguration(this); + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManager.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManager.java new file mode 100644 index 000000000000..cea0b438e5a0 --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManager.java @@ -0,0 +1,339 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger; +import com.google.protobuf.Descriptors.EnumValueDescriptor; +import java.sql.SQLException; +import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Thread-safe singleton hub managing the lifecycle of {@link TelemetryBatcher} for client-side + * diagnostic and usage telemetry in the BigQuery JDBC driver. + * + *

All telemetry operations are wrapped in exception safeguards so that failures in metric + * collection or batch dispatching never impact standard JDBC functionality. + */ +public final class TelemetryManager implements AutoCloseable { + private static final Logger logger = + new BigQueryJdbcCustomLogger(TelemetryManager.class.getName()); + + private static volatile TelemetryManager instance; + private static volatile boolean globallyDisabled = false; + + private final TelemetryBatcher batcher; + + private TelemetryManager(TelemetryBatcher batcher) { + this.batcher = batcher; + } + + /** + * Initializes or replaces the shared {@link TelemetryManager} instance with default configuration + * and transport. + */ + public static TelemetryManager getInstance() { + return getInstance(null); + } + + public static TelemetryManager getInstance(Properties properties) { + if (globallyDisabled) { + return null; + } + + if (properties != null + && !TelemetryConfiguration.builder().resolveProperties(properties).build().isEnabled()) { + synchronized (TelemetryManager.class) { + globallyDisabled = true; + closeInstance(); + } + return null; + } + + TelemetryManager localRef = instance; + if (localRef != null) { + return localRef; + } + + synchronized (TelemetryManager.class) { + if (globallyDisabled) { + return null; + } + localRef = instance; + if (localRef != null) { + return localRef; + } + TelemetryConfiguration config = + TelemetryConfiguration.builder() + .resolveProperties(properties) + .setDriverEnvironment(DriverEnvironmentDetector.build()) + .build(); + ClearcutTransport transport = new ClearcutTransport(config); + TelemetryBatcher batcher = new TelemetryBatcher(config, transport); + localRef = new TelemetryManager(batcher); + // Registered before the instance is published so that a non-null instance always implies a + // registered shutdown hook. + registerShutdownHook(); + instance = localRef; + return localRef; + } + } + + /** Package-private lifecycle initialisation method for explicit configuration or unit testing. */ + static synchronized void init(TelemetryConfiguration config, ClearcutTransport transport) { + closeInstance(); + if (globallyDisabled || config == null || !config.isEnabled() || transport == null) { + return; + } + instance = new TelemetryManager(new TelemetryBatcher(config, transport)); + } + + /** + * Returns the underlying {@link TelemetryBatcher} managed by this instance, or {@code null} if + * telemetry is closed or uninitialized. + */ + TelemetryBatcher getBatcher() { + return batcher; + } + + /** + * Returns the {@link TelemetryBatcher} of the active instance, or {@code null} if telemetry is + * closed or uninitialized. + */ + private static TelemetryBatcher activeBatcher() { + TelemetryManager localRef = instance; + return localRef == null ? null : localRef.getBatcher(); + } + + /** + * Executes a telemetry logging operation safely inside an exception-isolated block. Guaranteed to + * catch all {@link Throwable} exceptions to protect JDBC driver operations. + */ + public static void runSafely(Runnable action) { + if (action == null) { + return; + } + try { + action.run(); + } catch (Throwable t) { + logger.log(Level.FINE, "Diagnostic telemetry operation encountered non-fatal error", t); + } + } + + /** Helper to check if an active instance is present and initialized. */ + public static boolean isInitialized() { + return instance != null; + } + + /** Flushes pending buffered metrics and shuts down the shared instance. */ + public static synchronized void closeInstance() { + TelemetryManager localRef = instance; + instance = null; + if (localRef == null) { + return; + } + try { + localRef.close(); + } catch (Throwable t) { + logger.log(Level.FINE, "Error closing TelemetryManager instance", t); + } + } + + @Override + public void close() { + batcher.close(); + } + + // Package-private test helper to reset the global kill switch between test runs + static synchronized void resetGlobalDisableForTest() { + globallyDisabled = false; + } + + public static StatementType toStatementType(QueryStatistics.StatementType bqStatementType) { + if (bqStatementType == null) { + return StatementType.STATEMENT_TYPE_UNSPECIFIED; + } + + EnumValueDescriptor desc = + StatementType.getDescriptor().findValueByName("STATEMENT_TYPE_" + bqStatementType.name()); + + return desc != null ? StatementType.valueOf(desc) : StatementType.STATEMENT_TYPE_OTHER; + } + + public static AuthenticationType toAuthenticationType(int oauthType) { + switch (oauthType) { + case 0: + return AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT; + case 1: + return AuthenticationType.AUTHENTICATION_TYPE_USER_AUTHENTICATION; + case 2: + return AuthenticationType.AUTHENTICATION_TYPE_TOKEN; + case 3: + return AuthenticationType.AUTHENTICATION_TYPE_APPLICATION_DEFAULT_CREDENTIALS; + case 4: + return AuthenticationType.AUTHENTICATION_TYPE_EXTERNAL; + default: + return AuthenticationType.AUTHENTICATION_TYPE_CUSTOM; + } + } + + public static void recordConnectionAttempt( + Status status, int errorCode, AuthenticationType authType) { + runSafely( + () -> { + TelemetryBatcher activeBatcher = activeBatcher(); + if (activeBatcher == null) { + return; + } + activeBatcher.offer( + ConnectionAttempt.newBuilder() + .setStatus(status) + .setErrorCode(errorCode) + .setAuthType(authType) + .build()); + }); + } + + public static void recordStatementExecution( + StatementExecution.Builder statementExecutionBuilder, long durationMs) { + if (statementExecutionBuilder == null) { + return; + } + runSafely( + () -> { + TelemetryBatcher activeBatcher = activeBatcher(); + if (activeBatcher == null) { + return; + } + activeBatcher.offer(statementExecutionBuilder.build(), durationMs); + }); + } + + public static void recordFeatureUsage(DriverFeature feature, String customFeatureName) { + runSafely( + () -> { + TelemetryBatcher activeBatcher = activeBatcher(); + if (activeBatcher == null) { + return; + } + activeBatcher.offer( + FeatureUsage.newBuilder() + .setDriverFeature(feature) + .setCustomFeatureName(customFeatureName == null ? "" : customFeatureName) + .build()); + }); + } + + public static void recordFeatureUsage(DriverFeature feature) { + recordFeatureUsage(feature, null); + } + + public static void recordError(int errorCode, String errorSqlState, String methodName) { + runSafely( + () -> { + TelemetryBatcher activeBatcher = activeBatcher(); + if (activeBatcher == null) { + return; + } + activeBatcher.offer( + ErrorMetric.newBuilder() + .setErrorCode(errorCode) + // This value is not actively populated, defaults to 0. + .setErrorXdbcCode(0) + .setErrorSqlState(errorSqlState == null ? "" : errorSqlState) + .setMethodName(methodName == null ? "" : methodName) + .build()); + }); + } + + /** + * Extracts the numeric error code from the throwable chain. Traverses causes to unpack + * BigQueryException (HTTP status codes) or SQLException error codes. Returns 1000 as the fallback + * driver error code. + */ + public static int extractErrorCode(Throwable t) { + int depth = 0; + while (t != null && depth++ < 20) { + if (t instanceof BigQueryException) { + int code = ((BigQueryException) t).getCode(); + if (code != 0) { + return code; + } + } + if (t instanceof SQLException) { + int code = ((SQLException) t).getErrorCode(); + if (code != 0) { + return code; + } + } + t = t.getCause(); + } + return 1000; + } + + /** + * Extracts the SQLState from the throwable chain. SQLStates are five-character strings. + * + *

Returns empty String when no SQLState is present. + */ + public static String extractSqlState(Throwable t) { + int depth = 0; + while (t != null && depth++ < 20) { + if (t instanceof SQLException) { + String sqlState = ((SQLException) t).getSQLState(); + if (sqlState != null && !sqlState.isEmpty()) { + return sqlState; + } + } + t = t.getCause(); + } + return ""; + } + + /** + * Registers the JVM shutdown hook that flushes pending telemetry. + * + *

Only reached from the instance-creation critical section of {@link + * #getInstance(Properties)}, which already guarantees single execution, so no further guarding is + * needed here. + */ + private static void registerShutdownHook() { + try { + Runtime.getRuntime() + .addShutdownHook( + new Thread( + TelemetryManager::closeInstanceOnShutdown, + "bigquery-jdbc-telemetry-shutdown-hook")); + } catch (IllegalStateException e) { + // Thrown if the JVM is already in the process of shutting down + } catch (SecurityException e) { + logger.warning("SecurityManager prevented registering telemetry shutdown hook"); + } + } + + /** Shutdown-hook body: flushes and closes the shared instance without propagating failures. */ + private static void closeInstanceOnShutdown() { + try { + closeInstance(); + } catch (Throwable t) { + logger.warning("Error closing TelemetryManager during JVM shutdown"); + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryPropertyUtility.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryPropertyUtility.java new file mode 100644 index 000000000000..1d1294a07ac7 --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryPropertyUtility.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger; + +/** + * Utility methods for parsing and validating JDBC connection properties in Telemetry package. + * + *

This is a subset of parse methods used in the telemetry package. Separated out to keep only + * the essential methods. + */ +@InternalApi +public final class TelemetryPropertyUtility { + public static final boolean DEFAULT_ENABLE_DIAGNOSTIC_TELEMETRY_VALUE = true; + public static final long DEFAULT_TELEMETRY_UPLOAD_INTERVAL_VALUE = 300_000L; + public static final int DEFAULT_TELEMETRY_BATCH_SIZE_VALUE = 5000; + + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(TelemetryPropertyUtility.class.getName()); + + private TelemetryPropertyUtility() { + // Utility class, static methods only. + } + + /** + * Converts a String representation of an integer or boolean to a boolean value. + * + * @param value the string value to parse ("0", "1", "true", or "false") + * @param defaultValue default value of teh property + * @return true if 1/true, false if 0/false + */ + static boolean convertStringToBoolean(String value, boolean defaultValue) { + if (value == null) { + return defaultValue; + } + + int integerValue; + + try { + if (value.equalsIgnoreCase("true")) { + integerValue = 1; + } else if (value.equalsIgnoreCase("false")) { + integerValue = 0; + } else { + integerValue = Integer.parseInt(value); + } + } catch (NumberFormatException ex) { + // Fail-safe: ignore invalid telemetry values to avoid disrupting JDBC operations. + return defaultValue; + } + + if (integerValue == 1) { + return true; + } else if (integerValue == 0) { + return false; + } else { + return defaultValue; + } + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TransportResult.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TransportResult.java new file mode 100644 index 000000000000..a6d28508160b --- /dev/null +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TransportResult.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import java.util.Objects; + +/** Represents the immutable result of a Clearcut telemetry payload transmission attempt. */ +final class TransportResult { + private static final TransportResult DISABLED = new TransportResult(false, -1); + + private final boolean success; + private final long nextRequestWaitMillis; + + TransportResult(boolean success, long nextRequestWaitMillis) { + this.success = success; + this.nextRequestWaitMillis = nextRequestWaitMillis; + } + + static TransportResult disabled() { + return DISABLED; + } + + boolean isSuccess() { + return success; + } + + long getNextRequestWaitMillis() { + return nextRequestWaitMillis; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransportResult that = (TransportResult) o; + return success == that.success && nextRequestWaitMillis == that.nextRequestWaitMillis; + } + + @Override + public int hashCode() { + return Objects.hash(success, nextRequestWaitMillis); + } + + @Override + public String toString() { + return "TransportResult{" + + "success=" + + success + + ", nextRequestWaitMillis=" + + nextRequestWaitMillis + + '}'; + } +} diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/utils/BigQueryJdbcVersionUtility.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/utils/BigQueryJdbcVersionUtility.java index ece2ad4bd268..ebab86581f87 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/utils/BigQueryJdbcVersionUtility.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/utils/BigQueryJdbcVersionUtility.java @@ -80,6 +80,14 @@ public static String getDriverVersion() { return DRIVER_VERSION; } + /** + * Returns a sanitized version of the driver version, containing only the major and minor + * components (e.g. "1.2" for "1.2.0-SNAPSHOT"). + */ + public static String getSanitizedDriverVersion() { + return DRIVER_MAJOR_VERSION + "." + DRIVER_MINOR_VERSION; + } + public static int getDriverMajorVersion() { return DRIVER_MAJOR_VERSION; } diff --git a/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/clientanalytics.proto b/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/clientanalytics.proto new file mode 100644 index 000000000000..9db601f014b7 --- /dev/null +++ b/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/clientanalytics.proto @@ -0,0 +1,41 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.jdbc.telemetry.v1; + +option java_multiple_files = true; +option java_package = "com.google.cloud.bigquery.jdbc.telemetry.v1"; +option java_outer_classname = "ClientAnalyticsProto"; + +message LogRequest { + ClientInfo client_info = 1; + int32 log_source = 2; + repeated LogEvent log_events = 3; + int64 request_time_ms = 4; +} + +message ClientInfo { + int32 client_type = 1; +} + +message LogResponse { + int64 next_request_wait_millis = 1; +} + +message LogEvent { + int64 event_time_ms = 1; + bytes source_extension = 6; +} diff --git a/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/telemetry.proto b/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/telemetry.proto new file mode 100644 index 000000000000..e469c6490f98 --- /dev/null +++ b/java-bigquery-jdbc/src/main/proto/google/cloud/bigquery/jdbc/telemetry/v1/telemetry.proto @@ -0,0 +1,196 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.jdbc.telemetry.v1; + +import "google/protobuf/timestamp.proto"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.bigquery.jdbc.telemetry.v1"; +option java_outer_classname = "TelemetryProto"; + +// Aggregated client-side telemetry payload sent to Clearcut analytics backend. +message TelemetryPayload { + DriverEnvironment driver_environment = 1; + google.protobuf.Timestamp event_time = 2; + repeated ConnectionAttempt connection_attempts = 3; + repeated StatementExecution statement_executions = 4; + repeated ErrorMetric errors = 5; + repeated FeatureUsage feature_usages = 6; +} + +// Client runtime and environment attributes. +message DriverEnvironment { + enum OsType { + OS_TYPE_UNSPECIFIED = 0; + OS_TYPE_LINUX = 1; + OS_TYPE_WINDOWS = 2; + OS_TYPE_MACOS = 3; + OS_TYPE_SOLARIS = 4; + OS_TYPE_FREEBSD = 5; + OS_TYPE_OPENBSD = 6; + OS_TYPE_NETBSD = 7; + OS_TYPE_AIX = 8; + OS_TYPE_UNKNOWN = 9; + } + string driver_name = 1; + string driver_version = 2; + string client_language = 3; + string client_language_version = 4; + OsType os_type = 5; + string os_version = 6; + string telemetry_tag = 7; +} + +// Execution status enum for connection attempts and statement executions. +enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_SUCCESS = 1; + STATUS_ERROR = 2; + STATUS_CANCELLED = 3; +} + +// Authentication types utilized during connection creation. +enum AuthenticationType { + AUTHENTICATION_TYPE_UNSPECIFIED = 0; + AUTHENTICATION_TYPE_SERVICE_ACCOUNT = 1; + AUTHENTICATION_TYPE_USER_AUTHENTICATION = 2; + AUTHENTICATION_TYPE_TOKEN = 3; + AUTHENTICATION_TYPE_APPLICATION_DEFAULT_CREDENTIALS = 4; + AUTHENTICATION_TYPE_EXTERNAL = 5; + AUTHENTICATION_TYPE_CUSTOM = 6; +} + +// Aggregated metrics for connection attempts. +message ConnectionAttempt { + Status status = 1; + int32 error_code = 2; + AuthenticationType auth_type = 3; + int64 count = 4; +} + +// High-level classification of statement execution types. +enum StatementType { + STATEMENT_TYPE_UNSPECIFIED = 0; + STATEMENT_TYPE_SELECT = 1; + STATEMENT_TYPE_INSERT = 2; + STATEMENT_TYPE_UPDATE = 3; + STATEMENT_TYPE_DELETE = 4; + STATEMENT_TYPE_CREATE_EXTERNAL_TABLE = 5; + STATEMENT_TYPE_CREATE_FUNCTION = 6; + STATEMENT_TYPE_CREATE_MATERIALIZED_VIEW = 7; + STATEMENT_TYPE_CREATE_MODEL = 8; + STATEMENT_TYPE_CREATE_PROCEDURE = 9; + STATEMENT_TYPE_CREATE_ROW_ACCESS_POLICY = 10; + STATEMENT_TYPE_CREATE_SCHEMA = 11; + STATEMENT_TYPE_CREATE_SEARCH_INDEX = 12; + STATEMENT_TYPE_CREATE_SNAPSHOT_TABLE = 13; + STATEMENT_TYPE_CREATE_TABLE = 14; + STATEMENT_TYPE_CREATE_TABLE_AS_SELECT = 15; + STATEMENT_TYPE_CREATE_TABLE_FUNCTION = 16; + STATEMENT_TYPE_CREATE_VIEW = 17; + STATEMENT_TYPE_DROP_EXTERNAL_TABLE = 18; + STATEMENT_TYPE_DROP_FUNCTION = 19; + STATEMENT_TYPE_DROP_MATERIALIZED_VIEW = 20; + STATEMENT_TYPE_DROP_MODEL = 21; + STATEMENT_TYPE_DROP_PROCEDURE = 22; + STATEMENT_TYPE_DROP_ROW_ACCESS_POLICY = 23; + STATEMENT_TYPE_DROP_SCHEMA = 24; + STATEMENT_TYPE_DROP_SEARCH_INDEX = 25; + STATEMENT_TYPE_DROP_SNAPSHOT_TABLE = 26; + STATEMENT_TYPE_DROP_TABLE = 27; + STATEMENT_TYPE_DROP_TABLE_FUNCTION = 28; + STATEMENT_TYPE_DROP_VIEW = 29; + STATEMENT_TYPE_ALTER_MATERIALIZED_VIEW = 30; + STATEMENT_TYPE_ALTER_SCHEMA = 31; + STATEMENT_TYPE_ALTER_TABLE = 32; + STATEMENT_TYPE_ALTER_VIEW = 33; + STATEMENT_TYPE_CALL = 34; + STATEMENT_TYPE_EXPLAIN = 35; + STATEMENT_TYPE_EXPORT_DATA = 36; + STATEMENT_TYPE_EXPORT_MODEL = 37; + STATEMENT_TYPE_LOAD_DATA = 38; + STATEMENT_TYPE_MERGE = 39; + STATEMENT_TYPE_SCRIPT = 40; + STATEMENT_TYPE_TRUNCATE_TABLE = 41; + STATEMENT_TYPE_OTHER = 42; +} + +// API substrate used during query execution (REST API vs Read API vs Write API vs Jobless Query). +enum QueryApiType { + QUERY_API_TYPE_UNSPECIFIED = 0; + QUERY_API_TYPE_STANDARD_REST_API = 1; + QUERY_API_TYPE_READ_API = 2; + QUERY_API_TYPE_WRITE_API = 3; + QUERY_API_TYPE_JOBLESS_QUERY = 4; +} + +// Aggregated execution metrics for statement executions. +message StatementExecution { + StatementType statement_type = 1; + QueryApiType query_api_type = 2; + Status status = 3; + int32 error_code = 4; + int64 count = 5; + DurationHistogram duration = 6; +} + +// Histogram representation for query duration measurements in milliseconds. +message DurationHistogram { + // Count of items in each bucket. + repeated int64 bucket_counts = 1; + + // Upper bounds for each bucket in milliseconds. + repeated double explicit_bounds = 2; + + // Total count of recorded duration events. + int64 count = 3; + + // Cumulative sum of recorded durations in milliseconds. + double sum = 4; +} + +// Aggregated error counts grouped by error code, SQL state, and method. +message ErrorMetric { + int32 error_code = 1; + int32 error_xdbc_code = 2; + string method_name = 3; + int64 count = 4; + string error_sql_state = 5; +} + +// High-level driver runtime features and capabilities tracked for telemetry. +enum DriverFeature { + DRIVER_FEATURE_UNSPECIFIED = 0; + DRIVER_FEATURE_BATCH_OPERATIONS = 1; + DRIVER_FEATURE_PREPARED_STATEMENT = 2; + DRIVER_FEATURE_CALLABLE_STATEMENT = 3; + DRIVER_FEATURE_AUTOCOMMIT_ENABLED = 4; + DRIVER_FEATURE_AUTOCOMMIT_DISABLED = 5; + DRIVER_FEATURE_TRANSACTIONS = 6; + DRIVER_FEATURE_CONNECTION_POOLING = 7; + DRIVER_FEATURE_STATEMENT_CANCEL = 8; + DRIVER_FEATURE_PARAMETER_BINDING = 9; + DRIVER_FEATURE_METADATA_RETRIEVAL = 10; + DRIVER_FEATURE_CUSTOM = 11; +} + +// Usage metrics for specific features. +message FeatureUsage { + DriverFeature driver_feature = 1; + string custom_feature_name = 2; + int64 count = 3; +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionTest.java index f13ace2f140f..7e051c2275ea 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/exception/BigQueryJdbcExceptionTest.java @@ -40,9 +40,6 @@ static Stream exceptionProvider() { Arguments.of((ExceptionCreator) BigQueryJdbcException::new), Arguments.of((ExceptionCreator) BigQueryJdbcRuntimeException::new), Arguments.of((ExceptionCreator) BigQueryConversionException::new), - Arguments.of( - (ExceptionCreator) - (msg, cause) -> new BigQueryJdbcCoercionException((Exception) cause)), Arguments.of( (ExceptionCreator) (msg, cause) -> @@ -57,9 +54,7 @@ public void testExceptionMessageFormatting(ExceptionCreator creator) { Throwable ex = creator.create(message, cause); - String expectedPrefix = - ex instanceof BigQueryJdbcCoercionException ? "Coercion error" : message; - String expectedMessage = expectedPrefix + "\n" + cause.getMessage(); + String expectedMessage = message + "\n" + cause.getMessage(); assertEquals(expectedMessage, ex.getMessage()); assertEquals(cause, ex.getCause()); diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java index 8acbc5abb8dc..4c4030d3e1f8 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java @@ -18,6 +18,8 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.mock; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryManager; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryTestUtils; import com.google.cloud.bigquery.jdbc.utils.BigQueryJdbcVersionUtility; import io.opentelemetry.api.OpenTelemetry; import java.sql.Connection; @@ -26,6 +28,7 @@ import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -34,6 +37,12 @@ public class BigQueryDriverTest extends BigQueryJdbcLoggingBaseTest { static BigQueryDriver bigQueryDriver; + @BeforeEach + @AfterEach + public void resetTelemetry() { + TelemetryTestUtils.reset(); + } + @BeforeEach public void setUp() { bigQueryDriver = BigQueryDriver.getRegisteredDriver(); @@ -187,4 +196,45 @@ public void testInvalidLogLevelExceptionIsLogged() { && r.getMessage().contains("Failed to parse connection URL properties")); assertThat(foundSevere).isTrue(); } + + @Test + public void testConnect_recordsSuccessfulConnectionTelemetry() throws SQLException { + Connection connection = + bigQueryDriver.connect( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;", + new Properties()); + assertThat(connection).isNotNull(); + assertThat(connection.isClosed()).isFalse(); + // Verify TelemetryManager is initialized and recorded the connection + assertThat(TelemetryManager.isInitialized()).isTrue(); + } + + @Test + public void testConnect_recordsFailedConnectionTelemetry() { + // Malformed URL causing DataSource parsing failure + Assertions.assertThrows( + SQLException.class, + () -> + bigQueryDriver.connect( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=invalid;", + new Properties())); + assertThat(TelemetryManager.isInitialized()).isTrue(); + } + + @Test + public void testConnect_optOut_noTelemetryRecorded() throws SQLException { + Connection connection = + bigQueryDriver.connect( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;EnableDiagnosticTelemetry=0;", + new Properties()); + assertThat(connection).isNotNull(); + // Since opt-out was requested, TelemetryManager should NOT be initialized + assertThat(TelemetryManager.isInitialized()).isFalse(); + } } diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxyTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxyTest.java index eb0e06390b09..711c585d460a 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxyTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcContextProxyTest.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.doReturn; @@ -127,4 +128,16 @@ public void testWrapWithNullContextAndExceptionThrown() throws SQLException { assertEquals("Database error", ex.getMessage()); assertNull(BigQueryJdbcMdc.getConnectionId()); } + + @Test + public void testInvoke_rethrowsCauseUnchangedAfterTelemetry() throws Exception { + Statement failing = mock(Statement.class); + SQLException expected = new SQLException("bad syntax", "42000", 404); + when(failing.execute("SELECT 1")).thenThrow(expected); + Statement proxy = BigQueryJdbcContextProxy.wrap(failing, Statement.class, "conn-1"); + SQLException actual = assertThrows(SQLException.class, () -> proxy.execute("SELECT 1")); + assertSame(expected, actual); + assertEquals("42000", actual.getSQLState()); + assertEquals(404, actual.getErrorCode()); + } } diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java index d580f95bbaed..55d9d4bde62b 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -26,6 +26,7 @@ import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.telemetry.v1.TelemetryPropertyUtility; import java.util.Collections; import java.util.Map; import java.util.Properties; @@ -367,4 +368,27 @@ public void testParseEnableTimestampPicos() { String result2 = BigQueryJdbcUrlUtility.parseUriProperty(url2, "EnableTimestampPicos"); assertThat(result2).isEqualTo("0"); } + + @Test + public void testParseDiagnosticTelemetryProperties() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "EnableDiagnosticTelemetry=0"; + + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(url, "EnableDiagnosticTelemetry")) + .isEqualTo("0"); + + DataSource ds = DataSource.fromUrl(url); + assertThat(ds.getEnableDiagnosticTelemetry()).isFalse(); + + Properties props = ds.createProperties(); + assertThat(props.getProperty("EnableDiagnosticTelemetry")).isEqualTo("false"); + + String urlWithoutTelemetry = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=MyBigQueryProject"; + DataSource defaultDs = DataSource.fromUrl(urlWithoutTelemetry); + assertThat(defaultDs.getEnableDiagnosticTelemetry()) + .isEqualTo(TelemetryPropertyUtility.DEFAULT_ENABLE_DIAGNOSTIC_TELEMETRY_VALUE); + } } diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/BigQueryJdbcPropertyUtilityTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/BigQueryJdbcPropertyUtilityTest.java new file mode 100644 index 000000000000..201092e27a80 --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/BigQueryJdbcPropertyUtilityTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +public class BigQueryJdbcPropertyUtilityTest { + + @Test + public void testConvertStringToBoolean_validValues() { + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("1", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("true", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("True", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("TRUE", false)); + + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("0", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("false", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("False", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("FALSE", true)); + } + + @Test + public void testConvertStringToBoolean_invalidAndNullValues() { + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("2", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("2", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("-1", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("-1", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean("invalid", true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean("invalid", false)); + assertTrue(TelemetryPropertyUtility.convertStringToBoolean(null, true)); + assertFalse(TelemetryPropertyUtility.convertStringToBoolean(null, false)); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransportTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransportTest.java new file mode 100644 index 000000000000..2e958cd7904e --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/ClearcutTransportTest.java @@ -0,0 +1,263 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.http.LowLevelHttpResponse; +import com.google.api.client.testing.http.MockHttpTransport; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClearcutTransportTest { + + @BeforeEach + @AfterEach + public void resetTelemetry() { + TelemetryTestUtils.reset(); + } + + @Test + public void testSendWhenDisabled() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(); + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(false).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertFalse(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(0, requestCount.get()); + } + + @Test + public void testSendNullPayloadFailsSilently() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(); + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(null); + assertFalse(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(0, requestCount.get()); + } + + @Test + public void testSendSuccess() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertTrue(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(1, requestCount.get()); + } + + @Test + public void testSendServerErrorStatusCodeReturnsFalse() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(500); + return response; + } + }; + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertFalse(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(1, requestCount.get()); + } + + @Test + public void testSendClientErrorStatusCodeReturnsFalse() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(400); + return response; + } + }; + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertFalse(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(1, requestCount.get()); + } + + @Test + public void testSendIOExceptionReturnsFalse() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + requestCount.incrementAndGet(); + throw new IOException("Network unreachable"); + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertFalse(result.isSuccess()); + assertEquals(-1, result.getNextRequestWaitMillis()); + assertEquals(1, requestCount.get()); + } + + @Test + public void testSendServerErrorWithNextRequestWaitMillis() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(429); + LogResponse logResponse = + LogResponse.newBuilder().setNextRequestWaitMillis(10).build(); + response.setContent(logResponse.toByteArray()); + return response; + } + }; + } + }; + + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TransportResult result = transport.send(TelemetryPayload.getDefaultInstance()); + assertFalse(result.isSuccess()); + assertEquals(1, requestCount.get()); + assertEquals(10, result.getNextRequestWaitMillis()); + } + + @Test + public void testRecordError_reachesPayload() throws Exception { + AtomicReference captured = new AtomicReference<>(); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + getStreamingContent().writeTo(out); + captured.set(out.toByteArray()); + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setDriverEnvironment( + DriverEnvironment.newBuilder().setDriverName("SimulatedDriver").build()) + .build(); + TelemetryManager.init(config, new ClearcutTransport(mockTransport, config)); + TelemetryManager.recordError(404, "42000", "executeQuery"); + TelemetryManager.getInstance().getBatcher().flush(); + LogRequest request = LogRequest.parseFrom(captured.get()); + TelemetryPayload payload = + TelemetryPayload.parseFrom(request.getLogEvents(0).getSourceExtension()); + assertEquals(1, payload.getErrorsCount()); + assertEquals( + TelemetryConfiguration.DEFAULT_CLIENT_TYPE, request.getClientInfo().getClientType()); + ErrorMetric error = payload.getErrors(0); + assertEquals(404, error.getErrorCode()); + assertEquals("42000", error.getErrorSqlState()); + assertEquals("executeQuery", error.getMethodName()); + assertEquals(1, error.getCount()); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetectorTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetectorTest.java new file mode 100644 index 000000000000..7d20f5d7166f --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/DriverEnvironmentDetectorTest.java @@ -0,0 +1,148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.UUID; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +public class DriverEnvironmentDetectorTest { + + @Test + public void testBuildDriverEnvironment() { + DriverEnvironment env = DriverEnvironmentDetector.build(); + assertNotNull(env); + assertEquals("Google-BigQuery-JDBC-Driver", env.getDriverName()); + assertNotNull(env.getDriverVersion()); + assertEquals("java", env.getClientLanguage()); + assertNotNull(env.getClientLanguageVersion()); + assertNotNull(env.getOsType()); + assertNotNull(env.getOsVersion()); + assertNotNull(env.getTelemetryTag()); + } + + @Test + public void testBuildDriverEnvironmentCustomTagPath(@TempDir Path tempDir) { + Path tagFile = tempDir.resolve("telemetry-tag"); + DriverEnvironment env = DriverEnvironmentDetector.build(tagFile); + assertNotNull(env); + assertEquals("Google-BigQuery-JDBC-Driver", env.getDriverName()); + assertNotNull(env.getDriverVersion()); + assertEquals("java", env.getClientLanguage()); + assertNotNull(env.getClientLanguageVersion()); + assertNotNull(env.getOsType()); + assertNotNull(env.getOsVersion()); + assertEquals(env.getTelemetryTag(), DriverEnvironmentDetector.getOrCreateTelemetryTag(tagFile)); + } + + @Test + public void testGetMajorJavaVersion() { + assertEquals("8", DriverEnvironmentDetector.getMajorJavaVersion("1.8.0_292")); + assertEquals("11", DriverEnvironmentDetector.getMajorJavaVersion("11.0.12")); + assertEquals("17", DriverEnvironmentDetector.getMajorJavaVersion("17.0.1")); + assertEquals("21", DriverEnvironmentDetector.getMajorJavaVersion("21")); + assertEquals("unknown", DriverEnvironmentDetector.getMajorJavaVersion(null)); + assertEquals("unknown", DriverEnvironmentDetector.getMajorJavaVersion(" ")); + } + + @Test + public void testDetectOsType() { + assertEquals( + DriverEnvironment.OsType.OS_TYPE_WINDOWS, + DriverEnvironmentDetector.detectOsType("Windows 11")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_MACOS, DriverEnvironmentDetector.detectOsType("Mac OS X")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_MACOS, DriverEnvironmentDetector.detectOsType("Darwin")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_LINUX, DriverEnvironmentDetector.detectOsType("Linux")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_SOLARIS, + DriverEnvironmentDetector.detectOsType("Solaris")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_FREEBSD, + DriverEnvironmentDetector.detectOsType("FreeBSD")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_OPENBSD, + DriverEnvironmentDetector.detectOsType("OpenBSD")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_NETBSD, DriverEnvironmentDetector.detectOsType("NetBSD")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_AIX, DriverEnvironmentDetector.detectOsType("AIX")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_UNKNOWN, + DriverEnvironmentDetector.detectOsType("UnknownOS")); + assertEquals( + DriverEnvironment.OsType.OS_TYPE_UNKNOWN, DriverEnvironmentDetector.detectOsType(null)); + } + + @Test + public void testGetMajorOsVersion() { + assertEquals("10", DriverEnvironmentDetector.getMajorOsVersion("10.0")); + assertEquals("6", DriverEnvironmentDetector.getMajorOsVersion("6.1.0")); + assertEquals("5", DriverEnvironmentDetector.getMajorOsVersion("5")); + assertEquals("unknown", DriverEnvironmentDetector.getMajorOsVersion(null)); + assertEquals("unknown", DriverEnvironmentDetector.getMajorOsVersion(" ")); + } + + @Test + public void testGetOrCreateTelemetryTag_CreateNew(@TempDir Path tempDir) { + Path tagFile = tempDir.resolve("telemetry-tag"); + String tag = DriverEnvironmentDetector.getOrCreateTelemetryTag(tagFile); + + assertNotNull(tag); + assertTrue(Files.exists(tagFile)); + // Verify it is a valid UUID + assertEquals(tag, UUID.fromString(tag).toString()); + } + + @Test + public void testGetOrCreateTelemetryTag_ReadExisting(@TempDir Path tempDir) throws IOException { + Path tagFile = tempDir.resolve("telemetry-tag"); + String existingUuid = UUID.randomUUID().toString(); + Files.write(tagFile, existingUuid.getBytes(StandardCharsets.UTF_8)); + + String tag = DriverEnvironmentDetector.getOrCreateTelemetryTag(tagFile); + assertEquals(existingUuid, tag); + } + + @Test + public void testGetOrCreateTelemetryTag_RegenerateOnCorruptedFile(@TempDir Path tempDir) + throws IOException { + Path tagFile = tempDir.resolve("telemetry-tag"); + String corruptedContent = "not-a-valid-uuid"; + Files.write(tagFile, corruptedContent.getBytes(StandardCharsets.UTF_8)); + + String newTag = DriverEnvironmentDetector.getOrCreateTelemetryTag(tagFile); + + assertNotNull(newTag); + assertNotEquals(corruptedContent, newTag); + assertEquals(newTag, UUID.fromString(newTag).toString()); + // Verify file on disk was overwritten with new valid UUID + String fileOnDisk = new String(Files.readAllBytes(tagFile), StandardCharsets.UTF_8).trim(); + assertEquals(newTag, fileOnDisk); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcherTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcherTest.java new file mode 100644 index 000000000000..6f6ec1ae31d4 --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryBatcherTest.java @@ -0,0 +1,608 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.http.LowLevelHttpResponse; +import com.google.api.client.testing.http.MockHttpTransport; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import com.google.protobuf.Message; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.ServerSocket; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TelemetryBatcherTest { + + private ScheduledExecutorService executorService; + private DriverEnvironment driverEnvironment; + + @BeforeEach + public void setUp() { + executorService = Executors.newSingleThreadScheduledExecutor(); + driverEnvironment = + DriverEnvironment.newBuilder() + .setDriverName("SimulatedDriver") + .setDriverVersion("1.0.0") + .build(); + } + + @AfterEach + public void tearDown() { + if (executorService != null && !executorService.isShutdown()) { + executorService.shutdownNow(); + } + } + + @Test + public void testOfferAndFlushSuccess() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setDriverEnvironment(driverEnvironment) + .build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + try (TelemetryBatcher batcher = + new TelemetryBatcher(config, transport, executorService, false)) { + + batcher.offer( + ConnectionAttempt.newBuilder() + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .build()); + batcher.offer( + StatementExecution.newBuilder() + .setStatementType(StatementType.STATEMENT_TYPE_SELECT) + .setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(), + 150); + batcher.offer( + ErrorMetric.newBuilder() + .setErrorCode(1) + .setErrorSqlState("HY000") + .setMethodName("executeQuery") + .build()); + batcher.offer( + FeatureUsage.newBuilder() + .setDriverFeature(DriverFeature.DRIVER_FEATURE_CUSTOM) + .setCustomFeatureName("MyFeature") + .build()); + + TransportResult result = batcher.flush(); + assertTrue(result.isSuccess()); + assertEquals(1, requestCount.get()); + + // Secondary flush should be empty + TransportResult result2 = batcher.flush(); + assertFalse(result2.isSuccess()); // empty flush returns disabled or unsuccess + assertEquals(1, requestCount.get()); // no new request sent + } + } + + @Test + public void testFlushFailureRequeuesEvents() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(500); // simulate failure + return response; + } + }; + } + }; + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setDriverEnvironment(driverEnvironment) + .build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + try (TelemetryBatcher batcher = + new TelemetryBatcher(config, transport, executorService, false)) { + + batcher.offer( + ConnectionAttempt.newBuilder() + .setStatus(Status.STATUS_ERROR) + .setErrorCode(0) + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .build()); + + TransportResult result = batcher.flush(); + assertFalse(result.isSuccess()); + assertEquals(1, requestCount.get()); + + // Because it failed, the connection attempt should be merged back into the active map. + // We can verify this by flushing again with a working transport (we can't change transport + // mid-flight here, + // but we can verify it attempts another request). + TransportResult result2 = batcher.flush(); + assertEquals(2, requestCount.get()); + } + } + + @Test + public void testCloseFlushesAndShutsDown() { + AtomicInteger requestCount = new AtomicInteger(0); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setDriverEnvironment(driverEnvironment) + .build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + TelemetryBatcher batcher = new TelemetryBatcher(config, transport); + batcher.offer( + ConnectionAttempt.newBuilder() + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .build()); + + batcher.close(); + assertEquals(1, requestCount.get()); + + // Should not accept new events after close + batcher.offer( + ConnectionAttempt.newBuilder() + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .build()); + batcher.flush(); + // Flush should return disabled and not send a request + assertEquals(1, requestCount.get()); + } + + @Test + public void testTelemetryKeyFactoryAndEquality() { + StatementExecution stmt1 = + StatementExecution.newBuilder() + .setStatementType(StatementType.STATEMENT_TYPE_SELECT) + .setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + StatementExecution stmt2 = + StatementExecution.newBuilder() + .setStatementType(StatementType.STATEMENT_TYPE_SELECT) + .setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + StatementExecution stmtDiff = + StatementExecution.newBuilder() + .setStatementType(StatementType.STATEMENT_TYPE_INSERT) + .setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + + ConnectionAttempt conn1 = + ConnectionAttempt.newBuilder() + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + ConnectionAttempt conn2 = + ConnectionAttempt.newBuilder() + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + + TelemetryBatcher.TelemetryKey keyStmt1 = TelemetryBatcher.TelemetryKey.from(stmt1); + TelemetryBatcher.TelemetryKey keyStmt2 = TelemetryBatcher.TelemetryKey.from(stmt2); + TelemetryBatcher.TelemetryKey keyStmtDiff = TelemetryBatcher.TelemetryKey.from(stmtDiff); + TelemetryBatcher.TelemetryKey keyConn1 = TelemetryBatcher.TelemetryKey.from(conn1); + TelemetryBatcher.TelemetryKey keyConn2 = TelemetryBatcher.TelemetryKey.from(conn2); + + assertEquals(keyStmt1, keyStmt2); + assertEquals(keyStmt1.hashCode(), keyStmt2.hashCode()); + assertNotEquals(keyStmt1, keyStmtDiff); + assertNotEquals(keyStmt1, keyConn1); + assertNotEquals(keyStmt1, null); + assertNotEquals(keyStmt1, new Object()); + assertEquals(keyConn1, keyConn2); + assertEquals(keyConn1.hashCode(), keyConn2.hashCode()); + + assertTrue(keyStmt1.createAccumulator() instanceof TelemetryBatcher.StatementAccumulator); + assertTrue(keyConn1.createAccumulator() instanceof TelemetryBatcher.ConnectionAccumulator); + + assertThrows( + IllegalArgumentException.class, + () -> TelemetryBatcher.TelemetryKey.from(DurationHistogram.getDefaultInstance())); + } + + @Test + public void testTelemetryAccumulatorWithMultipleProtos() { + // 1. Setup keys & accumulators from multiple distinct proto types + StatementExecution stmtProto = + StatementExecution.newBuilder() + .setStatementType(StatementType.STATEMENT_TYPE_SELECT) + .setQueryApiType(QueryApiType.QUERY_API_TYPE_STANDARD_REST_API) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + ConnectionAttempt connProto = + ConnectionAttempt.newBuilder() + .setAuthType(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT) + .setStatus(Status.STATUS_SUCCESS) + .setErrorCode(0) + .build(); + ErrorMetric errorProto = + ErrorMetric.newBuilder() + .setErrorCode(101) + .setErrorSqlState("42000") + .setMethodName("executeQuery") + .build(); + FeatureUsage featureProto = + FeatureUsage.newBuilder() + .setDriverFeature(DriverFeature.DRIVER_FEATURE_CUSTOM) + .setCustomFeatureName("CustomFeature") + .build(); + + TelemetryBatcher.TelemetryAccumulator stmtAcc1 = + TelemetryBatcher.TelemetryKey.from(stmtProto).createAccumulator(); + stmtAcc1.accumulate(90); + + TelemetryBatcher.TelemetryAccumulator stmtAcc2 = + TelemetryBatcher.TelemetryKey.from(stmtProto).createAccumulator(); + stmtAcc2.accumulate(250); + + TelemetryBatcher.TelemetryAccumulator connAcc1 = + TelemetryBatcher.TelemetryKey.from(connProto).createAccumulator(); + connAcc1.accumulate(0); + + TelemetryBatcher.TelemetryAccumulator connAcc2 = + TelemetryBatcher.TelemetryKey.from(connProto).createAccumulator(); + connAcc2.accumulate(0); + connAcc2.accumulate(0); + + TelemetryBatcher.TelemetryAccumulator errorAcc1 = + TelemetryBatcher.TelemetryKey.from(errorProto).createAccumulator(); + errorAcc1.accumulate(0); + + TelemetryBatcher.TelemetryAccumulator errorAcc2 = + TelemetryBatcher.TelemetryKey.from(errorProto).createAccumulator(); + errorAcc2.accumulate(0); + + TelemetryBatcher.TelemetryAccumulator featureAcc = + TelemetryBatcher.TelemetryKey.from(featureProto).createAccumulator(); + featureAcc.accumulate(0); + + // 2. Test merge behavior across accumulators + stmtAcc1.merge(stmtAcc2); + connAcc1.merge(connAcc2); + errorAcc1.merge(errorAcc2); + + // 3. Test polymorphic addToPayload into a single payload builder + TelemetryPayload.Builder payloadBuilder = TelemetryPayload.newBuilder(); + java.util.List accumulators = + java.util.Arrays.asList(stmtAcc1, connAcc1, errorAcc1, featureAcc); + for (TelemetryBatcher.TelemetryAccumulator acc : accumulators) { + acc.addToPayload(payloadBuilder); + } + + // 4. Verify each metric type in the resulting payload + assertEquals(1, payloadBuilder.getStatementExecutionsCount()); + StatementExecution exec = payloadBuilder.getStatementExecutions(0); + assertEquals(StatementType.STATEMENT_TYPE_SELECT, exec.getStatementType()); + assertEquals(2, exec.getCount()); + assertEquals(340, exec.getDuration().getSum()); + assertEquals(2, exec.getDuration().getCount()); + assertEquals(1, exec.getDuration().getBucketCounts(1)); + assertEquals(1, exec.getDuration().getBucketCounts(3)); + + assertEquals(1, payloadBuilder.getConnectionAttemptsCount()); + ConnectionAttempt conn = payloadBuilder.getConnectionAttempts(0); + assertEquals(AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT, conn.getAuthType()); + assertEquals(Status.STATUS_SUCCESS, conn.getStatus()); + assertEquals(3, conn.getCount()); + + assertEquals(1, payloadBuilder.getErrorsCount()); + ErrorMetric err = payloadBuilder.getErrors(0); + assertEquals("42000", err.getErrorSqlState()); + assertEquals("executeQuery", err.getMethodName()); + assertEquals(2, err.getCount()); + + assertEquals(1, payloadBuilder.getFeatureUsagesCount()); + FeatureUsage feat = payloadBuilder.getFeatureUsages(0); + assertEquals(DriverFeature.DRIVER_FEATURE_CUSTOM, feat.getDriverFeature()); + assertEquals("CustomFeature", feat.getCustomFeatureName()); + assertEquals(1, feat.getCount()); + } + + @Test + public void testCalculateBucket() { + int index1 = TelemetryBatcher.StatementAccumulator.calculateBucket(5); // < 50, index 0 + assertEquals(0, index1); + + int index2 = TelemetryBatcher.StatementAccumulator.calculateBucket(150); // < 250, index 2 + assertEquals(2, index2); + + int index3 = TelemetryBatcher.StatementAccumulator.calculateBucket(20000); // < 30000, index 9 + assertEquals(9, index3); + + int index4 = + TelemetryBatcher.StatementAccumulator.calculateBucket( + 4000000); // Overflow > 3600000 (1 hr), index 17 + assertEquals(17, index4); + } + + @Test + public void testOffer_flushesWhenQueueSizeThresholdReached() throws Exception { + AtomicInteger requestCount = new AtomicInteger(0); + CountDownLatch flushed = new CountDownLatch(1); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + flushed.countDown(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setBatchSizeThreshold(3) + .setDriverEnvironment(driverEnvironment) + .build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + try (TelemetryBatcher batcher = + new TelemetryBatcher(config, transport, executorService, false)) { + // Three DISTINCT keys, so the queue reaches the threshold. + batcher.offer(featureNamed("a")); + batcher.offer(featureNamed("b")); + batcher.offer(featureNamed("c")); + + assertTrue(flushed.await(5, TimeUnit.SECONDS)); + assertEquals(1, requestCount.get()); + } + } + + @Test + public void testOffer_repeatedIdenticalMetricDoesNotFlush() throws Exception { + AtomicInteger requestCount = new AtomicInteger(0); + CountDownLatch flushed = new CountDownLatch(1); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + requestCount.incrementAndGet(); + flushed.countDown(); + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + response.setStatusCode(200); + return response; + } + }; + } + }; + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setBatchSizeThreshold(3) + .setDriverEnvironment(driverEnvironment) + .build(); + ClearcutTransport transport = new ClearcutTransport(mockTransport, config); + + try (TelemetryBatcher batcher = + new TelemetryBatcher(config, transport, executorService, false)) { + // 50 events, but ONE key, so the queue never grows past 1. + for (int i = 0; i < 50; i++) { + batcher.offer(featureNamed("same")); + } + + // Assert inside the try block: close() flushes and would send a request. + assertFalse(flushed.await(500, TimeUnit.MILLISECONDS)); + assertEquals(0, requestCount.get()); + } + } + + @Test + public void testComputeProfileCap_staysAboveThreshold() { + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder().setEnabled(true).setBatchSizeThreshold(10).build(); + assertEquals(20, TelemetryBatcher.computeProfileCap(config)); + + // Degenerate inputs fall back rather than producing a cap at or below the threshold. + assertEquals(3000, TelemetryBatcher.computeProfileCap(null)); + TelemetryConfiguration zero = + TelemetryConfiguration.newBuilder().setEnabled(true).setBatchSizeThreshold(0).build(); + assertEquals(3000, TelemetryBatcher.computeProfileCap(zero)); + + // No overflow to a negative cap. + TelemetryConfiguration huge = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setBatchSizeThreshold(Integer.MAX_VALUE) + .build(); + assertTrue(TelemetryBatcher.computeProfileCap(huge) > 0); + } + + @Test + public void testClose_doesNotWaitForUnresponsiveEndpoint() throws IOException { + try (ServerSocket unresponsive = new ServerSocket(0); ) { + TelemetryConfiguration configuration = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setEndpointUrl("http://127.0.0.1:" + unresponsive.getLocalPort()) + .setDriverEnvironment(driverEnvironment) + .build(); + TelemetryBatcher batcher = + new TelemetryBatcher( + configuration, new ClearcutTransport(configuration), executorService, true); + batcher.offer(featureNamed("testFeature")); + + long start = System.currentTimeMillis(); + batcher.close(); + long end = System.currentTimeMillis(); + long elapsedMs = end - start; + + assertTrue(elapsedMs < 5000, "close took " + elapsedMs + " ms"); + assertTrue(executorService.isShutdown()); + } + } + + @Test + public void testFailedFlush_requeueRespectsProfileCap() throws Exception { + AtomicReference batcherRef = new AtomicReference<>(); + AtomicInteger requestCount = new AtomicInteger(); + AtomicReference retriedBody = new AtomicReference<>(); + MockHttpTransport mockTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + return new MockLowLevelHttpRequest(url) { + @Override + public LowLevelHttpResponse execute() throws IOException { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + if (requestCount.incrementAndGet() == 1) { + // While the first send is in flight, fill the live map up to the cap (4). + TelemetryBatcher batcher = batcherRef.get(); + batcher.offer(featureNamed("a")); + batcher.offer(featureNamed("x")); + batcher.offer(featureNamed("y")); + batcher.offer(featureNamed("z")); + response.setStatusCode(500); + return response; + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + getStreamingContent().writeTo(out); + retriedBody.set(out.toByteArray()); + response.setStatusCode(200); + return response; + } + }; + } + }; + // Threshold 2 gives a profile cap of 4. + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(true) + .setBatchSizeThreshold(2) + .setDriverEnvironment(driverEnvironment) + .build(); + + // No executor: flushes run on the test thread, so the ordering is deterministic. + try (TelemetryBatcher batcher = + new TelemetryBatcher(config, new ClearcutTransport(mockTransport, config), null, false)) { + batcherRef.set(batcher); + batcher.offer(featureNamed("a")); + batcher.offer(featureNamed("b")); + batcher.offer(featureNamed("c")); + + assertFalse(batcher.flush().isSuccess()); + assertTrue(batcher.flush().isSuccess()); + } + + TelemetryPayload payload = + TelemetryPayload.parseFrom( + LogRequest.parseFrom(retriedBody.get()).getLogEvents(0).getSourceExtension()); + Map counts = + payload.getFeatureUsagesList().stream() + .collect( + Collectors.toMap(FeatureUsage::getCustomFeatureName, f -> (long) f.getCount())); + + assertEquals(4, counts.size()); + assertEquals(2L, counts.get("a")); // existing key: the failed count is merged in + assertFalse(counts.containsKey("b")); // new keys are dropped once the live map is at the cap + assertFalse(counts.containsKey("c")); + } + + private static Message featureNamed(String name) { + return FeatureUsage.newBuilder() + .setDriverFeature(DriverFeature.DRIVER_FEATURE_CUSTOM) + .setCustomFeatureName(name) + .build(); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfigurationTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfigurationTest.java new file mode 100644 index 000000000000..2293afc815c7 --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryConfigurationTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +public class TelemetryConfigurationTest { + + @Test + public void testDefaultValues() { + TelemetryConfiguration config = TelemetryConfiguration.newBuilder().build(); + + assertTrue(config.isEnabled()); + assertEquals(3071, config.getLogSource()); + assertEquals("https://play.googleapis.com/log", config.getEndpointUrl()); + assertEquals(300_000L, config.getUploadIntervalMs()); + assertEquals(5000, config.getBatchSizeThreshold()); + assertNull(config.getDriverEnvironment()); + } + + @Test + public void testCustomValues() { + DriverEnvironment environment = + DriverEnvironment.newBuilder() + .setDriverName("BigQuery JDBC") + .setDriverVersion("1.0.0") + .build(); + + TelemetryConfiguration config = + TelemetryConfiguration.newBuilder() + .setEnabled(false) + .setLogSource(1234) + .setEndpointUrl("https://custom.endpoint.com/log") + .setUploadIntervalMs(60_000L) + .setBatchSizeThreshold(50) + .setDriverEnvironment(environment) + .build(); + + assertFalse(config.isEnabled()); + assertEquals(1234, config.getLogSource()); + assertEquals("https://custom.endpoint.com/log", config.getEndpointUrl()); + assertEquals(60_000L, config.getUploadIntervalMs()); + assertEquals(50, config.getBatchSizeThreshold()); + assertEquals(environment, config.getDriverEnvironment()); + } + + @Test + public void testEqualsAndHashCode() { + TelemetryConfiguration config1 = + TelemetryConfiguration.newBuilder().setEnabled(true).setLogSource(1234).build(); + + TelemetryConfiguration config2 = + TelemetryConfiguration.newBuilder().setEnabled(true).setLogSource(1234).build(); + + TelemetryConfiguration config3 = + TelemetryConfiguration.newBuilder().setEnabled(false).setLogSource(1234).build(); + + assertEquals(config1, config2); + assertEquals(config1.hashCode(), config2.hashCode()); + assertNotEquals(config1, config3); + assertNotEquals(config1, null); + assertNotEquals(config1, "string"); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManagerTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManagerTest.java new file mode 100644 index 000000000000..2754821edd7e --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryManagerTest.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import java.sql.SQLException; +import java.util.Properties; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TelemetryManagerTest { + + @BeforeEach + @AfterEach + public void cleanUp() { + TelemetryTestUtils.reset(); + } + + @Test + public void testGetInstance_returnsSameSingletonInstance() { + TelemetryManager manager1 = TelemetryManager.getInstance(); + TelemetryManager manager2 = TelemetryManager.getInstance(); + + assertNotNull(manager1); + assertSame(manager1, manager2); + assertTrue(TelemetryManager.isInitialized()); + assertNotNull(manager1.getBatcher()); + } + + @Test + public void testInit_withDisabledConfig_doesNotInitializeInstance() { + TelemetryConfiguration config = TelemetryConfiguration.builder().setEnabled(false).build(); + ClearcutTransport transport = new ClearcutTransport(config); + + TelemetryManager.init(config, transport); + + assertFalse(TelemetryManager.isInitialized()); + } + + @Test + public void testInit_withEnabledConfig_initializesCustomInstance() { + TelemetryConfiguration config = TelemetryConfiguration.builder().setEnabled(true).build(); + ClearcutTransport transport = new ClearcutTransport(config); + + TelemetryManager.init(config, transport); + + assertTrue(TelemetryManager.isInitialized()); + assertNotNull(TelemetryManager.getInstance().getBatcher()); + } + + @Test + public void testCloseInstance_resetsSingletonState() { + TelemetryManager.getInstance(); + assertTrue(TelemetryManager.isInitialized()); + + TelemetryManager.closeInstance(); + assertFalse(TelemetryManager.isInitialized()); + } + + @Test + public void testRunSafely_executesRunnableSuccessfully() { + AtomicBoolean executed = new AtomicBoolean(false); + + TelemetryManager.runSafely(() -> executed.set(true)); + + assertTrue(executed.get()); + } + + @Test + public void testRunSafely_swallowsExceptionsWithoutThrowing() { + AtomicBoolean lineAfterException = new AtomicBoolean(false); + + TelemetryManager.runSafely( + () -> { + throw new RuntimeException("Simulated telemetry exception"); + }); + lineAfterException.set(true); + + assertTrue(lineAfterException.get()); + } + + @Test + public void testRunSafely_handlesNullActionGracefully() { + TelemetryManager.runSafely(null); + // Verifies no NullPointerException is thrown + } + + @Test + public void testToStatementType() { + assertEquals( + StatementType.STATEMENT_TYPE_SELECT, + TelemetryManager.toStatementType(QueryStatistics.StatementType.SELECT)); + assertEquals( + StatementType.STATEMENT_TYPE_INSERT, + TelemetryManager.toStatementType(QueryStatistics.StatementType.INSERT)); + assertEquals( + StatementType.STATEMENT_TYPE_UPDATE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.UPDATE)); + assertEquals( + StatementType.STATEMENT_TYPE_DELETE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.DELETE)); + assertEquals( + StatementType.STATEMENT_TYPE_MERGE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.MERGE)); + assertEquals( + StatementType.STATEMENT_TYPE_CREATE_TABLE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.CREATE_TABLE)); + assertEquals( + StatementType.STATEMENT_TYPE_CREATE_MODEL, + TelemetryManager.toStatementType(QueryStatistics.StatementType.CREATE_MODEL)); + assertEquals( + StatementType.STATEMENT_TYPE_CREATE_VIEW, + TelemetryManager.toStatementType(QueryStatistics.StatementType.CREATE_VIEW)); + assertEquals( + StatementType.STATEMENT_TYPE_DROP_TABLE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.DROP_TABLE)); + assertEquals( + StatementType.STATEMENT_TYPE_DROP_VIEW, + TelemetryManager.toStatementType(QueryStatistics.StatementType.DROP_VIEW)); + assertEquals( + StatementType.STATEMENT_TYPE_ALTER_TABLE, + TelemetryManager.toStatementType(QueryStatistics.StatementType.ALTER_TABLE)); + assertEquals( + StatementType.STATEMENT_TYPE_ALTER_VIEW, + TelemetryManager.toStatementType(QueryStatistics.StatementType.ALTER_VIEW)); + assertEquals( + StatementType.STATEMENT_TYPE_SCRIPT, + TelemetryManager.toStatementType(QueryStatistics.StatementType.SCRIPT)); + + assertEquals(StatementType.STATEMENT_TYPE_UNSPECIFIED, TelemetryManager.toStatementType(null)); + } + + @Test + public void testToAuthenticationType() { + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_SERVICE_ACCOUNT, + TelemetryManager.toAuthenticationType(0)); + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_USER_AUTHENTICATION, + TelemetryManager.toAuthenticationType(1)); + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_TOKEN, TelemetryManager.toAuthenticationType(2)); + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_APPLICATION_DEFAULT_CREDENTIALS, + TelemetryManager.toAuthenticationType(3)); + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_EXTERNAL, TelemetryManager.toAuthenticationType(4)); + + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_CUSTOM, TelemetryManager.toAuthenticationType(5)); + assertEquals( + AuthenticationType.AUTHENTICATION_TYPE_CUSTOM, TelemetryManager.toAuthenticationType(100)); + } + + @Test + public void testOptOutConfiguration() { + Properties props = new Properties(); + + // Default is true + assertTrue(TelemetryConfiguration.builder().resolveProperties(props).build().isEnabled()); + + // Disabled via lowercase + props.setProperty("EnableDiagnosticTelemetry", "false"); + assertFalse(TelemetryConfiguration.builder().resolveProperties(props).build().isEnabled()); + + // Disabled via uppercase and "0" + props.clear(); + props.setProperty("EnableDiagnosticTelemetry", "0"); + assertFalse(TelemetryConfiguration.builder().resolveProperties(props).build().isEnabled()); + + // Enabled via "1" + props.clear(); + props.setProperty("EnableDiagnosticTelemetry", "1"); + assertTrue(TelemetryConfiguration.builder().resolveProperties(props).build().isEnabled()); + } + + @Test + public void testGlobalKillSwitch() { + // Turn it on + Properties props1 = new Properties(); + props1.setProperty("EnableDiagnosticTelemetry", "1"); + TelemetryManager mgr1 = TelemetryManager.getInstance(props1); + assertNotNull(mgr1); + + // Any connection passes '0', it gets permanently killed + Properties props2 = new Properties(); + props2.setProperty("EnableDiagnosticTelemetry", "0"); + TelemetryManager mgr2 = TelemetryManager.getInstance(props2); + + // The manager should be null and killed globally + assertNull(mgr2); + assertNull(TelemetryManager.getInstance()); + assertNull(TelemetryManager.getInstance(props1)); + } + + @Test + public void testGetInstance_populatesDriverEnvironment() { + TelemetryManager manager = TelemetryManager.getInstance(); + + DriverEnvironment environment = manager.getBatcher().getConfig().getDriverEnvironment(); + assertNotNull(environment); + assertEquals(DriverEnvironmentDetector.DRIVER_NAME, environment.getDriverName()); + assertEquals(DriverEnvironmentDetector.CLIENT_LANGUAGE, environment.getClientLanguage()); + assertFalse(environment.getTelemetryTag().isEmpty()); + } + + @Test + public void testExtractSqlState() { + assertEquals( + "42000", TelemetryManager.extractSqlState(new SQLException("bad syntax", "42000"))); + assertEquals("HY000", TelemetryManager.extractSqlState(new SQLException("general", "HY000"))); + } + + @Test + public void testExtractSqlState_walksCauseChain() { + SQLException root = new SQLException("overflow", "22003"); + Throwable wrapped = new RuntimeException(new IllegalStateException(root)); + assertEquals("22003", TelemetryManager.extractSqlState(wrapped)); + } + + @Test + public void testExtractXdbcCode_noSqlStateReturnsEmptyString() { + assertEquals("", TelemetryManager.extractSqlState(null)); + assertEquals("", TelemetryManager.extractSqlState(new RuntimeException("no state"))); + assertEquals("", TelemetryManager.extractSqlState(new SQLException("none", (String) null))); + } +} diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryTestUtils.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryTestUtils.java new file mode 100644 index 000000000000..871f03568020 --- /dev/null +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/telemetry/v1/TelemetryTestUtils.java @@ -0,0 +1,28 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.telemetry.v1; + +/** Test-only access to {@link TelemetryManager}'s package-private lifecycle state. */ +public final class TelemetryTestUtils { + private TelemetryTestUtils() {} + + /** Closes the shared instance and clears the global opt-out kill switch. */ + public static void reset() { + TelemetryManager.closeInstance(); + TelemetryManager.resetGlobalDisableForTest(); + } +} From f97709e0c1494c4a39aab1559cc76634dd91e45d Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Tue, 20 Oct 2026 14:40:48 -0400 Subject: [PATCH 05/35] chore(storage): disable flaky tests in ITAppendableUploadTest (#14676) Disable flaky `ITAppendableUploadTest.appendableUpload_bytes` and `ITAppendableUploadTest.explicitFlush`. b/574588650 Co-authored-by: Dhriti07 <56169283+Dhriti07@users.noreply.github.com> --- .../java/com/google/cloud/storage/ITAppendableUploadTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java index c5e9b605857f..e83cbccefdcf 100644 --- a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java +++ b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java @@ -53,6 +53,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -102,6 +103,7 @@ public void appendableUpload_emptyObject() assertThat(xxd(actualBytes)).isEqualTo(xxd(new byte[0])); } + @Ignore("Flaky test: b/574588650") @Test public void appendableUpload_bytes() throws IOException, ExecutionException, InterruptedException, TimeoutException { @@ -134,6 +136,7 @@ public void appendableUpload_bytes() assertThat(xxd(actualBytes)).isEqualTo(xxd(a1_a2.getBytes())); } + @Ignore("Flaky test: b/574588650") @Test public void explicitFlush() throws IOException, ExecutionException, InterruptedException, TimeoutException { From 049681fbdd32ef5ada1e36a16d0d7a0bc8d8fddb Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 20 Oct 2026 19:24:49 +0000 Subject: [PATCH 06/35] test(gax): simplify ScheduledRetryingExecutorTest and document test helpers Use FakeApiClock and RecordingScheduler in ScheduledRetryingExecutorTest for deterministic, sleep-free retry tests without modifying existing asynchronous in-flight test methods. Refactor RecordingScheduler to extend ScheduledThreadPoolExecutor directly, eliminating Mockito dependencies and strict-stubbing friction. Add Javadoc documentation for FakeApiClock and RecordingScheduler. Fixes #13535 --- .../com/google/api/gax/core/FakeApiClock.java | 17 +++ .../api/gax/core/RecordingScheduler.java | 117 +++++++++--------- .../ScheduledRetryingExecutorTest.java | 33 ++++- 3 files changed, 103 insertions(+), 64 deletions(-) diff --git a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/FakeApiClock.java b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/FakeApiClock.java index 087fbf1ec3a5..fed37ba6d8f3 100644 --- a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/FakeApiClock.java +++ b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/FakeApiClock.java @@ -33,9 +33,21 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; +/** + * A thread-safe fake {@link ApiClock} implementation for unit tests whose time only advances when + * {@link #incrementNanoTime(long)} is explicitly called. + * + *

Use this clock in retry and polling tests to decouple timeout and backoff calculations from + * real wall-clock time on the test runner. + */ public class FakeApiClock implements ApiClock { private final AtomicLong currentNanoTime; + /** + * Creates a fake clock initialized to the given nanosecond timestamp. + * + * @param initialNanoTime the starting value for {@link #nanoTime()} + */ public FakeApiClock(long initialNanoTime) { currentNanoTime = new AtomicLong(initialNanoTime); } @@ -50,6 +62,11 @@ public long millisTime() { return TimeUnit.MILLISECONDS.convert(nanoTime(), TimeUnit.NANOSECONDS); } + /** + * Advances the clock's current time by {@code delta} nanoseconds. + * + * @param delta the number of nanoseconds to add to the current time + */ public void incrementNanoTime(long delta) { currentNanoTime.getAndAdd(delta); } diff --git a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java index fddab80dcbd5..b2e0bf09c805 100644 --- a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java +++ b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java @@ -29,11 +29,7 @@ */ package com.google.api.gax.core; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; @@ -41,67 +37,68 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -public abstract class RecordingScheduler implements ScheduledExecutorService { - - public abstract List getSleepDurations(); - public abstract int getIterationsCount(); - - public static RecordingScheduler create(final FakeApiClock clock) { - RecordingScheduler mock = - mock(RecordingScheduler.class, Mockito.withSettings().withoutAnnotations()); +/** + * A test {@link ScheduledExecutorService} that records scheduled delays and advances a {@link + * FakeApiClock} instead of sleeping in real time. + * + *

When {@link #schedule(Runnable, long, TimeUnit)} is called, this scheduler records the + * requested delay, increments the {@link FakeApiClock} by that delay, and immediately submits the + * task with zero delay to the underlying single-threaded executor. This allows multi-attempt retry + * and polling tests to execute without real-time backoff sleeps while still exercising simulated + * elapsed time calculations and preserving asynchronous callback ordering on {@code + * CallbackChainRetryingFuture}. + */ +public class RecordingScheduler extends ScheduledThreadPoolExecutor { + /** + * A single worker thread executes zero-delay scheduled tasks sequentially in FIFO order. Running + * tasks asynchronously on a dedicated worker thread avoids lock-inversion and reentrant race + * conditions when registering attempt futures in CallbackChainRetryingFuture. + */ + private static final int CORE_POOL_SIZE = 1; - // mock class fields: - final ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); - final List sleepDurations = new ArrayList<>(); - final AtomicInteger iterationsCount = new AtomicInteger(0); + private final FakeApiClock clock; + private final List sleepDurations = new ArrayList<>(); + private final AtomicInteger iterationsCount = new AtomicInteger(0); - // mock class methods: - // ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit); - when(mock.schedule(any(Runnable.class), anyLong(), any(TimeUnit.class))) - .then( - new Answer>() { - @Override - public ScheduledFuture answer(InvocationOnMock invocation) throws Throwable { - Object[] args = invocation.getArguments(); - Runnable runnable = (Runnable) args[0]; - Long delay = (Long) args[1]; - TimeUnit unit = (TimeUnit) args[2]; - iterationsCount.incrementAndGet(); - sleepDurations.add( - java.time.Duration.ofMillis(TimeUnit.MILLISECONDS.convert(delay, unit))); - clock.incrementNanoTime(TimeUnit.NANOSECONDS.convert(delay, unit)); - return executor.schedule(runnable, 0, TimeUnit.NANOSECONDS); - } - }); + private RecordingScheduler(FakeApiClock clock) { + super(CORE_POOL_SIZE); + this.clock = clock; + } - // List shutdownNow() - when(mock.shutdownNow()) - .then( - new Answer>() { - @Override - public List answer(InvocationOnMock invocation) throws Throwable { - return executor.shutdownNow(); - } - }); + /** + * Creates a new {@link RecordingScheduler} bound to the given {@link FakeApiClock}. + * + * @param clock the fake clock to advance whenever a delayed task is scheduled + */ + public static RecordingScheduler create(FakeApiClock clock) { + return new RecordingScheduler(clock); + } - // List getSleepDurations() - when(mock.getSleepDurations()).thenReturn(sleepDurations); + /** + * Schedules a task by recording the requested delay, advancing the {@link FakeApiClock} by that + * duration, and immediately submitting the task with zero delay to the worker thread. + * + *

Advancing the fake clock simulates the passage of backoff time deterministically without + * sleeping in real time. Submitting with zero delay to the worker thread preserves asynchronous + * execution so that attempt registration in {@code CallbackChainRetryingFuture} completes + * cleanly before the scheduled attempt runs. + */ + @Override + public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { + iterationsCount.incrementAndGet(); + sleepDurations.add(Duration.ofMillis(TimeUnit.MILLISECONDS.convert(delay, unit))); + clock.incrementNanoTime(TimeUnit.NANOSECONDS.convert(delay, unit)); + return super.schedule(command, 0, TimeUnit.NANOSECONDS); + } - // int getIterationsCount() - when(mock.getIterationsCount()) - .then( - new Answer() { - @Override - public Integer answer(InvocationOnMock invocation) throws Throwable { - return iterationsCount.get(); - } - }); + /** Returns the retry or poll delays passed to {@link #schedule(Runnable, long, TimeUnit)}. */ + public List getSleepDurations() { + return sleepDurations; + } - return mock; + /** Returns the total number of tasks scheduled via {@link #schedule(Runnable, long, TimeUnit)}. */ + public int getIterationsCount() { + return iterationsCount.get(); } } diff --git a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java index 89b807bd5610..12d81f3675b5 100644 --- a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java +++ b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java @@ -38,8 +38,10 @@ import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.api.core.ApiClock; import com.google.api.core.ApiFuture; -import com.google.api.core.NanoClock; +import com.google.api.gax.core.FakeApiClock; +import com.google.api.gax.core.RecordingScheduler; import com.google.api.gax.retrying.FailingCallable.CustomException; import com.google.api.gax.rpc.testing.FakeCallContext; import java.time.Duration; @@ -51,6 +53,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -58,10 +62,31 @@ class ScheduledRetryingExecutorTest extends AbstractRetryingExecutorTest { // Number of test runs, essential for multithreaded tests. private static final int EXECUTIONS_COUNT = 5; + private FakeApiClock fakeClock; + private RecordingScheduler recordingScheduler; + + @BeforeEach + void setUp() { + // ExponentialRetryAlgorithm and ExponentialPollAlgorithm only compute relative elapsed time + // deltas against firstAttemptStartTimeNanos (clock.nanoTime() - firstAttemptStartTimeNanos) + // and never treat 0L as a special sentinel value. + fakeClock = new FakeApiClock(0L); + recordingScheduler = RecordingScheduler.create(fakeClock); + } + + @AfterEach + void tearDown() { + recordingScheduler.shutdownNow(); + } + + @Override + protected ApiClock getClock() { + return fakeClock; + } @Override protected RetryingExecutorWithContext getExecutor(RetryAlgorithm retryAlgorithm) { - return getRetryingExecutor(retryAlgorithm, scheduledExecutorService); + return getRetryingExecutor(retryAlgorithm, recordingScheduler); } @Override @@ -69,7 +94,7 @@ protected RetryAlgorithm getAlgorithm( RetrySettings retrySettings, int apocalypseCountDown, RuntimeException apocalypseException) { return new RetryAlgorithm<>( new TestResultRetryAlgorithm(apocalypseCountDown, apocalypseException), - new ExponentialRetryAlgorithm(retrySettings, NanoClock.getDefaultClock())); + new ExponentialRetryAlgorithm(retrySettings, fakeClock)); } private RetryingExecutorWithContext getRetryingExecutor( @@ -145,7 +170,7 @@ void testSuccessWithFailuresGetAttempt() throws Exception { FailingCallable callable = new FailingCallable(15, "request", "SUCCESS", tracer); RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), scheduledExecutorService); + getRetryingExecutor(getAlgorithm(retrySettings, 0, null), recordingScheduler); RetryingFuture future = executor.createFuture( callable, From d339c4179517df5e35bc33dd823a38b6ed367bce Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Wed, 21 Oct 2026 07:14:18 -0700 Subject: [PATCH 07/35] fix(bigquery-jdbc): limit Storage Read API Arrow batch queue to 32 batches (#14709) --- .../bigquery/jdbc/BigQueryStatement.java | 7 ++++- .../bigquery/jdbc/BigQueryStatementTest.java | 29 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index af50bf8b8df3..0654d6036f0f 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -104,6 +104,7 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); public static final int DEFAULT_BUFFER_SIZE = BigQuerySettings.DEFAULT_NUM_BUFFERED_ROWS * 2; + static final int DEFAULT_ARROW_BUFFER_SIZE = 32; private static final String DEFAULT_DATASET_NAME = "_google_jdbc"; private static final String DEFAULT_TABLE_NAME = "temp_table_"; private static final String JDBC_JOB_PREFIX = "google-jdbc-"; @@ -931,7 +932,7 @@ ResultSet processArrowResultSet(TableResult results, Job job) throws SQLExceptio .setMaxStreamCount(1); ReadSession readSession = getReadSession(builder.build()); - this.arrowBatchWrapperBlockingQueue = new LinkedBlockingDeque<>(getBufferSize()); + this.arrowBatchWrapperBlockingQueue = new LinkedBlockingDeque<>(getArrowBufferSize()); // deserialize and populate the buffer async, so that the client isn't blocked populateBufferWorker = populateArrowBufferedQueue( @@ -1512,6 +1513,10 @@ private int getBufferSize() { : Math.min(this.querySettings.getNumBufferedRows() * 2, 100000)); } + int getArrowBufferSize() { + return DEFAULT_ARROW_BUFFER_SIZE; + } + /** Returns the destinationTable from jobId by calling `jobs.get` API */ TableId getDestinationTable(JobId jobId) { Job job = this.bigQuery.getJob(jobId); diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java index 9245f627c147..a442efd61ed4 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java @@ -1318,4 +1318,33 @@ public void testJoblessQueryPopulatesQueryStatistics() throws Exception { verify(bigquery, Mockito.never()).getJob(any(JobId.class)); } + + @Test + public void testProcessArrowResultSetUsesBoundedQueueCapacity() throws SQLException { + BigQueryStatement defaultStmtSpy = Mockito.spy(bigQueryStatement); + BigQueryReadClient bigQueryReadClient = mock(BigQueryReadClient.class); + Schema schema = Schema.of(fieldList); + ReadSession readSession = ReadSession.getDefaultInstance(); + doReturn(bigQueryReadClient).when(defaultStmtSpy).getBigQueryReadClient(); + doReturn(readSession).when(defaultStmtSpy).getReadSession(any(CreateReadSessionRequest.class)); + Future mockWorker = mock(Future.class); + @SuppressWarnings("unchecked") + ArgumentCaptor> defaultQueueCaptor = + ArgumentCaptor.forClass(BlockingQueue.class); + doReturn(mockWorker) + .when(defaultStmtSpy) + .populateArrowBufferedQueue( + any(ReadSession.class), defaultQueueCaptor.capture(), any(BigQueryReadClient.class)); + doReturn(arrowSchema).when(defaultStmtSpy).getArrowSchema(any(ReadSession.class)); + + TableResult result = mock(TableResult.class); + doReturn(schema).when(result).getSchema(); + doReturn(10L).when(result).getTotalRows(); + doReturn(TABLE_ID).when(defaultStmtSpy).getDestinationTable(any()); + + defaultStmtSpy.processArrowResultSet(result, null); + assertEquals( + BigQueryStatement.DEFAULT_ARROW_BUFFER_SIZE, + defaultQueueCaptor.getValue().remainingCapacity()); + } } From ee79a4a39159d968e52b4890b0389f42fce78f4d Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Wed, 21 Oct 2026 09:54:45 -0700 Subject: [PATCH 08/35] chore: update googleapis commitish to 14a161a (#14717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated googleapis commitish in librarian.yaml to https://github.com/googleapis/googleapis/commit/14a161a98ef045be80c12ab69d924504a756f109 💡 **Note:** If this PR is still open when the daily update workflow runs next, it will be closed and replaced with a new PR containing the latest updates. --- .../reflect-config.json | 126 + .../cloud/dialogflow/v2/AudioConfigProto.java | 56 +- .../dialogflow/v2/AutomatedAgentReply.java | 1462 +++- .../v2/AutomatedAgentReplyOrBuilder.java | 184 + .../BidiStreamingAnalyzeContentRequest.java | 191 + .../v2/HumanAgentAssistantConfig.java | 14 +- .../cloud/dialogflow/v2/InputAudioConfig.java | 159 + .../v2/InputAudioConfigOrBuilder.java | 32 + .../google/cloud/dialogflow/v2/Message.java | 681 +- .../cloud/dialogflow/v2/MessageOrBuilder.java | 66 + .../cloud/dialogflow/v2/ParticipantProto.java | 614 +- .../cloud/dialogflow/v2/ResponseMessage.java | 7520 +++++++++++++++++ .../v2/ResponseMessageOrBuilder.java | 273 + .../v2/SentimentAnalysisResult.java | 291 + .../v2/SentimentAnalysisResultOrBuilder.java | 43 + .../cloud/dialogflow/v2/SessionProto.java | 335 +- .../dialogflow/v2/SpeechToTextConfig.java | 426 +- .../v2/SpeechToTextConfigOrBuilder.java | 32 + .../dialogflow/v2/SummarizationSection.java | 14 +- .../cloud/dialogflow/v2/audio_config.proto | 15 +- .../dialogflow/v2/conversation_profile.proto | 7 +- .../cloud/dialogflow/v2/generator.proto | 7 +- .../cloud/dialogflow/v2/participant.proto | 134 + .../google/cloud/dialogflow/v2/session.proto | 5 + .../cloud/modelarmor/v1/ModelArmorClient.java | 40 +- .../reflect-config.json | 63 + .../v1/ModelArmorClientHttpJsonTest.java | 5 + .../modelarmor/v1/ModelArmorClientTest.java | 3 + .../cloud/modelarmor/v1/ByteDataItem.java | 196 + .../modelarmor/v1/ByteDataItemOrBuilder.java | 28 + .../modelarmor/v1/FilterVersionAlias.java | 259 + .../modelarmor/v1/FilterVersionConfig.java | 2008 +++++ .../v1/FilterVersionConfigOrBuilder.java | 257 + .../modelarmor/v1/FilterVersionSelector.java | 995 +++ .../v1/FilterVersionSelectorOrBuilder.java | 126 + .../cloud/modelarmor/v1/FloorSetting.java | 342 + .../modelarmor/v1/FloorSettingOrBuilder.java | 44 + .../modelarmor/v1/McpServerFloorSetting.java | 874 ++ .../v1/McpServerFloorSettingOrBuilder.java | 99 + .../v1/MultiLanguageDetectionMetadata.java | 98 +- ...ltiLanguageDetectionMetadataOrBuilder.java | 28 +- .../modelarmor/v1/SanitizationResult.java | 398 +- .../v1/SanitizationResultOrBuilder.java | 10 +- .../google/cloud/modelarmor/v1/Template.java | 610 +- .../cloud/modelarmor/v1/V1mainProto.java | 551 +- .../google/cloud/modelarmor/v1/service.proto | 138 +- .../reflect-config.json | 18 + .../reflect-config.json | 18 + .../v1/InstanceAdminClientHttpJsonTest.java | 7 + .../instance/v1/InstanceAdminClientTest.java | 5 + .../admin/instance/v1/InstanceConfig.java | 4710 +++++++---- .../instance/v1/InstanceConfigOrBuilder.java | 121 + .../admin/instance/v1/InstancePartition.java | 26 +- .../v1/InstancePartitionOrBuilder.java | 8 +- .../v1/SpannerInstanceAdminProto.java | 360 +- .../instance/v1/spanner_instance_admin.proto | 29 + librarian.yaml | 4 +- 57 files changed, 22370 insertions(+), 2795 deletions(-) create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessage.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessageOrBuilder.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionAlias.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfig.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfigOrBuilder.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelector.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelectorOrBuilder.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSetting.java create mode 100644 java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSettingOrBuilder.java diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/resources/META-INF/native-image/com.google.cloud.dialogflow.v2/reflect-config.json b/java-dialogflow/google-cloud-dialogflow/src/main/resources/META-INF/native-image/com.google.cloud.dialogflow.v2/reflect-config.json index 7078612f4fb8..97c77e432a0e 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/resources/META-INF/native-image/com.google.cloud.dialogflow.v2/reflect-config.json +++ b/java-dialogflow/google-cloud-dialogflow/src/main/resources/META-INF/native-image/com.google.cloud.dialogflow.v2/reflect-config.json @@ -7253,6 +7253,132 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$EndInteraction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$EndInteraction$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$LiveAgentHandoff", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$LiveAgentHandoff$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$MixedAudio", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$MixedAudio$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$MixedAudio$Segment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$MixedAudio$Segment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$TelephonyTransferCall", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$TelephonyTransferCall$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$Text", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.dialogflow.v2.ResponseMessage$Text$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.dialogflow.v2.RestoreAgentRequest", "queryAllDeclaredConstructors": true, diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java index 0e2923af1360..d9282ba2d829 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java @@ -102,7 +102,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\014start_offset\030\001 \001(\0132\031.google.protobuf.Duration\022-\n\n" + "end_offset\030\002 \001(\0132\031.google.protobuf.Duration\022\022\n" + "\n" - + "confidence\030\004 \001(\002\"\374\005\n" + + "confidence\030\004 \001(\002\"\330\006\n" + "\020InputAudioConfig\022G\n" + "\016audio_encoding\030\001" + " \001(\0162).google.cloud.dialogflow.v2.AudioEncodingB\004\342A\001\002\022\037\n" @@ -125,8 +125,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "!opt_out_conformer_model_migration\030\032 \001(\010\022_\n" + "\021gemini_asr_config\030\036 \001(\0132>.google.cloud.dial" + "ogflow.v2.SpeechToTextConfig.GeminiAsrConfigB\004\342A\001\001\022!\n" - + "\016use_gemini_asr\030\037 \001(\010B\004\342A\001\001H\000\210\001\001B\021\n" - + "\017_use_gemini_asr\"r\n" + + "\016use_gemini_asr\030\037 \001(\010B\004\342A\001\001H\000\210\001\001\0224\n" + + "!disable_interim_input_transcripts\030 " + + " \001(\010B\004\342A\001\001H\001\210\001\001B\021\n" + + "\017_use_gemini_asrB$\n" + + "\"_disable_interim_input_transcripts\"r\n" + "\024VoiceSelectionParams\022\022\n" + "\004name\030\001 \001(\tB\004\342A\001\001\022F\n" + "\013ssml_gender\030\002" @@ -136,14 +139,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005pitch\030\002 \001(\001B\004\342A\001\001\022\034\n" + "\016volume_gain_db\030\003 \001(\001B\004\342A\001\001\022 \n" + "\022effects_profile_id\030\005 \003(\tB\004\342A\001\001\022E\n" - + "\005voice\030\004" - + " \001(\01320.google.cloud.dialogflow.v2.VoiceSelectionParamsB\004\342A\001\001\022S\n" - + "\016pronunciations\030\006 \003(\01325.google.cloud.dialogfl" - + "ow.v2.CustomPronunciationParamsB\004\342A\001\001\"\226\002\n" + + "\005voice\030\004 \001(\01320.google.cl" + + "oud.dialogflow.v2.VoiceSelectionParamsB\004\342A\001\001\022S\n" + + "\016pronunciations\030\006 \003(\01325.google.cl" + + "oud.dialogflow.v2.CustomPronunciationParamsB\004\342A\001\001\"\226\002\n" + "\031CustomPronunciationParams\022\016\n" + "\006phrase\030\001 \001(\t\022a\n" - + "\021phonetic_encoding\030\002 \001(\0162F.google." - + "cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\022\025\n\r" + + "\021phonetic_encoding\030\002 \001" + + "(\0162F.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\022\025\n\r" + "pronunciation\030\003 \001(\t\"o\n" + "\020PhoneticEncoding\022!\n" + "\035PHONETIC_ENCODING_UNSPECIFIED\020\000\022\031\n" @@ -153,14 +156,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\016audio_encoding\030\001" + " \001(\0162/.google.cloud.dialogflow.v2.OutputAudioEncodingB\004\342A\001\002\022\031\n" + "\021sample_rate_hertz\030\002 \001(\005\022T\n" - + "\030synthesize_speech_config\030\003 \001(\013" - + "22.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n" + + "\030synthesize_speech_config\030\003" + + " \001(\01322.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n" + "\023TelephonyDtmfEvents\022>\n" + "\013dtmf_events\030\001" - + " \003(\0162).google.cloud.dialogflow.v2.TelephonyDtmf\"\231\010\n" + + " \003(\0162).google.cloud.dialogflow.v2.TelephonyDtmf\"\335\010\n" + "\022SpeechToTextConfig\022L\n" - + "\024speech_model_variant\030\001 \001(\0162..googl" - + "e.cloud.dialogflow.v2.SpeechModelVariant\022\r\n" + + "\024speech_model_variant\030\001" + + " \001(\0162..google.cloud.dialogflow.v2.SpeechModelVariant\022\r\n" + "\005model\030\002 \001(\t\0229\n" + "\013phrase_sets\030\004 \003(\tB$\372A!\n" + "\037speech.googleapis.com/PhraseSet\022A\n" @@ -170,17 +173,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "language_code\030\010 \001(\t\022\030\n" + "\020enable_word_info\030\t \001(\010\022%\n" + "\035use_timeout_based_endpointing\030\013 \001(\010\022_\n" - + "\021gemini_asr_config\030\017 " - + "\001(\0132>.google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfigB\004\342A\001\001\022\034\n" - + "\016use_gemini_asr\030\020 \001(\010B\004\342A\001\001\032\265\004\n" - + "\017GeminiAsrConfig\022\026\n" - + "\010model_id\030\001 \001(\tB\004\342A\001\001\022!\n" + + "\021gemini_asr_config\030\017 \001(\0132>.google.cloud.dialogflo" + + "w.v2.SpeechToTextConfig.GeminiAsrConfigB\004\342A\001\001\022\034\n" + + "\016use_gemini_asr\030\020 \001(\010B\004\342A\001\001\0224\n" + + "!disable_interim_input_transcripts\030\021" + + " \001(\010B\004\342A\001\001H\000\210\001\001\032\235\004\n" + + "\017GeminiAsrConfig\022!\n" + "\023silence_duration_ms\030\002 \001(\005B\004\342A\001\001\022\037\n" + "\021prefix_padding_ms\030\003 \001(\005B\004\342A\001\001\022z\n" - + "\033start_of_speech_sensitivity\030\004 \001(\0162O.google.cloud.dialogflow.v" - + "2.SpeechToTextConfig.GeminiAsrConfig.StartSensitivityB\004\342A\001\001\022v\n" - + "\031end_of_speech_sensitivity\030\005 \001(\0162M.google.cloud.dialogflow" - + ".v2.SpeechToTextConfig.GeminiAsrConfig.EndSensitivityB\004\342A\001\001\"l\n" + + "\033start_of_speech_sensitivity\030\004 \001(\0162O.google.cloud.dialogflow" + + ".v2.SpeechToTextConfig.GeminiAsrConfig.StartSensitivityB\004\342A\001\001\022v\n" + + "\031end_of_speech_sensitivity\030\005 \001(\0162M.google.cloud.dialogfl" + + "ow.v2.SpeechToTextConfig.GeminiAsrConfig.EndSensitivityB\004\342A\001\001\"l\n" + "\020StartSensitivity\022!\n" + "\035START_SENSITIVITY_UNSPECIFIED\020\000\022\032\n" + "\026START_SENSITIVITY_HIGH\020\001\022\031\n" @@ -188,7 +192,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\016EndSensitivity\022\037\n" + "\033END_SENSITIVITY_UNSPECIFIED\020\000\022\030\n" + "\024END_SENSITIVITY_HIGH\020\001\022\027\n" - + "\023END_SENSITIVITY_LOW\020\002*\224\002\n\r" + + "\023END_SENSITIVITY_LOW\020\002B$\n" + + "\"_disable_interim_input_transcripts*\224\002\n\r" + "TelephonyDtmf\022\036\n" + "\032TELEPHONY_DTMF_UNSPECIFIED\020\000\022\014\n" + "\010DTMF_ONE\020\001\022\014\n" @@ -291,6 +296,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "OptOutConformerModelMigration", "GeminiAsrConfig", "UseGeminiAsr", + "DisableInterimInputTranscripts", }); internal_static_google_cloud_dialogflow_v2_VoiceSelectionParams_descriptor = getDescriptor().getMessageType(3); @@ -353,6 +359,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UseTimeoutBasedEndpointing", "GeminiAsrConfig", "UseGeminiAsr", + "DisableInterimInputTranscripts", }); internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_GeminiAsrConfig_descriptor = internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_descriptor.getNestedType(0); @@ -360,7 +367,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_GeminiAsrConfig_descriptor, new java.lang.String[] { - "ModelId", "SilenceDurationMs", "PrefixPaddingMs", "StartOfSpeechSensitivity", diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReply.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReply.java index ae89c3576045..ddc0502b7380 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReply.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReply.java @@ -52,8 +52,12 @@ private AutomatedAgentReply(com.google.protobuf.GeneratedMessage.Builder buil } private AutomatedAgentReply() { + responseMessages_ = java.util.Collections.emptyList(); + intent_ = ""; + event_ = ""; automatedAgentReplyType_ = 0; cxCurrentPage_ = ""; + callCompanionAuthCode_ = com.google.protobuf.ByteString.EMPTY; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -310,6 +314,270 @@ public com.google.cloud.dialogflow.v2.DetectIntentResponse getDetectIntentRespon : detectIntentResponse_; } + public static final int RESPONSE_MESSAGES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List responseMessages_; + + /** + * + * + *

+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + @java.lang.Override + public java.util.List getResponseMessagesList() { + return responseMessages_; + } + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + @java.lang.Override + public java.util.List + getResponseMessagesOrBuilderList() { + return responseMessages_; + } + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + @java.lang.Override + public int getResponseMessagesCount() { + return responseMessages_.size(); + } + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index) { + return responseMessages_.get(index); + } + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder( + int index) { + return responseMessages_.get(index); + } + + public static final int INTENT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object intent_ = ""; + + /** + * + * + *
+   * Name of the intent if an intent is matched for the query.
+   * For a V2 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agent/intents/<Intent ID>`.
+   * For a V3 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+   * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + @java.lang.Override + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intent_ = s; + return s; + } + } + + /** + * + * + *
+   * Name of the intent if an intent is matched for the query.
+   * For a V2 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agent/intents/<Intent ID>`.
+   * For a V3 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+   * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object event_ = ""; + + /** + * + * + *
+   * Event name if an event is triggered for the query.
+   * 
+ * + * string event = 5; + * + * @return The event. + */ + @java.lang.Override + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } + } + + /** + * + * + *
+   * Event name if an event is triggered for the query.
+   * 
+ * + * string event = 5; + * + * @return The bytes for event. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATCH_CONFIDENCE_FIELD_NUMBER = 9; + private float matchConfidence_ = 0F; + + /** + * + * + *
+   * The confidence of the match. Values range from 0.0 (completely uncertain)
+   * to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to help match
+   * the best intent within the classification threshold. This value may change
+   * for the same end-user expression at any time due to a model retraining or
+   * change in implementation.
+   * 
+ * + * float match_confidence = 9; + * + * @return The matchConfidence. + */ + @java.lang.Override + public float getMatchConfidence() { + return matchConfidence_; + } + + public static final int PARAMETERS_FIELD_NUMBER = 10; + private com.google.protobuf.Struct parameters_; + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return Whether the parameters field is set. + */ + @java.lang.Override + public boolean hasParameters() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return The parameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getParameters() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + public static final int AUTOMATED_AGENT_REPLY_TYPE_FIELD_NUMBER = 7; private int automatedAgentReplyType_ = 0; @@ -433,6 +701,26 @@ public com.google.protobuf.ByteString getCxCurrentPageBytes() { } } + public static final int CALL_COMPANION_AUTH_CODE_FIELD_NUMBER = 12; + private com.google.protobuf.ByteString callCompanionAuthCode_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The auth code for accessing Call Companion UI.
+   * 
+ * + * bytes call_companion_auth_code = 12; + * + * @return The callCompanionAuthCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCallCompanionAuthCode() { + return callCompanionAuthCode_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -450,6 +738,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getDetectIntentResponse()); } + for (int i = 0; i < responseMessages_.size(); i++) { + output.writeMessage(3, responseMessages_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(intent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, intent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(event_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, event_); + } if (automatedAgentReplyType_ != com.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType .AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED @@ -459,9 +756,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (allowCancellation_ != false) { output.writeBool(8, allowCancellation_); } + if (java.lang.Float.floatToRawIntBits(matchConfidence_) != 0) { + output.writeFloat(9, matchConfidence_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getParameters()); + } if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cxCurrentPage_)) { com.google.protobuf.GeneratedMessage.writeString(output, 11, cxCurrentPage_); } + if (!callCompanionAuthCode_.isEmpty()) { + output.writeBytes(12, callCompanionAuthCode_); + } getUnknownFields().writeTo(output); } @@ -475,6 +781,15 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDetectIntentResponse()); } + for (int i = 0; i < responseMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, responseMessages_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(intent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, intent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(event_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, event_); + } if (automatedAgentReplyType_ != com.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType .AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED @@ -484,9 +799,18 @@ public int getSerializedSize() { if (allowCancellation_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, allowCancellation_); } + if (java.lang.Float.floatToRawIntBits(matchConfidence_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, matchConfidence_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getParameters()); + } if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cxCurrentPage_)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(11, cxCurrentPage_); } + if (!callCompanionAuthCode_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(12, callCompanionAuthCode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -507,9 +831,19 @@ public boolean equals(final java.lang.Object obj) { if (hasDetectIntentResponse()) { if (!getDetectIntentResponse().equals(other.getDetectIntentResponse())) return false; } + if (!getResponseMessagesList().equals(other.getResponseMessagesList())) return false; + if (!getIntent().equals(other.getIntent())) return false; + if (!getEvent().equals(other.getEvent())) return false; + if (java.lang.Float.floatToIntBits(getMatchConfidence()) + != java.lang.Float.floatToIntBits(other.getMatchConfidence())) return false; + if (hasParameters() != other.hasParameters()) return false; + if (hasParameters()) { + if (!getParameters().equals(other.getParameters())) return false; + } if (automatedAgentReplyType_ != other.automatedAgentReplyType_) return false; if (getAllowCancellation() != other.getAllowCancellation()) return false; if (!getCxCurrentPage().equals(other.getCxCurrentPage())) return false; + if (!getCallCompanionAuthCode().equals(other.getCallCompanionAuthCode())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -525,12 +859,28 @@ public int hashCode() { hash = (37 * hash) + DETECT_INTENT_RESPONSE_FIELD_NUMBER; hash = (53 * hash) + getDetectIntentResponse().hashCode(); } + if (getResponseMessagesCount() > 0) { + hash = (37 * hash) + RESPONSE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getResponseMessagesList().hashCode(); + } + hash = (37 * hash) + INTENT_FIELD_NUMBER; + hash = (53 * hash) + getIntent().hashCode(); + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + hash = (37 * hash) + MATCH_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMatchConfidence()); + if (hasParameters()) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParameters().hashCode(); + } hash = (37 * hash) + AUTOMATED_AGENT_REPLY_TYPE_FIELD_NUMBER; hash = (53 * hash) + automatedAgentReplyType_; hash = (37 * hash) + ALLOW_CANCELLATION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCancellation()); hash = (37 * hash) + CX_CURRENT_PAGE_FIELD_NUMBER; hash = (53 * hash) + getCxCurrentPage().hashCode(); + hash = (37 * hash) + CALL_COMPANION_AUTH_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCallCompanionAuthCode().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -673,6 +1023,8 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { internalGetDetectIntentResponseFieldBuilder(); + internalGetResponseMessagesFieldBuilder(); + internalGetParametersFieldBuilder(); } } @@ -685,9 +1037,25 @@ public Builder clear() { detectIntentResponseBuilder_.dispose(); detectIntentResponseBuilder_ = null; } + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + } else { + responseMessages_ = null; + responseMessagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + intent_ = ""; + event_ = ""; + matchConfidence_ = 0F; + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } automatedAgentReplyType_ = 0; allowCancellation_ = false; cxCurrentPage_ = ""; + callCompanionAuthCode_ = com.google.protobuf.ByteString.EMPTY; return this; } @@ -715,6 +1083,7 @@ public com.google.cloud.dialogflow.v2.AutomatedAgentReply build() { public com.google.cloud.dialogflow.v2.AutomatedAgentReply buildPartial() { com.google.cloud.dialogflow.v2.AutomatedAgentReply result = new com.google.cloud.dialogflow.v2.AutomatedAgentReply(this); + buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } @@ -722,6 +1091,19 @@ public com.google.cloud.dialogflow.v2.AutomatedAgentReply buildPartial() { return result; } + private void buildPartialRepeatedFields( + com.google.cloud.dialogflow.v2.AutomatedAgentReply result) { + if (responseMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + responseMessages_ = java.util.Collections.unmodifiableList(responseMessages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.responseMessages_ = responseMessages_; + } else { + result.responseMessages_ = responseMessagesBuilder_.build(); + } + } + private void buildPartial0(com.google.cloud.dialogflow.v2.AutomatedAgentReply result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; @@ -732,15 +1114,31 @@ private void buildPartial0(com.google.cloud.dialogflow.v2.AutomatedAgentReply re : detectIntentResponseBuilder_.build(); to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000002) != 0)) { + if (((from_bitField0_ & 0x00000004) != 0)) { + result.intent_ = intent_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.event_ = event_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.matchConfidence_ = matchConfidence_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.parameters_ = parametersBuilder_ == null ? parameters_ : parametersBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { result.automatedAgentReplyType_ = automatedAgentReplyType_; } - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.allowCancellation_ = allowCancellation_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.cxCurrentPage_ = cxCurrentPage_; } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.callCompanionAuthCode_ = callCompanionAuthCode_; + } result.bitField0_ |= to_bitField0_; } @@ -760,6 +1158,49 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.AutomatedAgentReply othe if (other.hasDetectIntentResponse()) { mergeDetectIntentResponse(other.getDetectIntentResponse()); } + if (responseMessagesBuilder_ == null) { + if (!other.responseMessages_.isEmpty()) { + if (responseMessages_.isEmpty()) { + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResponseMessagesIsMutable(); + responseMessages_.addAll(other.responseMessages_); + } + onChanged(); + } + } else { + if (!other.responseMessages_.isEmpty()) { + if (responseMessagesBuilder_.isEmpty()) { + responseMessagesBuilder_.dispose(); + responseMessagesBuilder_ = null; + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + responseMessagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResponseMessagesFieldBuilder() + : null; + } else { + responseMessagesBuilder_.addAllMessages(other.responseMessages_); + } + } + } + if (!other.getIntent().isEmpty()) { + intent_ = other.intent_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getEvent().isEmpty()) { + event_ = other.event_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (java.lang.Float.floatToRawIntBits(other.getMatchConfidence()) != 0) { + setMatchConfidence(other.getMatchConfidence()); + } + if (other.hasParameters()) { + mergeParameters(other.getParameters()); + } if (other.automatedAgentReplyType_ != 0) { setAutomatedAgentReplyTypeValue(other.getAutomatedAgentReplyTypeValue()); } @@ -768,9 +1209,12 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.AutomatedAgentReply othe } if (!other.getCxCurrentPage().isEmpty()) { cxCurrentPage_ = other.cxCurrentPage_; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000100; onChanged(); } + if (!other.getCallCompanionAuthCode().isEmpty()) { + setCallCompanionAuthCode(other.getCallCompanionAuthCode()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -804,24 +1248,68 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 26: + { + com.google.cloud.dialogflow.v2.ResponseMessage m = + input.readMessage( + com.google.cloud.dialogflow.v2.ResponseMessage.parser(), extensionRegistry); + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(m); + } else { + responseMessagesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + intent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + event_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 case 56: { automatedAgentReplyType_ = input.readEnum(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000040; break; } // case 56 case 64: { allowCancellation_ = input.readBool(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000080; break; } // case 64 + case 77: + { + matchConfidence_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } // case 77 + case 82: + { + input.readMessage( + internalGetParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 82 case 90: { cxCurrentPage_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000100; break; } // case 90 + case 98: + { + callCompanionAuthCode_ = input.readBytes(); + bitField0_ |= 0x00000200; + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1059,9 +1547,890 @@ public Builder clearDetectIntentResponse() { return detectIntentResponseBuilder_; } - private int automatedAgentReplyType_ = 0; + private java.util.List responseMessages_ = + java.util.Collections.emptyList(); - /** + private void ensureResponseMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + responseMessages_ = + new java.util.ArrayList( + responseMessages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder> + responseMessagesBuilder_; + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public java.util.List + getResponseMessagesList() { + if (responseMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responseMessages_); + } else { + return responseMessagesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public int getResponseMessagesCount() { + if (responseMessagesBuilder_ == null) { + return responseMessages_.size(); + } else { + return responseMessagesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, value); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder addResponseMessages(com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder addResponseMessages( + com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder addAllResponseMessages( + java.lang.Iterable values) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responseMessages_); + onChanged(); + } else { + responseMessagesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder clearResponseMessages() { + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + responseMessagesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public Builder removeResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.remove(index); + onChanged(); + } else { + responseMessagesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder getResponseMessagesBuilder( + int index) { + return internalGetResponseMessagesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder( + int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public java.util.List + getResponseMessagesOrBuilderList() { + if (responseMessagesBuilder_ != null) { + return responseMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responseMessages_); + } + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder addResponseMessagesBuilder() { + return internalGetResponseMessagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance()); + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder addResponseMessagesBuilder( + int index) { + return internalGetResponseMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance()); + } + + /** + * + * + *
+     * Response messages from the automated agent.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + public java.util.List + getResponseMessagesBuilderList() { + return internalGetResponseMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder> + internalGetResponseMessagesFieldBuilder() { + if (responseMessagesBuilder_ == null) { + responseMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder>( + responseMessages_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + responseMessages_ = null; + } + return responseMessagesBuilder_; + } + + private java.lang.Object intent_ = ""; + + /** + * + * + *
+     * Name of the intent if an intent is matched for the query.
+     * For a V2 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agent/intents/<Intent ID>`.
+     * For a V3 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + public java.lang.String getIntent() { + java.lang.Object ref = intent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Name of the intent if an intent is matched for the query.
+     * For a V2 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agent/intents/<Intent ID>`.
+     * For a V3 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + public com.google.protobuf.ByteString getIntentBytes() { + java.lang.Object ref = intent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Name of the intent if an intent is matched for the query.
+     * For a V2 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agent/intents/<Intent ID>`.
+     * For a V3 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The intent to set. + * @return This builder for chaining. + */ + public Builder setIntent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + intent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the intent if an intent is matched for the query.
+     * For a V2 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agent/intents/<Intent ID>`.
+     * For a V3 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearIntent() { + intent_ = getDefaultInstance().getIntent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the intent if an intent is matched for the query.
+     * For a V2 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agent/intents/<Intent ID>`.
+     * For a V3 query, the value format is `projects/<Project ID>/locations/
+     * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+     * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for intent to set. + * @return This builder for chaining. + */ + public Builder setIntentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + intent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object event_ = ""; + + /** + * + * + *
+     * Event name if an event is triggered for the query.
+     * 
+ * + * string event = 5; + * + * @return The event. + */ + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Event name if an event is triggered for the query.
+     * 
+ * + * string event = 5; + * + * @return The bytes for event. + */ + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Event name if an event is triggered for the query.
+     * 
+ * + * string event = 5; + * + * @param value The event to set. + * @return This builder for chaining. + */ + public Builder setEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Event name if an event is triggered for the query.
+     * 
+ * + * string event = 5; + * + * @return This builder for chaining. + */ + public Builder clearEvent() { + event_ = getDefaultInstance().getEvent(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Event name if an event is triggered for the query.
+     * 
+ * + * string event = 5; + * + * @param value The bytes for event to set. + * @return This builder for chaining. + */ + public Builder setEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + event_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private float matchConfidence_; + + /** + * + * + *
+     * The confidence of the match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float match_confidence = 9; + * + * @return The matchConfidence. + */ + @java.lang.Override + public float getMatchConfidence() { + return matchConfidence_; + } + + /** + * + * + *
+     * The confidence of the match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float match_confidence = 9; + * + * @param value The matchConfidence to set. + * @return This builder for chaining. + */ + public Builder setMatchConfidence(float value) { + + matchConfidence_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The confidence of the match. Values range from 0.0 (completely uncertain)
+     * to 1.0 (completely certain).
+     * This value is for informational purpose only and is only used to help match
+     * the best intent within the classification threshold. This value may change
+     * for the same end-user expression at any time due to a model retraining or
+     * change in implementation.
+     * 
+ * + * float match_confidence = 9; + * + * @return This builder for chaining. + */ + public Builder clearMatchConfidence() { + bitField0_ = (bitField0_ & ~0x00000010); + matchConfidence_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Struct parameters_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + parametersBuilder_; + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return Whether the parameters field is set. + */ + public boolean hasParameters() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return The parameters. + */ + public com.google.protobuf.Struct getParameters() { + if (parametersBuilder_ == null) { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } else { + return parametersBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public Builder setParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + parameters_ = value; + } else { + parametersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (parametersBuilder_ == null) { + parameters_ = builderForValue.build(); + } else { + parametersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public Builder mergeParameters(com.google.protobuf.Struct value) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && parameters_ != null + && parameters_ != com.google.protobuf.Struct.getDefaultInstance()) { + getParametersBuilder().mergeFrom(value); + } else { + parameters_ = value; + } + } else { + parametersBuilder_.mergeFrom(value); + } + if (parameters_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public Builder clearParameters() { + bitField0_ = (bitField0_ & ~0x00000020); + parameters_ = null; + if (parametersBuilder_ != null) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public com.google.protobuf.Struct.Builder getParametersBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetParametersFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + public com.google.protobuf.StructOrBuilder getParametersOrBuilder() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilder(); + } else { + return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_; + } + } + + /** + * + * + *
+     * The collection of current parameters at the time of this response.
+     * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getParameters(), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private int automatedAgentReplyType_ = 0; + + /** * * *
@@ -1095,7 +2464,7 @@ public int getAutomatedAgentReplyTypeValue() {
      */
     public Builder setAutomatedAgentReplyTypeValue(int value) {
       automatedAgentReplyType_ = value;
-      bitField0_ |= 0x00000002;
+      bitField0_ |= 0x00000040;
       onChanged();
       return this;
     }
@@ -1143,7 +2512,7 @@ public Builder setAutomatedAgentReplyType(
       if (value == null) {
         throw new NullPointerException();
       }
-      bitField0_ |= 0x00000002;
+      bitField0_ |= 0x00000040;
       automatedAgentReplyType_ = value.getNumber();
       onChanged();
       return this;
@@ -1163,7 +2532,7 @@ public Builder setAutomatedAgentReplyType(
      * @return This builder for chaining.
      */
     public Builder clearAutomatedAgentReplyType() {
-      bitField0_ = (bitField0_ & ~0x00000002);
+      bitField0_ = (bitField0_ & ~0x00000040);
       automatedAgentReplyType_ = 0;
       onChanged();
       return this;
@@ -1206,7 +2575,7 @@ public boolean getAllowCancellation() {
     public Builder setAllowCancellation(boolean value) {
 
       allowCancellation_ = value;
-      bitField0_ |= 0x00000004;
+      bitField0_ |= 0x00000080;
       onChanged();
       return this;
     }
@@ -1225,7 +2594,7 @@ public Builder setAllowCancellation(boolean value) {
      * @return This builder for chaining.
      */
     public Builder clearAllowCancellation() {
-      bitField0_ = (bitField0_ & ~0x00000004);
+      bitField0_ = (bitField0_ & ~0x00000080);
       allowCancellation_ = false;
       onChanged();
       return this;
@@ -1302,7 +2671,7 @@ public Builder setCxCurrentPage(java.lang.String value) {
         throw new NullPointerException();
       }
       cxCurrentPage_ = value;
-      bitField0_ |= 0x00000008;
+      bitField0_ |= 0x00000100;
       onChanged();
       return this;
     }
@@ -1322,7 +2691,7 @@ public Builder setCxCurrentPage(java.lang.String value) {
      */
     public Builder clearCxCurrentPage() {
       cxCurrentPage_ = getDefaultInstance().getCxCurrentPage();
-      bitField0_ = (bitField0_ & ~0x00000008);
+      bitField0_ = (bitField0_ & ~0x00000100);
       onChanged();
       return this;
     }
@@ -1347,7 +2716,66 @@ public Builder setCxCurrentPageBytes(com.google.protobuf.ByteString value) {
       }
       checkByteStringIsUtf8(value);
       cxCurrentPage_ = value;
-      bitField0_ |= 0x00000008;
+      bitField0_ |= 0x00000100;
+      onChanged();
+      return this;
+    }
+
+    private com.google.protobuf.ByteString callCompanionAuthCode_ =
+        com.google.protobuf.ByteString.EMPTY;
+
+    /**
+     *
+     *
+     * 
+     * The auth code for accessing Call Companion UI.
+     * 
+ * + * bytes call_companion_auth_code = 12; + * + * @return The callCompanionAuthCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCallCompanionAuthCode() { + return callCompanionAuthCode_; + } + + /** + * + * + *
+     * The auth code for accessing Call Companion UI.
+     * 
+ * + * bytes call_companion_auth_code = 12; + * + * @param value The callCompanionAuthCode to set. + * @return This builder for chaining. + */ + public Builder setCallCompanionAuthCode(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + callCompanionAuthCode_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * The auth code for accessing Call Companion UI.
+     * 
+ * + * bytes call_companion_auth_code = 12; + * + * @return This builder for chaining. + */ + public Builder clearCallCompanionAuthCode() { + bitField0_ = (bitField0_ & ~0x00000200); + callCompanionAuthCode_ = getDefaultInstance().getCallCompanionAuthCode(); onChanged(); return this; } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReplyOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReplyOrBuilder.java index dd33331ae118..4eccb31cfde6 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReplyOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AutomatedAgentReplyOrBuilder.java @@ -69,6 +69,177 @@ public interface AutomatedAgentReplyOrBuilder */ com.google.cloud.dialogflow.v2.DetectIntentResponseOrBuilder getDetectIntentResponseOrBuilder(); + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + java.util.List getResponseMessagesList(); + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index); + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + int getResponseMessagesCount(); + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + java.util.List + getResponseMessagesOrBuilderList(); + + /** + * + * + *
+   * Response messages from the automated agent.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 3; + */ + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder(int index); + + /** + * + * + *
+   * Name of the intent if an intent is matched for the query.
+   * For a V2 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agent/intents/<Intent ID>`.
+   * For a V3 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+   * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The intent. + */ + java.lang.String getIntent(); + + /** + * + * + *
+   * Name of the intent if an intent is matched for the query.
+   * For a V2 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agent/intents/<Intent ID>`.
+   * For a V3 query, the value format is `projects/<Project ID>/locations/
+   * <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
+   * 
+ * + * string intent = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for intent. + */ + com.google.protobuf.ByteString getIntentBytes(); + + /** + * + * + *
+   * Event name if an event is triggered for the query.
+   * 
+ * + * string event = 5; + * + * @return The event. + */ + java.lang.String getEvent(); + + /** + * + * + *
+   * Event name if an event is triggered for the query.
+   * 
+ * + * string event = 5; + * + * @return The bytes for event. + */ + com.google.protobuf.ByteString getEventBytes(); + + /** + * + * + *
+   * The confidence of the match. Values range from 0.0 (completely uncertain)
+   * to 1.0 (completely certain).
+   * This value is for informational purpose only and is only used to help match
+   * the best intent within the classification threshold. This value may change
+   * for the same end-user expression at any time due to a model retraining or
+   * change in implementation.
+   * 
+ * + * float match_confidence = 9; + * + * @return The matchConfidence. + */ + float getMatchConfidence(); + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return Whether the parameters field is set. + */ + boolean hasParameters(); + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + * + * @return The parameters. + */ + com.google.protobuf.Struct getParameters(); + + /** + * + * + *
+   * The collection of current parameters at the time of this response.
+   * 
+ * + * .google.protobuf.Struct parameters = 10; + */ + com.google.protobuf.StructOrBuilder getParametersOrBuilder(); + /** * * @@ -144,4 +315,17 @@ public interface AutomatedAgentReplyOrBuilder * @return The bytes for cxCurrentPage. */ com.google.protobuf.ByteString getCxCurrentPageBytes(); + + /** + * + * + *
+   * The auth code for accessing Call Companion UI.
+   * 
+ * + * bytes call_companion_auth_code = 12; + * + * @return The callCompanionAuthCode. + */ + com.google.protobuf.ByteString getCallCompanionAuthCode(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/BidiStreamingAnalyzeContentRequest.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/BidiStreamingAnalyzeContentRequest.java index b1b1450dfa26..4d750b1f11b1 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/BidiStreamingAnalyzeContentRequest.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/BidiStreamingAnalyzeContentRequest.java @@ -497,6 +497,38 @@ public interface VoiceSessionConfigOrBuilder * @return The useGeminiAsr. */ boolean getUseGeminiAsr(); + + /** + * + * + *
+       * Optional. Disables emission of interim input transcriptions when set to
+       * `true`.
+       * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + boolean hasDisableInterimInputTranscripts(); + + /** + * + * + *
+       * Optional. Disables emission of interim input transcriptions when set to
+       * `true`.
+       * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + boolean getDisableInterimInputTranscripts(); } /** @@ -824,6 +856,47 @@ public boolean getUseGeminiAsr() { return useGeminiAsr_; } + public static final int DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER = 26; + private boolean disableInterimInputTranscripts_ = false; + + /** + * + * + *
+       * Optional. Disables emission of interim input transcriptions when set to
+       * `true`.
+       * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Optional. Disables emission of interim input transcriptions when set to
+       * `true`.
+       * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -866,6 +939,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeBool(25, useGeminiAsr_); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(26, disableInterimInputTranscripts_); + } getUnknownFields().writeTo(output); } @@ -910,6 +986,11 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, useGeminiAsr_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 26, disableInterimInputTranscripts_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -947,6 +1028,12 @@ public boolean equals(final java.lang.Object obj) { if (hasUseGeminiAsr()) { if (getUseGeminiAsr() != other.getUseGeminiAsr()) return false; } + if (hasDisableInterimInputTranscripts() != other.hasDisableInterimInputTranscripts()) + return false; + if (hasDisableInterimInputTranscripts()) { + if (getDisableInterimInputTranscripts() != other.getDisableInterimInputTranscripts()) + return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -981,6 +1068,12 @@ public int hashCode() { hash = (37 * hash) + USE_GEMINI_ASR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseGeminiAsr()); } + if (hasDisableInterimInputTranscripts()) { + hash = (37 * hash) + DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getDisableInterimInputTranscripts()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1172,6 +1265,7 @@ public Builder clear() { geminiAsrConfigBuilder_ = null; } useGeminiAsr_ = false; + disableInterimInputTranscripts_ = false; return this; } @@ -1253,6 +1347,10 @@ private void buildPartial0( result.useGeminiAsr_ = useGeminiAsr_; to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.disableInterimInputTranscripts_ = disableInterimInputTranscripts_; + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -1303,6 +1401,9 @@ public Builder mergeFrom( if (other.hasUseGeminiAsr()) { setUseGeminiAsr(other.getUseGeminiAsr()); } + if (other.hasDisableInterimInputTranscripts()) { + setDisableInterimInputTranscripts(other.getDisableInterimInputTranscripts()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1378,6 +1479,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 200 + case 208: + { + disableInterimInputTranscripts_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 208 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2172,6 +2279,90 @@ public Builder clearUseGeminiAsr() { return this; } + private boolean disableInterimInputTranscripts_; + + /** + * + * + *
+         * Optional. Disables emission of interim input transcriptions when set to
+         * `true`.
+         * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+         * Optional. Disables emission of interim input transcriptions when set to
+         * `true`.
+         * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + + /** + * + * + *
+         * Optional. Disables emission of interim input transcriptions when set to
+         * `true`.
+         * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The disableInterimInputTranscripts to set. + * @return This builder for chaining. + */ + public Builder setDisableInterimInputTranscripts(boolean value) { + + disableInterimInputTranscripts_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+         * Optional. Disables emission of interim input transcriptions when set to
+         * `true`.
+         * 
+ * + * + * optional bool disable_interim_input_transcripts = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDisableInterimInputTranscripts() { + bitField0_ = (bitField0_ & ~0x00000100); + disableInterimInputTranscripts_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.BidiStreamingAnalyzeContentRequest.Config.VoiceSessionConfig) } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/HumanAgentAssistantConfig.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/HumanAgentAssistantConfig.java index 7290988eb616..f4b90dd89a43 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/HumanAgentAssistantConfig.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/HumanAgentAssistantConfig.java @@ -12188,9 +12188,10 @@ public enum SectionType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * "Unsatisfied" or "Satisfied" depending on the customer's feelings at
-         * the end of the conversation.
-         * Section name: "customer_satisfaction".
+         * Customer satisfaction derived from the text transcript only (not
+         * audio). Categorized based on customer statements by the end of the
+         * conversation. `D` for dissatisfied and `N` for neutral or satisfied
+         * (default). Section name: `customer_satisfaction`.
          * 
* * CUSTOMER_SATISFACTION = 5; @@ -12286,9 +12287,10 @@ public enum SectionType implements com.google.protobuf.ProtocolMessageEnum { * * *
-         * "Unsatisfied" or "Satisfied" depending on the customer's feelings at
-         * the end of the conversation.
-         * Section name: "customer_satisfaction".
+         * Customer satisfaction derived from the text transcript only (not
+         * audio). Categorized based on customer statements by the end of the
+         * conversation. `D` for dissatisfied and `N` for neutral or satisfied
+         * (default). Section name: `customer_satisfaction`.
          * 
* * CUSTOMER_SATISFACTION = 5; diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfig.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfig.java index 64764d517d0a..c91bae77e102 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfig.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfig.java @@ -822,6 +822,47 @@ public boolean getUseGeminiAsr() { return useGeminiAsr_; } + public static final int DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER = 32; + private boolean disableInterimInputTranscripts_ = false; + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -887,6 +928,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeBool(31, useGeminiAsr_); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(32, disableInterimInputTranscripts_); + } getUnknownFields().writeTo(output); } @@ -961,6 +1005,11 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(31, useGeminiAsr_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 32, disableInterimInputTranscripts_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1001,6 +1050,12 @@ public boolean equals(final java.lang.Object obj) { if (hasUseGeminiAsr()) { if (getUseGeminiAsr() != other.getUseGeminiAsr()) return false; } + if (hasDisableInterimInputTranscripts() != other.hasDisableInterimInputTranscripts()) + return false; + if (hasDisableInterimInputTranscripts()) { + if (getDisableInterimInputTranscripts() != other.getDisableInterimInputTranscripts()) + return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1056,6 +1111,12 @@ public int hashCode() { hash = (37 * hash) + USE_GEMINI_ASR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseGeminiAsr()); } + if (hasDisableInterimInputTranscripts()) { + hash = (37 * hash) + DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getDisableInterimInputTranscripts()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1232,6 +1293,7 @@ public Builder clear() { geminiAsrConfigBuilder_ = null; } useGeminiAsr_ = false; + disableInterimInputTranscripts_ = false; return this; } @@ -1333,6 +1395,10 @@ private void buildPartial0(com.google.cloud.dialogflow.v2.InputAudioConfig resul result.useGeminiAsr_ = useGeminiAsr_; to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.disableInterimInputTranscripts_ = disableInterimInputTranscripts_; + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -1439,6 +1505,9 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.InputAudioConfig other) if (other.hasUseGeminiAsr()) { setUseGeminiAsr(other.getUseGeminiAsr()); } + if (other.hasDisableInterimInputTranscripts()) { + setDisableInterimInputTranscripts(other.getDisableInterimInputTranscripts()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1571,6 +1640,12 @@ public Builder mergeFrom( bitField0_ |= 0x00008000; break; } // case 248 + case 256: + { + disableInterimInputTranscripts_ = input.readBool(); + bitField0_ |= 0x00010000; + break; + } // case 256 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3765,6 +3840,90 @@ public Builder clearUseGeminiAsr() { return this; } + private boolean disableInterimInputTranscripts_; + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The disableInterimInputTranscripts to set. + * @return This builder for chaining. + */ + public Builder setDisableInterimInputTranscripts(boolean value) { + + disableInterimInputTranscripts_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDisableInterimInputTranscripts() { + bitField0_ = (bitField0_ & ~0x00010000); + disableInterimInputTranscripts_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.InputAudioConfig) } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfigOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfigOrBuilder.java index 2f9801fc33ec..463f016e8344 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfigOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputAudioConfigOrBuilder.java @@ -578,4 +578,36 @@ public interface InputAudioConfigOrBuilder * @return The useGeminiAsr. */ boolean getUseGeminiAsr(); + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + boolean hasDisableInterimInputTranscripts(); + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 32 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + boolean getDisableInterimInputTranscripts(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Message.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Message.java index ce51e7994a21..09531552ce15 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Message.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Message.java @@ -54,6 +54,7 @@ private Message(com.google.protobuf.GeneratedMessage.Builder builder) { private Message() { name_ = ""; content_ = ""; + responseMessages_ = java.util.Collections.emptyList(); languageCode_ = ""; participant_ = ""; participantRole_ = 0; @@ -187,6 +188,93 @@ public com.google.protobuf.ByteString getContentBytes() { } } + public static final int RESPONSE_MESSAGES_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List responseMessages_; + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getResponseMessagesList() { + return responseMessages_; + } + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getResponseMessagesOrBuilderList() { + return responseMessages_; + } + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getResponseMessagesCount() { + return responseMessages_.size(); + } + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index) { + return responseMessages_.get(index); + } + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder( + int index) { + return responseMessages_.get(index); + } + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; @SuppressWarnings("serial") @@ -606,6 +694,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(9, getSendTime()); } + for (int i = 0; i < responseMessages_.size(); i++) { + output.writeMessage(11, responseMessages_.get(i)); + } getUnknownFields().writeTo(output); } @@ -643,6 +734,10 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSendTime()); } + for (int i = 0; i < responseMessages_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, responseMessages_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -660,6 +755,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getContent().equals(other.getContent())) return false; + if (!getResponseMessagesList().equals(other.getResponseMessagesList())) return false; if (!getLanguageCode().equals(other.getLanguageCode())) return false; if (!getParticipant().equals(other.getParticipant())) return false; if (participantRole_ != other.participantRole_) return false; @@ -694,6 +790,10 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONTENT_FIELD_NUMBER; hash = (53 * hash) + getContent().hashCode(); + if (getResponseMessagesCount() > 0) { + hash = (37 * hash) + RESPONSE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getResponseMessagesList().hashCode(); + } hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; hash = (53 * hash) + getLanguageCode().hashCode(); hash = (37 * hash) + PARTICIPANT_FIELD_NUMBER; @@ -857,6 +957,7 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetResponseMessagesFieldBuilder(); internalGetCreateTimeFieldBuilder(); internalGetSendTimeFieldBuilder(); internalGetMessageAnnotationFieldBuilder(); @@ -870,6 +971,13 @@ public Builder clear() { bitField0_ = 0; name_ = ""; content_ = ""; + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + } else { + responseMessages_ = null; + responseMessagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); languageCode_ = ""; participant_ = ""; participantRole_ = 0; @@ -920,6 +1028,7 @@ public com.google.cloud.dialogflow.v2.Message build() { public com.google.cloud.dialogflow.v2.Message buildPartial() { com.google.cloud.dialogflow.v2.Message result = new com.google.cloud.dialogflow.v2.Message(this); + buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } @@ -927,6 +1036,18 @@ public com.google.cloud.dialogflow.v2.Message buildPartial() { return result; } + private void buildPartialRepeatedFields(com.google.cloud.dialogflow.v2.Message result) { + if (responseMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + responseMessages_ = java.util.Collections.unmodifiableList(responseMessages_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.responseMessages_ = responseMessages_; + } else { + result.responseMessages_ = responseMessagesBuilder_.build(); + } + } + private void buildPartial0(com.google.cloud.dialogflow.v2.Message result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -935,32 +1056,32 @@ private void buildPartial0(com.google.cloud.dialogflow.v2.Message result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.content_ = content_; } - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.languageCode_ = languageCode_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000010) != 0)) { result.participant_ = participant_; } - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000020) != 0)) { result.participantRole_ = participantRole_; } int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000040) != 0)) { result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.sendTime_ = sendTimeBuilder_ == null ? sendTime_ : sendTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } - if (((from_bitField0_ & 0x00000080) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.messageAnnotation_ = messageAnnotationBuilder_ == null ? messageAnnotation_ : messageAnnotationBuilder_.build(); to_bitField0_ |= 0x00000004; } - if (((from_bitField0_ & 0x00000100) != 0)) { + if (((from_bitField0_ & 0x00000200) != 0)) { result.sentimentAnalysis_ = sentimentAnalysisBuilder_ == null ? sentimentAnalysis_ @@ -992,14 +1113,41 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.Message other) { bitField0_ |= 0x00000002; onChanged(); } + if (responseMessagesBuilder_ == null) { + if (!other.responseMessages_.isEmpty()) { + if (responseMessages_.isEmpty()) { + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResponseMessagesIsMutable(); + responseMessages_.addAll(other.responseMessages_); + } + onChanged(); + } + } else { + if (!other.responseMessages_.isEmpty()) { + if (responseMessagesBuilder_.isEmpty()) { + responseMessagesBuilder_.dispose(); + responseMessagesBuilder_ = null; + responseMessages_ = other.responseMessages_; + bitField0_ = (bitField0_ & ~0x00000004); + responseMessagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResponseMessagesFieldBuilder() + : null; + } else { + responseMessagesBuilder_.addAllMessages(other.responseMessages_); + } + } + } if (!other.getLanguageCode().isEmpty()) { languageCode_ = other.languageCode_; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getParticipant().isEmpty()) { participant_ = other.participant_; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); } if (other.participantRole_ != 0) { @@ -1058,49 +1206,62 @@ public Builder mergeFrom( case 26: { languageCode_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 26 case 34: { participant_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 34 case 40: { participantRole_ = input.readEnum(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 40 case 50: { input.readMessage( internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 50 case 58: { input.readMessage( internalGetMessageAnnotationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 58 case 66: { input.readMessage( internalGetSentimentAnalysisFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 66 case 74: { input.readMessage( internalGetSendTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 74 + case 90: + { + com.google.cloud.dialogflow.v2.ResponseMessage m = + input.readMessage( + com.google.cloud.dialogflow.v2.ResponseMessage.parser(), extensionRegistry); + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(m); + } else { + responseMessagesBuilder_.addMessage(m); + } + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1357,6 +1518,420 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { return this; } + private java.util.List responseMessages_ = + java.util.Collections.emptyList(); + + private void ensureResponseMessagesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + responseMessages_ = + new java.util.ArrayList( + responseMessages_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder> + responseMessagesBuilder_; + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getResponseMessagesList() { + if (responseMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responseMessages_); + } else { + return responseMessagesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getResponseMessagesCount() { + if (responseMessagesBuilder_ == null) { + return responseMessages_.size(); + } else { + return responseMessagesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, value); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addResponseMessages(com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage value) { + if (responseMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, value); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addResponseMessages( + com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addResponseMessages( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.Builder builderForValue) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + responseMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllResponseMessages( + java.lang.Iterable values) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responseMessages_); + onChanged(); + } else { + responseMessagesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearResponseMessages() { + if (responseMessagesBuilder_ == null) { + responseMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + responseMessagesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeResponseMessages(int index) { + if (responseMessagesBuilder_ == null) { + ensureResponseMessagesIsMutable(); + responseMessages_.remove(index); + onChanged(); + } else { + responseMessagesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder getResponseMessagesBuilder( + int index) { + return internalGetResponseMessagesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder( + int index) { + if (responseMessagesBuilder_ == null) { + return responseMessages_.get(index); + } else { + return responseMessagesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getResponseMessagesOrBuilderList() { + if (responseMessagesBuilder_ != null) { + return responseMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responseMessages_); + } + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder addResponseMessagesBuilder() { + return internalGetResponseMessagesFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Builder addResponseMessagesBuilder( + int index) { + return internalGetResponseMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Automated agent responses.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getResponseMessagesBuilderList() { + return internalGetResponseMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder> + internalGetResponseMessagesFieldBuilder() { + if (responseMessagesBuilder_ == null) { + responseMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder, + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder>( + responseMessages_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + responseMessages_ = null; + } + return responseMessagesBuilder_; + } + private java.lang.Object languageCode_ = ""; /** @@ -1428,7 +2003,7 @@ public Builder setLanguageCode(java.lang.String value) { throw new NullPointerException(); } languageCode_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1448,7 +2023,7 @@ public Builder setLanguageCode(java.lang.String value) { */ public Builder clearLanguageCode() { languageCode_ = getDefaultInstance().getLanguageCode(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } @@ -1473,7 +2048,7 @@ public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); languageCode_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1543,7 +2118,7 @@ public Builder setParticipant(java.lang.String value) { throw new NullPointerException(); } participant_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1561,7 +2136,7 @@ public Builder setParticipant(java.lang.String value) { */ public Builder clearParticipant() { participant_ = getDefaultInstance().getParticipant(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } @@ -1584,7 +2159,7 @@ public Builder setParticipantBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); participant_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1625,7 +2200,7 @@ public int getParticipantRoleValue() { */ public Builder setParticipantRoleValue(int value) { participantRole_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1668,7 +2243,7 @@ public Builder setParticipantRole(com.google.cloud.dialogflow.v2.Participant.Rol if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; participantRole_ = value.getNumber(); onChanged(); return this; @@ -1688,7 +2263,7 @@ public Builder setParticipantRole(com.google.cloud.dialogflow.v2.Participant.Rol * @return This builder for chaining. */ public Builder clearParticipantRole() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); participantRole_ = 0; onChanged(); return this; @@ -1715,7 +2290,7 @@ public Builder clearParticipantRole() { * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return ((bitField0_ & 0x00000020) != 0); + return ((bitField0_ & 0x00000040) != 0); } /** @@ -1761,7 +2336,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { } else { createTimeBuilder_.setMessage(value); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -1783,7 +2358,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal } else { createTimeBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -1801,7 +2376,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) + if (((bitField0_ & 0x00000040) != 0) && createTime_ != null && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getCreateTimeBuilder().mergeFrom(value); @@ -1812,7 +2387,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { createTimeBuilder_.mergeFrom(value); } if (createTime_ != null) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); } return this; @@ -1830,7 +2405,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearCreateTime() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); createTime_ = null; if (createTimeBuilder_ != null) { createTimeBuilder_.dispose(); @@ -1852,7 +2427,7 @@ public Builder clearCreateTime() { * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return internalGetCreateTimeFieldBuilder().getBuilder(); } @@ -1927,7 +2502,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the sendTime field is set. */ public boolean hasSendTime() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** @@ -1971,7 +2546,7 @@ public Builder setSendTime(com.google.protobuf.Timestamp value) { } else { sendTimeBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -1993,7 +2568,7 @@ public Builder setSendTime(com.google.protobuf.Timestamp.Builder builderForValue } else { sendTimeBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2011,7 +2586,7 @@ public Builder setSendTime(com.google.protobuf.Timestamp.Builder builderForValue */ public Builder mergeSendTime(com.google.protobuf.Timestamp value) { if (sendTimeBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000080) != 0) && sendTime_ != null && sendTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getSendTimeBuilder().mergeFrom(value); @@ -2022,7 +2597,7 @@ public Builder mergeSendTime(com.google.protobuf.Timestamp value) { sendTimeBuilder_.mergeFrom(value); } if (sendTime_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2040,7 +2615,7 @@ public Builder mergeSendTime(com.google.protobuf.Timestamp value) { * */ public Builder clearSendTime() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); sendTime_ = null; if (sendTimeBuilder_ != null) { sendTimeBuilder_.dispose(); @@ -2062,7 +2637,7 @@ public Builder clearSendTime() { * */ public com.google.protobuf.Timestamp.Builder getSendTimeBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return internalGetSendTimeFieldBuilder().getBuilder(); } @@ -2135,7 +2710,7 @@ public com.google.protobuf.TimestampOrBuilder getSendTimeOrBuilder() { * @return Whether the messageAnnotation field is set. */ public boolean hasMessageAnnotation() { - return ((bitField0_ & 0x00000080) != 0); + return ((bitField0_ & 0x00000100) != 0); } /** @@ -2181,7 +2756,7 @@ public Builder setMessageAnnotation(com.google.cloud.dialogflow.v2.MessageAnnota } else { messageAnnotationBuilder_.setMessage(value); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2204,7 +2779,7 @@ public Builder setMessageAnnotation( } else { messageAnnotationBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2222,7 +2797,7 @@ public Builder setMessageAnnotation( */ public Builder mergeMessageAnnotation(com.google.cloud.dialogflow.v2.MessageAnnotation value) { if (messageAnnotationBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0) + if (((bitField0_ & 0x00000100) != 0) && messageAnnotation_ != null && messageAnnotation_ != com.google.cloud.dialogflow.v2.MessageAnnotation.getDefaultInstance()) { @@ -2234,7 +2809,7 @@ public Builder mergeMessageAnnotation(com.google.cloud.dialogflow.v2.MessageAnno messageAnnotationBuilder_.mergeFrom(value); } if (messageAnnotation_ != null) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); } return this; @@ -2252,7 +2827,7 @@ public Builder mergeMessageAnnotation(com.google.cloud.dialogflow.v2.MessageAnno * */ public Builder clearMessageAnnotation() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); messageAnnotation_ = null; if (messageAnnotationBuilder_ != null) { messageAnnotationBuilder_.dispose(); @@ -2274,7 +2849,7 @@ public Builder clearMessageAnnotation() { * */ public com.google.cloud.dialogflow.v2.MessageAnnotation.Builder getMessageAnnotationBuilder() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return internalGetMessageAnnotationFieldBuilder().getBuilder(); } @@ -2350,7 +2925,7 @@ public com.google.cloud.dialogflow.v2.MessageAnnotation.Builder getMessageAnnota * @return Whether the sentimentAnalysis field is set. */ public boolean hasSentimentAnalysis() { - return ((bitField0_ & 0x00000100) != 0); + return ((bitField0_ & 0x00000200) != 0); } /** @@ -2397,7 +2972,7 @@ public Builder setSentimentAnalysis( } else { sentimentAnalysisBuilder_.setMessage(value); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2420,7 +2995,7 @@ public Builder setSentimentAnalysis( } else { sentimentAnalysisBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2439,7 +3014,7 @@ public Builder setSentimentAnalysis( public Builder mergeSentimentAnalysis( com.google.cloud.dialogflow.v2.SentimentAnalysisResult value) { if (sentimentAnalysisBuilder_ == null) { - if (((bitField0_ & 0x00000100) != 0) + if (((bitField0_ & 0x00000200) != 0) && sentimentAnalysis_ != null && sentimentAnalysis_ != com.google.cloud.dialogflow.v2.SentimentAnalysisResult.getDefaultInstance()) { @@ -2451,7 +3026,7 @@ public Builder mergeSentimentAnalysis( sentimentAnalysisBuilder_.mergeFrom(value); } if (sentimentAnalysis_ != null) { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); } return this; @@ -2469,7 +3044,7 @@ public Builder mergeSentimentAnalysis( * */ public Builder clearSentimentAnalysis() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); sentimentAnalysis_ = null; if (sentimentAnalysisBuilder_ != null) { sentimentAnalysisBuilder_.dispose(); @@ -2492,7 +3067,7 @@ public Builder clearSentimentAnalysis() { */ public com.google.cloud.dialogflow.v2.SentimentAnalysisResult.Builder getSentimentAnalysisBuilder() { - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return internalGetSentimentAnalysisFieldBuilder().getBuilder(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/MessageOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/MessageOrBuilder.java index ffa5d4c8def8..3ef5f72261e7 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/MessageOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/MessageOrBuilder.java @@ -84,6 +84,72 @@ public interface MessageOrBuilder */ com.google.protobuf.ByteString getContentBytes(); + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getResponseMessagesList(); + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessage getResponseMessages(int index); + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getResponseMessagesCount(); + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getResponseMessagesOrBuilderList(); + + /** + * + * + *
+   * Optional. Automated agent responses.
+   * 
+ * + * + * repeated .google.cloud.dialogflow.v2.ResponseMessage response_messages = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder getResponseMessagesOrBuilder(int index); + /** * * diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java index d34f4d4d677f..428dcf61ba9b 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java @@ -216,6 +216,34 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dialogflow_v2_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_dialogflow_v2_AssistQueryParameters_DocumentsMetadataFiltersEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistRequest_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -384,10 +412,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005OTHER\020\010:\330\001\352A\324\001\n" + "%dialogflow.googleapis.com/Participant\022Jprojects/{projec" + "t}/conversations/{conversation}/participants/{participant}\022_projects/{project}/l" - + "ocations/{location}/conversations/{conversation}/participants/{participant}\"\225\005\n" + + "ocations/{location}/conversations/{conversation}/participants/{participant}\"\343\005\n" + "\007Message\022\022\n" + "\004name\030\001 \001(\tB\004\342A\001\001\022\025\n" - + "\007content\030\002 \001(\tB\004\342A\001\001\022\033\n\r" + + "\007content\030\002 \001(\tB\004\342A\001\001\022L\n" + + "\021response_messages\030\013 \003(\0132+." + + "google.cloud.dialogflow.v2.ResponseMessageB\004\342A\001\001\022\033\n\r" + "language_code\030\003 \001(\tB\004\342A\001\001\022\031\n" + "\013participant\030\004 \001(\tB\004\342A\001\003\022L\n" + "\020participant_role\030\005" @@ -395,13 +425,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013create_time\030\006" + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0223\n" + "\tsend_time\030\t \001(\0132\032.google.protobuf.TimestampB\004\342A\001\001\022O\n" - + "\022message_annotation\030\007 \001(\013" - + "2-.google.cloud.dialogflow.v2.MessageAnnotationB\004\342A\001\003\022U\n" - + "\022sentiment_analysis\030\010 \001(" - + "\01323.google.cloud.dialogflow.v2.SentimentAnalysisResultB\004\342A\001\003:\304\001\352A\300\001\n" - + "!dialogflow.googleapis.com/Message\022Bprojects/{projec" - + "t}/conversations/{conversation}/messages/{message}\022Wprojects/{project}/locations" - + "/{location}/conversations/{conversation}/messages/{message}\"\236\001\n" + + "\022message_annotation\030\007 \001(\0132-" + + ".google.cloud.dialogflow.v2.MessageAnnotationB\004\342A\001\003\022U\n" + + "\022sentiment_analysis\030\010 \001(\0132" + + "3.google.cloud.dialogflow.v2.SentimentAnalysisResultB\004\342A\001\003:\304\001\352A\300\001\n" + + "!dialogflow.googleapis.com/Message\022Bprojects/{project}" + + "/conversations/{conversation}/messages/{message}\022Wprojects/{project}/locations/{" + + "location}/conversations/{conversation}/messages/{message}\"\236\001\n" + "\030CreateParticipantRequest\022>\n" + "\006parent\030\001 \001(" + "\tB.\342A\001\002\372A\'\022%dialogflow.googleapis.com/Participant\022B\n" @@ -411,8 +441,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB.\342A\001\002\372A\'\n" + "%dialogflow.googleapis.com/Participant\"\214\001\n" + "\027ListParticipantsRequest\022>\n" - + "\006parent\030\001 \001(\tB.\342A\001\002\372A\'" - + "\022%dialogflow.googleapis.com/Participant\022\027\n" + + "\006parent\030\001 \001(" + + "\tB.\342A\001\002\372A\'\022%dialogflow.googleapis.com/Participant\022\027\n" + "\tpage_size\030\002 \001(\005B\004\342A\001\001\022\030\n\n" + "page_token\030\003 \001(\tB\004\342A\001\001\"r\n" + "\030ListParticipantsResponse\022=\n" @@ -434,8 +464,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\022reply_audio_config\030\005" + " \001(\0132-.google.cloud.dialogflow.v2.OutputAudioConfig\022A\n" + "\014query_params\030\t \001(\0132+.google.cloud.dialogflow.v2.QueryParameters\022N\n" - + "\023assist_query_params\030\016" - + " \001(\01321.google.cloud.dialogflow.v2.AssistQueryParameters\022.\n\r" + + "\023assist_query_params\030\016 \001" + + "(\01321.google.cloud.dialogflow.v2.AssistQueryParameters\022.\n\r" + "cx_parameters\030\022 \001(\0132\027.google.protobuf.Struct\022\022\n\n" + "request_id\030\013 \001(\tB\007\n" + "\005input\",\n" @@ -444,8 +474,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\026AnalyzeContentResponse\022\022\n\n" + "reply_text\030\001 \001(\t\022<\n" + "\013reply_audio\030\002 \001(\0132\'.google.cloud.dialogflow.v2.OutputAudio\022N\n" - + "\025automated_agent_reply\030\003 \001(\0132/" - + ".google.cloud.dialogflow.v2.AutomatedAgentReply\0224\n" + + "\025automated_agent_reply\030\003 \001(\0132/.g" + + "oogle.cloud.dialogflow.v2.AutomatedAgentReply\0224\n" + "\007message\030\005 \001(\0132#.google.cloud.dialogflow.v2.Message\022T\n" + "\036human_agent_suggestion_results\030\006" + " \003(\0132,.google.cloud.dialogflow.v2.SuggestionResult\022Q\n" @@ -462,15 +492,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\0132+.google.cloud.dialogflow.v2.InputTextConfigH\000\022I\n" + "\022reply_audio_config\030\004" + " \001(\0132-.google.cloud.dialogflow.v2.OutputAudioConfig\022\025\n" - + "\013input_audio\030\005 \001(\014H\001\022\024\n\n" + + "\013input_audio\030\005 \001(\014H\001\022\024\n" + + "\n" + "input_text\030\006 \001(\tH\001\022E\n\n" - + "input_dtmf\030\t \001(" - + "\0132/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\001\022M\n" - + "\020suggestion_input\030\033 \001(\0132+" - + ".google.cloud.dialogflow.v2.SuggestionInputB\004\342A\001\001H\001\022A\n" + + "input_dtmf\030\t \001(\0132" + + "/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\001\022M\n" + + "\020suggestion_input\030\033 \001(\0132+.g" + + "oogle.cloud.dialogflow.v2.SuggestionInputB\004\342A\001\001H\001\022A\n" + "\014query_params\030\007 \001(\0132+.google.cloud.dialogflow.v2.QueryParameters\022N\n" - + "\023assist_query_params\030\010 \001(\01321.google.clo" - + "ud.dialogflow.v2.AssistQueryParameters\022.\n\r" + + "\023assist_query_params\030\010" + + " \001(\01321.google.cloud.dialogflow.v2.AssistQueryParameters\022.\n\r" + "cx_parameters\030\r" + " \001(\0132\027.google.protobuf.Struct\022\'\n" + "\031enable_extended_streaming\030\013 \001(\010B\004\342A\001\001\0222\n" @@ -493,8 +524,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \003(\0132,.google.cloud.dialogflow.v2.SuggestionResult\022C\n" + "\017dtmf_parameters\030\n" + " \001(\0132*.google.cloud.dialogflow.v2.DtmfParameters\022R\n" - + "\016debugging_info\030\013 \001(\0132:.google.c" - + "loud.dialogflow.v2.CloudConversationDebuggingInfo\022\024\n" + + "\016debugging_info\030\013 \001(\0132:.google.clo" + + "ud.dialogflow.v2.CloudConversationDebuggingInfo\022\024\n" + "\014speech_model\030\r" + " \001(\t\"\210\002\n" + "\026SuggestArticlesRequest\022>\n" @@ -523,39 +554,38 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\016latest_message\030\002 \001(\t\022\024\n" + "\014context_size\030\003 \001(\005\"\241\003\n" + "\033GenerateSuggestionsResponse\022w\n" - + "\034generator_suggestion_answers\030\001 \003(\0132Q.go" - + "ogle.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\022>\n" + + "\034generator_suggestion_answers\030\001 \003(\0132Q.goog" + + "le.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\022>\n" + "\016latest_message\030\002 \001(\tB&\372A#\n" + "!dialogflow.googleapis.com/Message\032\310\001\n" + "\031GeneratorSuggestionAnswer\022M\n" - + "\024generator_suggestion\030\001 \001" - + "(\0132/.google.cloud.dialogflow.v2.GeneratorSuggestion\022\030\n" - + "\020source_generator\030\002 \001(\t\022B\n" - + "\r" + + "\024generator_suggestion\030\001 \001(\013" + + "2/.google.cloud.dialogflow.v2.GeneratorSuggestion\022\030\n" + + "\020source_generator\030\002 \001(\t\022B\n\r" + "answer_record\030\003 \001(\tB+\372A(\n" + "&dialogflow.googleapis.com/AnswerRecord\"\213\001\n" + "\022ToolCallSuggestion\022Z\n" - + "\016tool_call_info\030\001 \001(\0132<.googl" - + "e.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfoB\004\342A\001\001\022\031\n" + + "\016tool_call_info\030\001 \001(\0132<.google." + + "cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfoB\004\342A\001\001\022\031\n" + "\013text_update\030\002 \001(\tB\004\342A\001\001\"e\n" + "\016ToolCallEvents\022S\n" + "\025tool_call_suggestions\030\001" + " \003(\0132..google.cloud.dialogflow.v2.ToolCallSuggestionB\004\342A\001\001\"\362\005\n" + "\023CompanionSuggestion\022K\n" - + "\tguidances\030\001 \003(\01328.goog" - + "le.cloud.dialogflow.v2.CompanionSuggestion.Guidance\032\215\005\n" + + "\tguidances\030\001 \003(\01328.google" + + ".cloud.dialogflow.v2.CompanionSuggestion.Guidance\032\215\005\n" + "\010Guidance\022\027\n" + "\017suggested_reply\030\001 \001(\t\022\030\n" + "\020suggested_action\030\002 \001(\t\022K\n" + "\022instruction_source\030\003" + " \001(\0132/.google.cloud.dialogflow.v2.GuidanceInstruction\022c\n" - + "\021knowledge_sources\030\004 \003(\0132H.google.cloud.dialo" - + "gflow.v2.CompanionSuggestion.Guidance.KnowledgeSource\022\031\n" + + "\021knowledge_sources\030\004 \003(\0132H.google.cloud.dialogf" + + "low.v2.CompanionSuggestion.Guidance.KnowledgeSource\022\031\n" + "\013explanation\030\014 \001(\tB\004\342A\001\001\022T\n" - + "\022grounding_metadata\030\006 \001(\0132-.google.cl" - + "oud.dialogflow.v2.GroundingMetadataB\004\342A\001\001H\000\210\001\001\022H\n\n" - + "tool_calls\030\007 \003(\0132..google.clou" - + "d.dialogflow.v2.ToolCallSuggestionB\004\342A\001\001\022\\\n" + + "\022grounding_metadata\030\006 \001(\0132-.google.clou" + + "d.dialogflow.v2.GroundingMetadataB\004\342A\001\001H\000\210\001\001\022H\n\n" + + "tool_calls\030\007 \003(\0132..google.cloud." + + "dialogflow.v2.ToolCallSuggestionB\004\342A\001\001\022\\\n" + "#triggering_tool_call_answer_records\030\013 \003(\tB/\342A\001\001\372A(\n" + "&dialogflow.googleapis.com/AnswerRecord\032l\n" + "\017KnowledgeSource\022\035\n" @@ -584,19 +614,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "!dialogflow.googleapis.com/Message\022\024\n" + "\014context_size\030\003 \001(\005\"e\n\n" + "AudioInput\022B\n" - + "\006config\030\001 \001(\0132,.google.cl" - + "oud.dialogflow.v2.InputAudioConfigB\004\342A\001\002\022\023\n" + + "\006config\030\001 \001(\0132,.google.clou" + + "d.dialogflow.v2.InputAudioConfigB\004\342A\001\002\022\023\n" + "\005audio\030\002 \001(\014B\004\342A\001\002\"[\n" + "\013OutputAudio\022=\n" + "\006config\030\001 \001(\0132-.google.cloud.dialogflow.v2.OutputAudioConfig\022\r\n" - + "\005audio\030\002 \001(\014\"\350\002\n" + + "\005audio\030\002 \001(\014\"\337\004\n" + "\023AutomatedAgentReply\022P\n" + "\026detect_intent_response\030\001" - + " \001(\01320.google.cloud.dialogflow.v2.DetectIntentResponse\022k\n" - + "\032automated_agent_reply_type\030\007 \001(\0162G.google.cloud.dialogfl" - + "ow.v2.AutomatedAgentReply.AutomatedAgentReplyType\022\032\n" + + " \001(\01320.google.cloud.dialogflow.v2.DetectIntentResponse\022F\n" + + "\021response_messages\030\003" + + " \003(\0132+.google.cloud.dialogflow.v2.ResponseMessage\0225\n" + + "\006intent\030\004 \001(\tB%\372A\"\n" + + " dialogflow.googleapis.com/Intent\022\r\n" + + "\005event\030\005 \001(\t\022\030\n" + + "\020match_confidence\030\t \001(\002\022+\n\n" + + "parameters\030\n" + + " \001(\0132\027.google.protobuf.Struct\022k\n" + + "\032automated_agent_reply_type\030\007 \001(\0162G.google.clo" + + "ud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\022\032\n" + "\022allow_cancellation\030\010 \001(\010\022\027\n" - + "\017cx_current_page\030\013 \001(\t\"]\n" + + "\017cx_current_page\030\013 \001(\t\022 \n" + + "\030call_companion_auth_code\030\014 \001(\014\"]\n" + "\027AutomatedAgentReplyType\022*\n" + "&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\020\000\022\013\n" + "\007PARTIAL\020\001\022\t\n" @@ -606,8 +645,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\003uri\030\002 \001(\t\022\020\n" + "\010snippets\030\003 \003(\t\022\022\n\n" + "confidence\030\004 \001(\002\022I\n" - + "\010metadata\030\005" - + " \003(\01327.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\022\025\n\r" + + "\010metadata\030\005 \003(\01327.google.cloud." + + "dialogflow.v2.ArticleAnswer.MetadataEntry\022\025\n\r" + "answer_record\030\006 \001(\t\032/\n\r" + "MetadataEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" @@ -634,27 +673,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013description\030\005 \001(\tB\010\n" + "\006intent\"\305\001\n" + "\026DialogflowAssistAnswer\022?\n" - + "\014query_result\030\001 \001(" - + "\0132\'.google.cloud.dialogflow.v2.QueryResultH\000\022I\n" - + "\021intent_suggestion\030\005 \001(\0132,.google" - + ".cloud.dialogflow.v2.IntentSuggestionH\000\022\025\n\r" + + "\014query_result\030\001" + + " \001(\0132\'.google.cloud.dialogflow.v2.QueryResultH\000\022I\n" + + "\021intent_suggestion\030\005 \001(\0132,.g" + + "oogle.cloud.dialogflow.v2.IntentSuggestionH\000\022\025\n\r" + "answer_record\030\002 \001(\tB\010\n" + "\006result\"\252\005\n" + "\020SuggestionResult\022#\n" + "\005error\030\001 \001(\0132\022.google.rpc.StatusH\000\022X\n" + "\031suggest_articles_response\030\002" + " \001(\01323.google.cloud.dialogflow.v2.SuggestArticlesResponseH\000\022g\n" - + "!suggest_knowledge_assist_response\030\010 \001(\0132:.google.cloud.d" - + "ialogflow.v2.SuggestKnowledgeAssistResponseH\000\022]\n" - + "\034suggest_faq_answers_response\030\003 " - + "\001(\01325.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\000\022a\n" - + "\036suggest_smart_replies_response\030\004 \001(\01327.google.cloud.dial" - + "ogflow.v2.SuggestSmartRepliesResponseH\000\022`\n" - + "\035generate_suggestions_response\030\t \001(\01327" - + ".google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\000\022s\n" + + "!suggest_knowledge_assist_response\030\010 \001(\0132:.google.cl" + + "oud.dialogflow.v2.SuggestKnowledgeAssistResponseH\000\022]\n" + + "\034suggest_faq_answers_response\030\003" + + " \001(\01325.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\000\022a\n" + + "\036suggest_smart_replies_response\030\004 \001(\01327.google.cloud" + + ".dialogflow.v2.SuggestSmartRepliesResponseH\000\022`\n" + + "\035generate_suggestions_response\030\t " + + "\001(\01327.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\000\022s\n" + "\'generate_companion_suggestions_response\030\n" - + " \001(\0132@.google.clou" - + "d.dialogflow.v2.GenerateCompanionSuggestionsResponseH\000B\025\n" + + " \001(\0132@.google" + + ".cloud.dialogflow.v2.GenerateCompanionSuggestionsResponseH\000B\025\n" + "\023suggestion_response\".\n" + "\017InputTextConfig\022\033\n\r" + "language_code\030\001 \001(\tB\004\342A\001\002\"j\n" @@ -663,14 +702,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013entity_type\030\002 \001(\t\022/\n" + "\017formatted_value\030\003 \001(\0132\026.google.protobuf.Value\"n\n" + "\021MessageAnnotation\022?\n" - + "\005parts\030\001 \003(\01320.google.c" - + "loud.dialogflow.v2.AnnotatedMessagePart\022\030\n" + + "\005parts\030\001 \003(\01320.goo" + + "gle.cloud.dialogflow.v2.AnnotatedMessagePart\022\030\n" + "\020contain_entities\030\002 \001(\010\"\247\002\n" + "\017SuggestionInput\022\033\n\r" + "answer_record\030\001 \001(\tB\004\342A\001\002\0221\n\n" + "parameters\030\004 \001(\0132\027.google.protobuf.StructB\004\342A\001\001\022H\n" - + "\006action\030\005 \001(\01622.google.cloud.dia" - + "logflow.v2.SuggestionInput.ActionB\004\342A\001\001\0223\n" + + "\006action\030\005 \001(\01622.google.clou" + + "d.dialogflow.v2.SuggestionInput.ActionB\004\342A\001\001\0223\n" + "\tsend_time\030\007 \001(\0132\032.google.protobuf.TimestampB\004\342A\001\001\"E\n" + "\006Action\022\026\n" + "\022ACTION_UNSPECIFIED\020\000\022\n\n" @@ -678,11 +717,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\006REVISE\020\002\022\013\n" + "\007CONFIRM\020\003\"\315\001\n" + "\025AssistQueryParameters\022s\n" - + "\032documents_metadata_filters\030\001 \003(\0132O.google.cloud" - + ".dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\032?\n" + + "\032documents_metadata_filters\030\001 \003(\0132O.google." + + "cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\032?\n" + "\035DocumentsMetadataFiltersEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\001\"\347\001\n" + + "\005value\030\002 \001(\t:\0028\001\"\345\006\n" + + "\017ResponseMessage\022@\n" + + "\004text\030\001" + + " \001(\01320.google.cloud.dialogflow.v2.ResponseMessage.TextH\000\022*\n" + + "\007payload\030\002 \001(\0132\027.google.protobuf.StructH\000\022Z\n" + + "\022live_agent_handoff\030\003 \001(\0132<.google.cloud.dialogflow" + + ".v2.ResponseMessage.LiveAgentHandoffH\000\022U\n" + + "\017end_interaction\030\004 \001(\0132:.google.cloud.d" + + "ialogflow.v2.ResponseMessage.EndInteractionH\000\022M\n" + + "\013mixed_audio\030\005 \001(\01326.google.clou" + + "d.dialogflow.v2.ResponseMessage.MixedAudioH\000\022d\n" + + "\027telephony_transfer_call\030\006 \001(\0132A." + + "google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallH\000\032\024\n" + + "\004Text\022\014\n" + + "\004text\030\001 \003(\t\032=\n" + + "\020LiveAgentHandoff\022)\n" + + "\010metadata\030\001 \001(\0132\027.google.protobuf.Struct\032\020\n" + + "\016EndInteraction\032\271\001\n\n" + + "MixedAudio\022P\n" + + "\010segments\030\001 \003" + + "(\0132>.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment\032Y\n" + + "\007Segment\022\017\n" + + "\005audio\030\001 \001(\014H\000\022\r\n" + + "\003uri\030\002 \001(\tH\000\022#\n" + + "\033allow_playback_interruption\030\003 \001(\010B\t\n" + + "\007content\032N\n" + + "\025TelephonyTransferCall\022\026\n" + + "\014phone_number\030\001 \001(\tH\000\022\021\n" + + "\007sip_uri\030\002 \001(\tH\000B\n\n" + + "\010endpointB\t\n" + + "\007message\"\347\001\n" + "\035SuggestKnowledgeAssistRequest\022>\n" + "\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n" + "%dialogflow.googleapis.com/Participant\022B\n" @@ -691,22 +760,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\014context_size\030\003 \001(\005B\004\342A\001\001\022&\n" + "\030previous_suggested_query\030\004 \001(\tB\004\342A\001\001\"\255\002\n" + "\036SuggestKnowledgeAssistResponse\022X\n" - + "\027knowledge_assist_answer\030\001 \001(\01321.goog" - + "le.cloud.dialogflow.v2.KnowledgeAssistAnswerB\004\342A\001\003\022\026\n" + + "\027knowledge_assist_answer\030\001 \001(\01321.google." + + "cloud.dialogflow.v2.KnowledgeAssistAnswerB\004\342A\001\003\022\026\n" + "\016latest_message\030\002 \001(\t\022\024\n" + "\014context_size\030\003 \001(\005\022\202\001\n" - + "\"additional_suggested_query_results\030\004 \003(\0132P.google.cloud.dia" - + "logflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\004\342A\001\001\"\271\005\n" + + "\"additional_suggested_query_results\030\004 \003(\0132P.google.cloud.dialog" + + "flow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\004\342A\001\001\"\271\005\n" + "!IngestedContextReferenceDebugInfo\022\037\n" + "\027project_not_allowlisted\030\001 \001(\010\022#\n" + "\033context_reference_retrieved\030\002 \001(\010\022\200\001\n" - + "\036ingested_parameters_debug_info\030\003 \003(\0132X.google.cloud.dialog" - + "flow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\032\312\003\n" + + "\036ingested_parameters_debug_info\030\003 \003(\0132X.google.cloud.dialogflo" + + "w.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\032\312\003\n" + "\032IngestedParameterDebugInfo\022\021\n" + "\tparameter\030\001 \001(\t\022\202\001\n" - + "\020ingestion_status\030\002 \001(\0162h.google.cloud" - + ".dialogflow.v2.IngestedContextReferenceD" - + "ebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\223\002\n" + + "\020ingestion_status\030\002 \001(\0162h.google.cloud.di" + + "alogflow.v2.IngestedContextReferenceDebu" + + "gInfo.IngestedParameterDebugInfo.IngestionStatus\"\223\002\n" + "\017IngestionStatus\022 \n" + "\034INGESTION_STATUS_UNSPECIFIED\020\000\022\036\n" + "\032INGESTION_STATUS_SUCCEEDED\020\001\022*\n" @@ -716,29 +785,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\037INGESTION_STATUS_INVALID_FORMAT\020\005\022&\n" + "\"INGESTION_STATUS_LANGUAGE_MISMATCH\020\006\"\227\002\n" + "\016ServiceLatency\022e\n" - + "\032internal_service_latencies\030\001 \003(\0132A.google.cloud." - + "dialogflow.v2.ServiceLatency.InternalServiceLatency\032\235\001\n" + + "\032internal_service_latencies\030\001 \003(\0132A.google.cloud.dia" + + "logflow.v2.ServiceLatency.InternalServiceLatency\032\235\001\n" + "\026InternalServiceLatency\022\014\n" + "\004step\030\001 \001(\t\022\022\n\n" + "latency_ms\030\002 \001(\002\022.\n\n" - + "start_time\030\003 \001(\0132\032.google.protobuf.Timestamp\0221\n\r" + + "start_time\030\003 \001(\0132\032.google.protobuf.Timestamp\0221\n" + + "\r" + "complete_time\030\004 \001(\0132\032.google.protobuf.Timestamp\"\223\023\n" + "\030KnowledgeAssistDebugInfo\022z\n" - + "\037query_generation_failure_reason\030\001 \001(" - + "\0162Q.google.cloud.dialogflow.v2.Knowledge" - + "AssistDebugInfo.QueryGenerationFailureReason\022\202\001\n" - + "#query_categorization_failure_reason\030\002 \001(\0162U.google.cloud.dialogflow.v2." - + "KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\022V\n" + + "\037query_generation_failure_reason\030\001 \001(\0162Q" + + ".google.cloud.dialogflow.v2.KnowledgeAss" + + "istDebugInfo.QueryGenerationFailureReason\022\202\001\n" + + "#query_categorization_failure_reason\030\002" + + " \001(\0162U.google.cloud.dialogflow.v2.Kno" + + "wledgeAssistDebugInfo.QueryCategorizationFailureReason\022V\n" + "\031datastore_response_reason\030\003" + " \001(\01623.google.cloud.dialogflow.v2.DatastoreResponseReason\022o\n" - + "\031knowledge_assist_behavior\030\004 \001(\0132L.google.cloud.dial" - + "ogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\022l\n" - + "%ingested_context_reference_debug_info\030\005 \001(\0132=.google.cloud" - + ".dialogflow.v2.IngestedContextReferenceDebugInfo\022C\n" + + "\031knowledge_assist_behavior\030\004 \001(\0132L.google.cloud.dialogf" + + "low.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\022l\n" + + "%ingested_context_reference_debug_info\030\005 \001(\0132=.google.cloud.di" + + "alogflow.v2.IngestedContextReferenceDebugInfo\022C\n" + "\017service_latency\030\006" + " \001(\0132*.google.cloud.dialogflow.v2.ServiceLatency\022r\n" - + "\033query_generation_debug_info\030\007 \001(\0132M.goo" - + "gle.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\022/\n" + + "\033query_generation_debug_info\030\007 \001(\0132M.google" + + ".cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\022/\n" + "\016ces_debug_info\030\010 \001(\0132\027.google.protobuf.Struct\032\271\005\n" + "\027KnowledgeAssistBehavior\022%\n" + "\035answer_generation_rewriter_on\030\001 \001(\010\022\"\n" @@ -772,7 +843,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\020\000\022!\n" + "\035QUERY_GENERATION_OUT_OF_QUOTA\020\001\022\033\n" + "\027QUERY_GENERATION_FAILED\020\002\022\'\n" - + "#QUERY_GENERATION_NO_QUERY_GENERATED\020\003\022\037\n" + + "#QUERY_GENERATION_NO_Q", + "UERY_GENERATED\020\003\022\037\n" + "\033QUERY_GENERATION_RAI_FAILED\020\004\022\024\n" + "\020NOT_IN_ALLOWLIST\020\005\022#\n" + "\037QUERY_GENERATION_QUERY_REDACTED\020\006\022.\n" @@ -788,41 +860,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\020\002\022\037\n" + "\033QUERY_CATEGORIZATION_FAILED\020\003\"\306\014\n" + "\025KnowledgeAssistAnswer\022Y\n" - + "\017suggested_query\030\001 \001(\0132@.g" - + "oogle.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\022a\n" - + "\026suggested_query_answer\030\002 \001(\0132A.google.cloud.dialogflow" - + ".v2.KnowledgeAssistAnswer.KnowledgeAnswer\022\025\n\r" + + "\017suggested_query\030\001 \001(\0132@.goog" + + "le.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\022a\n" + + "\026suggested_query_answer\030\002 \001(\0132A.google.cloud.dialogflow.v2" + + ".KnowledgeAssistAnswer.KnowledgeAnswer\022\025\n\r" + "answer_record\030\003 \001(\t\022Y\n" + "\033knowledge_assist_debug_info\030\007" + " \001(\01324.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\032\314\001\n" + "\016SuggestedQuery\022\022\n\n" + "query_text\030\001 \001(\t\022m\n" - + "\017search_contexts\030\004 \003(\0132N.google.cloud.dialo" - + "gflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\004\342A\001\001\0327\n\r" + + "\017search_contexts\030\004 \003(\0132N.google.cloud.dialogfl" + + "ow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\004\342A\001\001\0327\n\r" + "SearchContext\022\021\n" + "\003key\030\001 \001(\tB\004\342A\001\001\022\023\n" + "\005value\030\002 \001(\tB\004\342A\001\001\032\311\001\n" + "\036AdditionalSuggestedQueryResult\022_\n" - + "\017suggested_query\030\001 \001(\0132@.google.cloud.di" - + "alogflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\004\342A\001\003\022F\n\r" - + "answer_record\030\005 \001(\tB/\342", - "A\001\003\372A(\n" + + "\017suggested_query\030\001 \001(\0132@.google.cloud.dialo" + + "gflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\004\342A\001\003\022F\n\r" + + "answer_record\030\005 \001(\tB/\342A\001\003\372A(\n" + "&dialogflow.googleapis.com/AnswerRecord\032\341\006\n" + "\017KnowledgeAnswer\022\023\n" + "\013answer_text\030\001 \001(\t\022a\n\n" - + "faq_source\030\003 \001(\0132K.google.clo" - + "ud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\000\022o\n" - + "\021generative_source\030\004 \001(\0132R.google.cloud.dialogflow." - + "v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\000\022m\n" - + "\017playbook_source\030\007 \001(\0132R.google.cloud.dialogflow.v2.Knowle" - + "dgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\000\022e\n" - + "\014event_source\030\010 \001(\0132M.googl" - + "e.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\000\032\035\n" + + "faq_source\030\003 \001(\0132K.google.cloud." + + "dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\000\022o\n" + + "\021generative_source\030\004 \001(\0132R.google.cloud.dialogflow.v2." + + "KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\000\022m\n" + + "\017playbook_source\030\007 \001(\0132R.google.cloud.dialogflow.v2.Knowledge" + + "AssistAnswer.KnowledgeAnswer.GenerativeSourceH\000\022e\n" + + "\014event_source\030\010 \001(\0132M.google.c" + + "loud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\000\032\035\n" + "\tFaqSource\022\020\n" + "\010question\030\002 \001(\t\032\340\001\n" + "\020GenerativeSource\022l\n" - + "\010snippets\030\001 \003(\0132Z.google.cloud.d" - + "ialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\032^\n" + + "\010snippets\030\001 \003(\0132Z.google.cloud.dial" + + "ogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\032^\n" + "\007Snippet\022\013\n" + "\003uri\030\002 \001(\t\022\014\n" + "\004text\030\003 \001(\t\022\r\n" @@ -830,29 +901,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010metadata\030\005 \001(\0132\027.google.protobuf.Struct\032\202\001\n" + "\013EventSource\022\r\n" + "\005event\030\001 \001(\t\022d\n" - + "\010snippets\030\002 \001(\0132R.google.cloud.dial" - + "ogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\010\n" + + "\010snippets\030\002 \001(\0132R.google.cloud.dialogf" + + "low.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\010\n" + "\006source\"\245\002\n" + ",StreamingReactiveCompanionSuggestionsRequest\022C\n" + "\013participant\030\001 \001(\tB.\342A\001\002\372A\'\n" + "%dialogflow.googleapis.com/Participant\022\024\n\n" + "text_input\030\002 \001(\tH\000\022H\n" - + "\025cancel_reactive_query\030\003" - + " \001(\0132\'.google.cloud.dialogflow.v2.CancelQueryH\000\022G\n" - + "\020suggestion_input\030\005 \001(\0132+.goo" - + "gle.cloud.dialogflow.v2.SuggestionInputH\000B\007\n" + + "\025cancel_reactive_query\030\003 \001" + + "(\0132\'.google.cloud.dialogflow.v2.CancelQueryH\000\022G\n" + + "\020suggestion_input\030\005 \001(\0132+.google" + + ".cloud.dialogflow.v2.SuggestionInputH\000B\007\n" + "\005input\"\r\n" + "\013CancelQuery\"\337\005\n" + "-StreamingReactiveCompanionSuggestionsResponse\022\030\n" + "\016response_chunk\030\001 \001(\tH\000\022$\n" + "\006status\030\003 \001(\0132\022.google.rpc.StatusH\000\022\214\001\n" - + "\034reactive_mode_final_response\030\006 \001(\0132^.google.cloud.dialog" - + "flow.v2.StreamingReactiveCompanionSugges" - + "tionsResponse.ReactiveModeResponseB\004\342A\001\003H\000\022Y\n" - + "\035intermediate_tool_call_events\030\007 \001(" - + "\0132*.google.cloud.dialogflow.v2.ToolCallEventsB\004\342A\001\003H\000\022\026\n" - + "\010is_final\030\004 \001(\010B\004\342A\001\003\022F\n" - + "\r" + + "\034reactive_mode_final_response\030\006 \001(\0132^.google.cloud.dialogflo" + + "w.v2.StreamingReactiveCompanionSuggestio" + + "nsResponse.ReactiveModeResponseB\004\342A\001\003H\000\022Y\n" + + "\035intermediate_tool_call_events\030\007 \001(\0132*" + + ".google.cloud.dialogflow.v2.ToolCallEventsB\004\342A\001\003H\000\022\026\n" + + "\010is_final\030\004 \001(\010B\004\342A\001\003\022F\n\r" + "answer_record\030\005 \001(\tB/\342A\001\003\372A(\n" + "&dialogflow.googleapis.com/AnswerRecord\022\035\n" + "\017text_message_id\030\010 \001(\tB\004\342A\001\002\022-\n" @@ -860,38 +930,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\024ReactiveModeResponse\022\026\n" + "\010response\030\001 \001(\tB\004\342A\001\001\022O\n" + "\022grounding_metadata\030\002" - + " \001(\0132-.google.cloud.dialogflow.v2.GroundingMetadataB\004\342A\001\001\022H\n" - + "\n" + + " \001(\0132-.google.cloud.dialogflow.v2.GroundingMetadataB\004\342A\001\001\022H\n\n" + "tool_calls\030\003" + " \003(\0132..google.cloud.dialogflow.v2.ToolCallSuggestionB\004\342A\001\001B\n\n" - + "\010response\"\251\014\n" + + "\010response\"\205\r\n" + "\"BidiStreamingAnalyzeContentRequest\022W\n" - + "\006config\030\001 \001(\0132E.google.cloud.dialog" - + "flow.v2.BidiStreamingAnalyzeContentRequest.ConfigH\000\022U\n" - + "\005input\030\002 \001(\0132D.google.clou" - + "d.dialogflow.v2.BidiStreamingAnalyzeContentRequest.InputH\000\032\200\007\n" + + "\006config\030\001 \001(\0132E.google.cloud.dialogflo" + + "w.v2.BidiStreamingAnalyzeContentRequest.ConfigH\000\022U\n" + + "\005input\030\002 \001(\0132D.google.cloud.d" + + "ialogflow.v2.BidiStreamingAnalyzeContentRequest.InputH\000\032\334\007\n" + "\006Config\022C\n" + "\013participant\030\001 \001(\tB.\342A\001\002\372A\'\n" + "%dialogflow.googleapis.com/Participant\022x\n" - + "\024voice_session_config\030\002 \001(\0132X.google.cloud.dialogflow.v2.Bi" - + "diStreamingAnalyzeContentRequest.Config.VoiceSessionConfigH\000\022G\n" + + "\024voice_session_config\030\002 \001(\0132X.google.cloud.dialogflow.v2.BidiS" + + "treamingAnalyzeContentRequest.Config.VoiceSessionConfigH\000\022G\n" + " initial_virtual_agent_parameters\030\003" + " \001(\0132\027.google.protobuf.StructB\004\342A\001\001\022]\n" + "\"initial_virtual_agent_query_params\030\004" - + " \001(\0132+.google.cloud.dialogflow.v2.QueryParametersB\004\342A\001\001\032\204\004\n" + + " \001(\0132+.google.cloud.dialogflow.v2.QueryParametersB\004\342A\001\001\032\340\004\n" + "\022VoiceSessionConfig\022M\n" - + "\024input_audio_encoding\030\001 \001(" - + "\0162).google.cloud.dialogflow.v2.AudioEncodingB\004\342A\001\002\022+\n" + + "\024input_audio_encoding\030\001 \001(\0162)" + + ".google.cloud.dialogflow.v2.AudioEncodingB\004\342A\001\002\022+\n" + "\035input_audio_sample_rate_hertz\030\002 \001(\005B\004\342A\001\002\022T\n" - + "\025output_audio_encoding\030\003" - + " \001(\0162/.google.cloud.dialogflow.v2.OutputAudioEncodingB\004\342A\001\002\022,\n" + + "\025output_audio_encoding\030\003 " + + "\001(\0162/.google.cloud.dialogflow.v2.OutputAudioEncodingB\004\342A\001\002\022,\n" + "\036output_audio_sample_rate_hertz\030\004 \001(\005B\004\342A\001\002\022,\n" + "\036enable_cx_proactive_processing\030\005 \001(\010B\004\342A\001\001\022)\n" + "\033enable_streaming_synthesize\030\027 \001(\010B\004\342A\001\001\022_\n" - + "\021gemini_asr_config\030\030 \001(\0132>.google.cloud.d" - + "ialogflow.v2.SpeechToTextConfig.GeminiAsrConfigB\004\342A\001\001\022!\n" - + "\016use_gemini_asr\030\031 \001(\010B\004\342A\001\001H\000\210\001\001B\021\n" - + "\017_use_gemini_asrB\010\n" + + "\021gemini_asr_config\030\030 \001(\0132>.google.cloud.dial" + + "ogflow.v2.SpeechToTextConfig.GeminiAsrConfigB\004\342A\001\001\022!\n" + + "\016use_gemini_asr\030\031 \001(\010B\004\342A\001\001H\000\210\001\001\0224\n" + + "!disable_interim_input_transcripts\030\032" + + " \001(\010B\004\342A\001\001H\001\210\001\001B\021\n" + + "\017_use_gemini_asrB$\n" + + "\"_disable_interim_input_transcriptsB\010\n" + "\006config\032\205\002\n" + "\tTurnInput\022\016\n" + "\004text\030\001 \001(\tH\000\0227\n" @@ -905,21 +977,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\014main_content\032\274\001\n" + "\005Input\022\017\n" + "\005audio\030\001 \001(\014H\000\022?\n" - + "\004dtmf\030\002" - + " \001(\0132/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\000\022X\n" - + "\004turn\030\003 \001(\0132H.google.cloud.dialogflow.v2.Bid" - + "iStreamingAnalyzeContentRequest.TurnInputH\000B\007\n" + + "\004dtmf\030\002 \001(\0132/.google" + + ".cloud.dialogflow.v2.TelephonyDtmfEventsH\000\022X\n" + + "\004turn\030\003 \001(\0132H.google.cloud.dialogfl" + + "ow.v2.BidiStreamingAnalyzeContentRequest.TurnInputH\000B\007\n" + "\005inputB\t\n" + "\007request\"\321\003\n" + "#BidiStreamingAnalyzeContentResponse\022T\n" - + "\022recognition_result\030\001" - + " \001(\01326.google.cloud.dialogflow.v2.StreamingRecognitionResultH\000\022h\n" - + "\017barge_in_signal\030\002 \001(\0132M.google.cloud.dialogflow" - + ".v2.BidiStreamingAnalyzeContentResponse.BargeInSignalH\000\022V\n" + + "\022recognition_result\030\001 \001(\01326.google.cloud.dial" + + "ogflow.v2.StreamingRecognitionResultH\000\022h\n" + + "\017barge_in_signal\030\002 \001(\0132M.google.cloud.d" + + "ialogflow.v2.BidiStreamingAnalyzeContentResponse.BargeInSignalH\000\022V\n" + "\030analyze_content_response\030\003" + " \001(\01322.google.cloud.dialogflow.v2.AnalyzeContentResponseH\000\022e\n\r" - + "turn_complete\030\004 \001(\0132L.google.cloud.dialogflow.v2.Bidi" - + "StreamingAnalyzeContentResponse.TurnCompleteH\000\032\017\n\r" + + "turn_complete\030\004 \001(\0132L.google.cloud.dialogflo" + + "w.v2.BidiStreamingAnalyzeContentResponse.TurnCompleteH\000\032\017\n\r" + "BargeInSignal\032\016\n" + "\014TurnCompleteB\n\n" + "\010response*\326\002\n" @@ -935,76 +1007,77 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\034ANSWER_GENERATION_RAI_FAILED\020\010\022\"\n" + "\036ANSWER_GENERATION_NOT_GROUNDED\020\t2\346\033\n" + "\014Participants\022\245\002\n" - + "\021CreateParticipant\0224.google.cloud.dialogflow.v2.CreateParticipa" - + "ntRequest\032\'.google.cloud.dialogflow.v2.P" - + "articipant\"\260\001\332A\022parent,participant\202\323\344\223\002\224" - + "\001\"4/v2/{parent=projects/*/conversations/" - + "*}/participants:\013participantZO\"@/v2/{par" - + "ent=projects/*/locations/*/conversations/*}/participants:\013participant\022\366\001\n" - + "\016GetParticipant\0221.google.cloud.dialogflow.v2.Ge" - + "tParticipantRequest\032\'.google.cloud.dialo" - + "gflow.v2.Participant\"\207\001\332A\004name\202\323\344\223\002z\0224/v" - + "2/{name=projects/*/conversations/*/participants/*}ZB\022@/v2/{name=projects/*/locat" - + "ions/*/conversations/*/participants/*}\022\211\002\n" - + "\020ListParticipants\0223.google.cloud.dialo" - + "gflow.v2.ListParticipantsRequest\0324.google.cloud.dialogflow.v2.ListParticipantsRe" - + "sponse\"\211\001\332A\006parent\202\323\344\223\002z\0224/v2/{parent=pr" - + "ojects/*/conversations/*}/participantsZB" - + "\022@/v2/{parent=projects/*/locations/*/conversations/*}/participants\022\302\002\n" - + "\021UpdateParticipant\0224.google.cloud.dialogflow.v2.Up" - + "dateParticipantRequest\032\'.google.cloud.di" - + "alogflow.v2.Participant\"\315\001\332A\027participant" - + ",update_mask\202\323\344\223\002\254\0012@/v2/{participant.na" - + "me=projects/*/conversations/*/participants/*}:\013participantZ[2L/v2/{participant.n" - + "ame=projects/*/locations/*/conversations/*/participants/*}:\013participant\022\372\002\n" - + "\016AnalyzeContent\0221.google.cloud.dialogflow.v2." - + "AnalyzeContentRequest\0322.google.cloud.dia" - + "logflow.v2.AnalyzeContentResponse\"\200\002\332A\026p" - + "articipant,text_input\332A\027participant,even" - + "t_input\332A\027participant,audio_input\202\323\344\223\002\254\001" - + "\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\001*Z" - + "[\"V/v2/{participant=projects/*/locations" - + "/*/conversations/*/participants/*}:analyzeContent:\001*\022\230\001\n" - + "\027StreamingAnalyzeContent\022:.google.cloud.dialogflow.v2.StreamingA" - + "nalyzeContentRequest\032;.google.cloud.dial" - + "ogflow.v2.StreamingAnalyzeContentResponse\"\000(\0010\001\022\244\001\n" - + "\033BidiStreamingAnalyzeContent\022>.google.cloud.dialogflow.v2.BidiStreami" - + "ngAnalyzeContentRequest\032?.google.cloud.d" - + "ialogflow.v2.BidiStreamingAnalyzeContentResponse\"\000(\0010\001\022\302\001\n" - + "%StreamingReactiveCompanionSuggestions\022H.google.cloud.dialogfl" - + "ow.v2.StreamingReactiveCompanionSuggestionsRequest\032I.google.cloud.dialogflow.v2." - + "StreamingReactiveCompanionSuggestionsResponse\"\000(\0010\001\022\311\002\n" - + "\017SuggestArticles\0222.google.cloud.dialogflow.v2.SuggestArticlesRequ" - + "est\0323.google.cloud.dialogflow.v2.Suggest" - + "ArticlesResponse\"\314\001\332A\006parent\202\323\344\223\002\274\001\"R/v2" - + "/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:" - + "\001*Zc\"^/v2/{parent=projects/*/locations/*" - + "/conversations/*/participants/*}/suggestions:suggestArticles:\001*\022\323\002\n" - + "\021SuggestFaqAnswers\0224.google.cloud.dialogflow.v2.Sugge" - + "stFaqAnswersRequest\0325.google.cloud.dialo" - + "gflow.v2.SuggestFaqAnswersResponse\"\320\001\332A\006" - + "parent\202\323\344\223\002\300\001\"T/v2/{parent=projects/*/co" - + "nversations/*/participants/*}/suggestions:suggestFaqAnswers:\001*Ze\"`/v2/{parent=pr" - + "ojects/*/locations/*/conversations/*/par" - + "ticipants/*}/suggestions:suggestFaqAnswers:\001*\022\335\002\n" - + "\023SuggestSmartReplies\0226.google.cloud.dialogflow.v2.SuggestSmartRepliesRe" - + "quest\0327.google.cloud.dialogflow.v2.Sugge" - + "stSmartRepliesResponse\"\324\001\332A\006parent\202\323\344\223\002\304" - + "\001\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSma" - + "rtReplies:\001*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/" - + "*}/suggestions:suggestSmartReplies:\001*\022\343\002\n" - + "\026SuggestKnowledgeAssist\0229.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequ" - + "est\032:.google.cloud.dialogflow.v2.Suggest" - + "KnowledgeAssistResponse\"\321\001\202\323\344\223\002\312\001\"Y/v2/{" - + "parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAs" - + "sist:\001*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/su" - + "ggestions:suggestKnowledgeAssist:\001*\032x\312A\031" - + "dialogflow.googleapis.com\322AYhttps://www.googleapis.com/auth/cloud-platform,https" - + "://www.googleapis.com/auth/dialogflowB\226\001\n" - + "\036com.google.cloud.dialogflow.v2B\020Partic" - + "ipantProtoP\001Z>cloud.google.com/go/dialog" - + "flow/apiv2/dialogflowpb;dialogflowpb\242\002\002D" - + "F\252\002\032Google.Cloud.Dialogflow.V2b\006proto3" + + "\021CreateParticipant\0224.google.cloud.dialogflow.v2.Create" + + "ParticipantRequest\032\'.google.cloud.dialog" + + "flow.v2.Participant\"\260\001\332A\022parent,particip" + + "ant\202\323\344\223\002\224\001\"4/v2/{parent=projects/*/conve" + + "rsations/*}/participants:\013participantZO\"@/v2/{parent=projects/*/locations/*/conv" + + "ersations/*}/participants:\013participant\022\366\001\n" + + "\016GetParticipant\0221.google.cloud.dialogf" + + "low.v2.GetParticipantRequest\032\'.google.cl" + + "oud.dialogflow.v2.Participant\"\207\001\332A\004name\202" + + "\323\344\223\002z\0224/v2/{name=projects/*/conversation" + + "s/*/participants/*}ZB\022@/v2/{name=project" + + "s/*/locations/*/conversations/*/participants/*}\022\211\002\n" + + "\020ListParticipants\0223.google.cloud.dialogflow.v2.ListParticipantsReques" + + "t\0324.google.cloud.dialogflow.v2.ListParti" + + "cipantsResponse\"\211\001\332A\006parent\202\323\344\223\002z\0224/v2/{" + + "parent=projects/*/conversations/*}/parti" + + "cipantsZB\022@/v2/{parent=projects/*/locations/*/conversations/*}/participants\022\302\002\n" + + "\021UpdateParticipant\0224.google.cloud.dialogf" + + "low.v2.UpdateParticipantRequest\032\'.google" + + ".cloud.dialogflow.v2.Participant\"\315\001\332A\027pa" + + "rticipant,update_mask\202\323\344\223\002\254\0012@/v2/{parti" + + "cipant.name=projects/*/conversations/*/participants/*}:\013participantZ[2L/v2/{part" + + "icipant.name=projects/*/locations/*/conv" + + "ersations/*/participants/*}:\013participant\022\372\002\n" + + "\016AnalyzeContent\0221.google.cloud.dialogflow.v2.AnalyzeContentRequest\0322.google." + + "cloud.dialogflow.v2.AnalyzeContentRespon" + + "se\"\200\002\332A\026participant,text_input\332A\027partici" + + "pant,event_input\332A\027participant,audio_inp" + + "ut\202\323\344\223\002\254\001\"J/v2/{participant=projects/*/c" + + "onversations/*/participants/*}:analyzeContent:\001*Z[\"V/v2/{participant=projects/*/" + + "locations/*/conversations/*/participants/*}:analyzeContent:\001*\022\230\001\n" + + "\027StreamingAnalyzeContent\022:.google.cloud.dialogflow.v2.S" + + "treamingAnalyzeContentRequest\032;.google.c" + + "loud.dialogflow.v2.StreamingAnalyzeContentResponse\"\000(\0010\001\022\244\001\n" + + "\033BidiStreamingAnalyzeContent\022>.google.cloud.dialogflow.v2.Bi" + + "diStreamingAnalyzeContentRequest\032?.googl" + + "e.cloud.dialogflow.v2.BidiStreamingAnalyzeContentResponse\"\000(\0010\001\022\302\001\n" + + "%StreamingReactiveCompanionSuggestions\022H.google.cloud" + + ".dialogflow.v2.StreamingReactiveCompanionSuggestionsRequest\032I.google.cloud.dialo" + + "gflow.v2.StreamingReactiveCompanionSuggestionsResponse\"\000(\0010\001\022\311\002\n" + + "\017SuggestArticles\0222.google.cloud.dialogflow.v2.SuggestArt" + + "iclesRequest\0323.google.cloud.dialogflow.v" + + "2.SuggestArticlesResponse\"\314\001\332A\006parent\202\323\344" + + "\223\002\274\001\"R/v2/{parent=projects/*/conversatio" + + "ns/*/participants/*}/suggestions:suggestArticles:\001*Zc\"^/v2/{parent=projects/*/lo" + + "cations/*/conversations/*/participants/*}/suggestions:suggestArticles:\001*\022\323\002\n" + + "\021SuggestFaqAnswers\0224.google.cloud.dialogflow" + + ".v2.SuggestFaqAnswersRequest\0325.google.cloud.dialogflow.v2.SuggestFaqAnswersRespo" + + "nse\"\320\001\332A\006parent\202\323\344\223\002\300\001\"T/v2/{parent=proj" + + "ects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\001*Ze\"`/v2/{" + + "parent=projects/*/locations/*/conversati" + + "ons/*/participants/*}/suggestions:suggestFaqAnswers:\001*\022\335\002\n" + + "\023SuggestSmartReplies\0226.google.cloud.dialogflow.v2.SuggestSmart" + + "RepliesRequest\0327.google.cloud.dialogflow" + + ".v2.SuggestSmartRepliesResponse\"\324\001\332A\006par" + + "ent\202\323\344\223\002\304\001\"V/v2/{parent=projects/*/conve" + + "rsations/*/participants/*}/suggestions:suggestSmartReplies:\001*Zg\"b/v2/{parent=pro" + + "jects/*/locations/*/conversations/*/part" + + "icipants/*}/suggestions:suggestSmartReplies:\001*\022\343\002\n" + + "\026SuggestKnowledgeAssist\0229.google.cloud.dialogflow.v2.SuggestKnowledgeA" + + "ssistRequest\032:.google.cloud.dialogflow.v" + + "2.SuggestKnowledgeAssistResponse\"\321\001\202\323\344\223\002" + + "\312\001\"Y/v2/{parent=projects/*/conversations" + + "/*/participants/*}/suggestions:suggestKnowledgeAssist:\001*Zj\"e/v2/{parent=projects" + + "/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssis" + + "t:\001*\032x\312A\031dialogflow.googleapis.com\322AYhtt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm,https://www.googleapis.com/auth/dialogflowB\226\001\n" + + "\036com.google.cloud.dialogflow.v2B\020ParticipantProtoP\001Z>cloud.google.com/" + + "go/dialogflow/apiv2/dialogflowpb;dialogf" + + "lowpb\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -1053,6 +1126,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Content", + "ResponseMessages", "LanguageCode", "Participant", "ParticipantRole", @@ -1326,9 +1400,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_cloud_dialogflow_v2_AutomatedAgentReply_descriptor, new java.lang.String[] { "DetectIntentResponse", + "ResponseMessages", + "Intent", + "Event", + "MatchConfidence", + "Parameters", "AutomatedAgentReplyType", "AllowCancellation", "CxCurrentPage", + "CallCompanionAuthCode", }); internal_static_google_cloud_dialogflow_v2_ArticleAnswer_descriptor = getDescriptor().getMessageType(26); @@ -1450,8 +1530,69 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); - internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistRequest_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor = getDescriptor().getMessageType(37); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor, + new java.lang.String[] { + "Text", + "Payload", + "LiveAgentHandoff", + "EndInteraction", + "MixedAudio", + "TelephonyTransferCall", + "Message", + }); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor.getNestedType(0); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor, + new java.lang.String[] { + "Text", + }); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor.getNestedType(1); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor, + new java.lang.String[] { + "Metadata", + }); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor.getNestedType(2); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor.getNestedType(3); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor, + new java.lang.String[] { + "Segments", + }); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor + .getNestedType(0); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor, + new java.lang.String[] { + "Audio", "Uri", "AllowPlaybackInterruption", "Content", + }); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor = + internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor.getNestedType(4); + internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor, + new java.lang.String[] { + "PhoneNumber", "SipUri", "Endpoint", + }); + internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistRequest_descriptor = + getDescriptor().getMessageType(38); internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistRequest_descriptor, @@ -1459,7 +1600,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "LatestMessage", "ContextSize", "PreviousSuggestedQuery", }); internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistResponse_descriptor = - getDescriptor().getMessageType(38); + getDescriptor().getMessageType(39); internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestKnowledgeAssistResponse_descriptor, @@ -1470,7 +1611,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AdditionalSuggestedQueryResults", }); internal_static_google_cloud_dialogflow_v2_IngestedContextReferenceDebugInfo_descriptor = - getDescriptor().getMessageType(39); + getDescriptor().getMessageType(40); internal_static_google_cloud_dialogflow_v2_IngestedContextReferenceDebugInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_IngestedContextReferenceDebugInfo_descriptor, @@ -1487,7 +1628,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parameter", "IngestionStatus", }); internal_static_google_cloud_dialogflow_v2_ServiceLatency_descriptor = - getDescriptor().getMessageType(40); + getDescriptor().getMessageType(41); internal_static_google_cloud_dialogflow_v2_ServiceLatency_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_ServiceLatency_descriptor, @@ -1503,7 +1644,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Step", "LatencyMs", "StartTime", "CompleteTime", }); internal_static_google_cloud_dialogflow_v2_KnowledgeAssistDebugInfo_descriptor = - getDescriptor().getMessageType(41); + getDescriptor().getMessageType(42); internal_static_google_cloud_dialogflow_v2_KnowledgeAssistDebugInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_KnowledgeAssistDebugInfo_descriptor, @@ -1558,7 +1699,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SimilarityToLastQueryThreshold", }); internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_descriptor = - getDescriptor().getMessageType(42); + getDescriptor().getMessageType(43); internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_KnowledgeAssistAnswer_descriptor, @@ -1643,7 +1784,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Event", "Snippets", }); internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsRequest_descriptor = - getDescriptor().getMessageType(43); + getDescriptor().getMessageType(44); internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsRequest_descriptor, @@ -1651,13 +1792,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Participant", "TextInput", "CancelReactiveQuery", "SuggestionInput", "Input", }); internal_static_google_cloud_dialogflow_v2_CancelQuery_descriptor = - getDescriptor().getMessageType(44); + getDescriptor().getMessageType(45); internal_static_google_cloud_dialogflow_v2_CancelQuery_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_CancelQuery_descriptor, new java.lang.String[] {}); internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsResponse_descriptor = - getDescriptor().getMessageType(45); + getDescriptor().getMessageType(46); internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_StreamingReactiveCompanionSuggestionsResponse_descriptor, @@ -1682,7 +1823,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Response", "GroundingMetadata", "ToolCalls", }); internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentRequest_descriptor = - getDescriptor().getMessageType(46); + getDescriptor().getMessageType(47); internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentRequest_descriptor, @@ -1717,6 +1858,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EnableStreamingSynthesize", "GeminiAsrConfig", "UseGeminiAsr", + "DisableInterimInputTranscripts", }); internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentRequest_TurnInput_descriptor = internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentRequest_descriptor @@ -1737,7 +1879,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Audio", "Dtmf", "Turn", "Input", }); internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentResponse_descriptor = - getDescriptor().getMessageType(47); + getDescriptor().getMessageType(48); internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_BidiStreamingAnalyzeContentResponse_descriptor, diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessage.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessage.java new file mode 100644 index 000000000000..1210b8e10a23 --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessage.java @@ -0,0 +1,7520 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/dialogflow/v2/participant.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * Response messages from an automated agent.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage} + */ +@com.google.protobuf.Generated +public final class ResponseMessage extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage) + ResponseMessageOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "ResponseMessage"); + } + + // Use ResponseMessage.newBuilder() to construct. + private ResponseMessage(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResponseMessage() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.class, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder.class); + } + + public interface TextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.Text) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + java.util.List getTextList(); + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + int getTextCount(); + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + java.lang.String getText(int index); + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + com.google.protobuf.ByteString getTextBytes(int index); + } + + /** + * + * + *
+   * The text response message.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.Text} + */ + public static final class Text extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.Text) + TextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "Text"); + } + + // Use Text.newBuilder() to construct. + private Text(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Text() { + text_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.Text.class, + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList text_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + return text_; + } + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + + /** + * + * + *
+     * A collection of text response variants. If multiple variants are
+     * defined, only one text response variant is returned at runtime.
+     * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < text_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, text_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < text_.size(); i++) { + dataSize += computeStringSizeNoTag(text_.getRaw(i)); + } + size += dataSize; + size += 1 * getTextList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.Text)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.Text other = + (com.google.cloud.dialogflow.v2.ResponseMessage.Text) obj; + + if (!getTextList().equals(other.getTextList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTextCount() > 0) { + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getTextList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.Text prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * The text response message.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.Text} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.Text) + com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.Text.class, + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.ResponseMessage.Text.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_Text_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text build() { + com.google.cloud.dialogflow.v2.ResponseMessage.Text result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.Text result = + new com.google.cloud.dialogflow.v2.ResponseMessage.Text(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.dialogflow.v2.ResponseMessage.Text result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + text_.makeImmutable(); + result.text_ = text_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.Text) { + return mergeFrom((com.google.cloud.dialogflow.v2.ResponseMessage.Text) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.ResponseMessage.Text other) { + if (other == com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance()) + return this; + if (!other.text_.isEmpty()) { + if (text_.isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + } else { + ensureTextIsMutable(); + text_.addAll(other.text_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTextIsMutable(); + text_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList text_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTextIsMutable() { + if (!text_.isModifiable()) { + text_ = new com.google.protobuf.LazyStringArrayList(text_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @return A list containing the text. + */ + public com.google.protobuf.ProtocolStringList getTextList() { + text_.makeImmutable(); + return text_; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @return The count of text. + */ + public int getTextCount() { + return text_.size(); + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param index The index of the element to return. + * @return The text at the given index. + */ + public java.lang.String getText(int index) { + return text_.get(index); + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param index The index of the value to return. + * @return The bytes of the text at the given index. + */ + public com.google.protobuf.ByteString getTextBytes(int index) { + return text_.getByteString(index); + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param index The index to set the value at. + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param value The text to add. + * @return This builder for chaining. + */ + public Builder addText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextIsMutable(); + text_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param values The text to add. + * @return This builder for chaining. + */ + public Builder addAllText(java.lang.Iterable values) { + ensureTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, text_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * A collection of text response variants. If multiple variants are
+       * defined, only one text response variant is returned at runtime.
+       * 
+ * + * repeated string text = 1; + * + * @param value The bytes of the text to add. + * @return This builder for chaining. + */ + public Builder addTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTextIsMutable(); + text_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.Text) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.Text) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.Text DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.Text(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.Text getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Text parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LiveAgentHandoffOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + } + + /** + * + * + *
+   * Indicates that the conversation should be handed off to a human agent.
+   *
+   * Dialogflow only uses this to determine which conversations were handed off
+   * to a human agent for measurement purposes. What else to do with this signal
+   * is up to you and your handoff procedures.
+   *
+   * You may set this, for example:
+   *
+   * * In the entry fulfillment of a CX Page if entering the page indicates
+   * something went extremely wrong in the conversation.
+   * * In a webhook response when you determine that the customer issue can only
+   * be handled by a human.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff} + */ + public static final class LiveAgentHandoff extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) + LiveAgentHandoffOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "LiveAgentHandoff"); + } + + // Use LiveAgentHandoff.newBuilder() to construct. + private LiveAgentHandoff(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LiveAgentHandoff() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.class, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder.class); + } + + private int bitField0_; + public static final int METADATA_FIELD_NUMBER = 1; + private com.google.protobuf.Struct metadata_; + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + /** + * + * + *
+     * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+     * any structure on this.
+     * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff other = + (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) obj; + + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Indicates that the conversation should be handed off to a human agent.
+     *
+     * Dialogflow only uses this to determine which conversations were handed off
+     * to a human agent for measurement purposes. What else to do with this signal
+     * is up to you and your handoff procedures.
+     *
+     * You may set this, for example:
+     *
+     * * In the entry fulfillment of a CX Page if entering the page indicates
+     * something went extremely wrong in the conversation.
+     * * In a webhook response when you determine that the customer issue can only
+     * be handled by a human.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.class, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_LiveAgentHandoff_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff build() { + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff result = + new com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) { + return mergeFrom((com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff other) { + if (other + == com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance()) + return this; + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + metadataBuilder_; + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + * + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && metadata_ != null + && metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + + /** + * + * + *
+       * Custom metadata for your handoff procedure. Dialogflow doesn't impose
+       * any structure on this.
+       * 
+ * + * .google.protobuf.Struct metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LiveAgentHandoff parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EndInteractionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Indicates that interaction with the Dialogflow agent has ended.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.EndInteraction} + */ + public static final class EndInteraction extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) + EndInteractionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "EndInteraction"); + } + + // Use EndInteraction.newBuilder() to construct. + private EndInteraction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EndInteraction() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction other = + (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Indicates that interaction with the Dialogflow agent has ended.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.EndInteraction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_EndInteraction_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction build() { + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction result = + new com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) { + return mergeFrom((com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction other) { + if (other + == com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EndInteraction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MixedAudioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List + getSegmentsList(); + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment getSegments(int index); + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + int getSegmentsCount(); + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List< + ? extends com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList(); + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder getSegmentsOrBuilder( + int index); + } + + /** + * + * + *
+   * Represents an audio message that is composed of both segments
+   * synthesized from the Dialogflow agent prompts and ones hosted externally
+   * at the specified URIs.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.MixedAudio} + */ + public static final class MixedAudio extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) + MixedAudioOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "MixedAudio"); + } + + // Use MixedAudio.newBuilder() to construct. + private MixedAudio(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MixedAudio() { + segments_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder.class); + } + + public interface SegmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return Whether the audio field is set. + */ + boolean hasAudio(); + + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + com.google.protobuf.ByteString getAudio(); + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return The uri. + */ + java.lang.String getUri(); + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+       * Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + boolean getAllowPlaybackInterruption(); + + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.ContentCase + getContentCase(); + } + + /** + * + * + *
+     * Represents one segment of audio.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment} + */ + public static final class Segment extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) + SegmentOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "Segment"); + } + + // Use Segment.newBuilder() to construct. + private Segment(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Segment() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder.class); + } + + private int contentCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUDIO(1), + URI(2), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 1: + return AUDIO; + case 2: + return URI; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public static final int AUDIO_FIELD_NUMBER = 1; + + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return contentCase_ == 1; + } + + /** + * + * + *
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
+       * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int URI_FIELD_NUMBER = 2; + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return contentCase_ == 2; + } + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 2) { + content_ = s; + } + return s; + } + } + + /** + * + * + *
+       * Client-specific URI that points to an audio clip accessible to the
+       * client.
+       * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 3; + private boolean allowPlaybackInterruption_ = false; + + /** + * + * + *
+       * Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, content_); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(3, allowPlaybackInterruption_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, content_); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowPlaybackInterruption_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment other = + (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) obj; + + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; + if (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 1: + if (!getAudio().equals(other.getAudio())) return false; + break; + case 2: + if (!getUri().equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + switch (contentCase_) { + case 1: + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * Represents one segment of audio.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowPlaybackInterruption_ = false; + contentCase_ = 0; + content_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment build() { + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment result = + new com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + } + } + + private void buildPartialOneofs( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment result) { + result.contentCase_ = contentCase_; + result.content_ = this.content_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) { + return mergeFrom( + (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment other) { + if (other + == com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()) return this; + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + switch (other.getContentCase()) { + case AUDIO: + { + setAudio(other.getAudio()); + break; + } + case URI: + { + contentCase_ = 2; + content_ = other.content_; + onChanged(); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + content_ = input.readBytes(); + contentCase_ = 1; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 2; + content_ = s; + break; + } // case 18 + case 24: + { + allowPlaybackInterruption_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return Whether the audio field is set. + */ + public boolean hasAudio() { + return contentCase_ == 1; + } + + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @param value The audio to set. + * @return This builder for chaining. + */ + public Builder setAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 1; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return This builder for chaining. + */ + public Builder clearAudio() { + if (contentCase_ == 1) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return contentCase_ == 2; + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 2) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client.
+         * 
+ * + * string uri = 2; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + + private boolean allowPlaybackInterruption_; + + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { + + allowPlaybackInterruption_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+         * Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { + bitField0_ = (bitField0_ & ~0x00000004); + allowPlaybackInterruption_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Segment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SEGMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + segments_; + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public java.util.List + getSegmentsList() { + return segments_; + } + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList() { + return segments_; + } + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public int getSegmentsCount() { + return segments_.size(); + } + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + return segments_.get(index); + } + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + return segments_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < segments_.size(); i++) { + output.writeMessage(1, segments_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, segments_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio other = + (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) obj; + + if (!getSegmentsList().equals(other.getSegmentsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Represents an audio message that is composed of both segments
+     * synthesized from the Dialogflow agent prompts and ones hosted externally
+     * at the specified URIs.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.MixedAudio} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + } else { + segments_ = null; + segmentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio build() { + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio result = + new com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio result) { + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) { + return mergeFrom((com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio other) { + if (other == com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance()) + return this; + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSegmentsFieldBuilder() + : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment m = + input.readMessage( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + .parser(), + extensionRegistry); + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(m); + } else { + segmentsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + segments_ = java.util.Collections.emptyList(); + + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + segments_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment>(segments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder> + segmentsBuilder_; + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List + getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addAllSegments( + java.lang.Iterable< + ? extends com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment> + values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, segments_); + onChanged(); + } else { + segmentsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + segmentsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + getSegmentsBuilder(int index) { + return internalGetSegmentsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder() { + return internalGetSegmentsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder(int index) { + return internalGetSegmentsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); + } + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * repeated .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder> + getSegmentsBuilderList() { + return internalGetSegmentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder> + internalGetSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.SegmentOrBuilder>( + segments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + segments_ = null; + } + return segmentsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MixedAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TelephonyTransferCallOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return Whether the phoneNumber field is set. + */ + boolean hasPhoneNumber(); + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return The phoneNumber. + */ + java.lang.String getPhoneNumber(); + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return The bytes for phoneNumber. + */ + com.google.protobuf.ByteString getPhoneNumberBytes(); + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return Whether the sipUri field is set. + */ + boolean hasSipUri(); + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return The sipUri. + */ + java.lang.String getSipUri(); + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return The bytes for sipUri. + */ + com.google.protobuf.ByteString getSipUriBytes(); + + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.EndpointCase + getEndpointCase(); + } + + /** + * + * + *
+   * Represents the signal that telles the client to transfer the phone call
+   * connected to the agent to a third-party endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall} + */ + public static final class TelephonyTransferCall extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + TelephonyTransferCallOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "TelephonyTransferCall"); + } + + // Use TelephonyTransferCall.newBuilder() to construct. + private TelephonyTransferCall(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TelephonyTransferCall() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.class, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder.class); + } + + private int endpointCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object endpoint_; + + public enum EndpointCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PHONE_NUMBER(1), + SIP_URI(2), + ENDPOINT_NOT_SET(0); + private final int value; + + private EndpointCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EndpointCase valueOf(int value) { + return forNumber(value); + } + + public static EndpointCase forNumber(int value) { + switch (value) { + case 1: + return PHONE_NUMBER; + case 2: + return SIP_URI; + case 0: + return ENDPOINT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndpointCase getEndpointCase() { + return EndpointCase.forNumber(endpointCase_); + } + + public static final int PHONE_NUMBER_FIELD_NUMBER = 1; + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return Whether the phoneNumber field is set. + */ + public boolean hasPhoneNumber() { + return endpointCase_ == 1; + } + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return The phoneNumber. + */ + public java.lang.String getPhoneNumber() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (endpointCase_ == 1) { + endpoint_ = s; + } + return s; + } + } + + /** + * + * + *
+     * Transfer the call to a phone number
+     * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+     * 
+ * + * string phone_number = 1; + * + * @return The bytes for phoneNumber. + */ + public com.google.protobuf.ByteString getPhoneNumberBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 1) { + endpoint_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIP_URI_FIELD_NUMBER = 2; + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return Whether the sipUri field is set. + */ + public boolean hasSipUri() { + return endpointCase_ == 2; + } + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return The sipUri. + */ + public java.lang.String getSipUri() { + java.lang.Object ref = ""; + if (endpointCase_ == 2) { + ref = endpoint_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (endpointCase_ == 2) { + endpoint_ = s; + } + return s; + } + } + + /** + * + * + *
+     * Transfer the call to a SIP endpoint.
+     * 
+ * + * string sip_uri = 2; + * + * @return The bytes for sipUri. + */ + public com.google.protobuf.ByteString getSipUriBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 2) { + ref = endpoint_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 2) { + endpoint_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (endpointCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, endpoint_); + } + if (endpointCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, endpoint_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endpointCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, endpoint_); + } + if (endpointCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, endpoint_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall other = + (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) obj; + + if (!getEndpointCase().equals(other.getEndpointCase())) return false; + switch (endpointCase_) { + case 1: + if (!getPhoneNumber().equals(other.getPhoneNumber())) return false; + break; + case 2: + if (!getSipUri().equals(other.getSipUri())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (endpointCase_) { + case 1: + hash = (37 * hash) + PHONE_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getPhoneNumber().hashCode(); + break; + case 2: + hash = (37 * hash) + SIP_URI_FIELD_NUMBER; + hash = (53 * hash) + getSipUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Represents the signal that telles the client to transfer the phone call
+     * connected to the agent to a third-party endpoint.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.class, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder.class); + } + + // Construct using + // com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endpointCase_ = 0; + endpoint_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_TelephonyTransferCall_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall build() { + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall result = + new com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall result) { + result.endpointCase_ = endpointCase_; + result.endpoint_ = this.endpoint_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) { + return mergeFrom( + (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall other) { + if (other + == com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance()) return this; + switch (other.getEndpointCase()) { + case PHONE_NUMBER: + { + endpointCase_ = 1; + endpoint_ = other.endpoint_; + onChanged(); + break; + } + case SIP_URI: + { + endpointCase_ = 2; + endpoint_ = other.endpoint_; + onChanged(); + break; + } + case ENDPOINT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + endpointCase_ = 1; + endpoint_ = s; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + endpointCase_ = 2; + endpoint_ = s; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int endpointCase_ = 0; + private java.lang.Object endpoint_; + + public EndpointCase getEndpointCase() { + return EndpointCase.forNumber(endpointCase_); + } + + public Builder clearEndpoint() { + endpointCase_ = 0; + endpoint_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @return Whether the phoneNumber field is set. + */ + @java.lang.Override + public boolean hasPhoneNumber() { + return endpointCase_ == 1; + } + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @return The phoneNumber. + */ + @java.lang.Override + public java.lang.String getPhoneNumber() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (endpointCase_ == 1) { + endpoint_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @return The bytes for phoneNumber. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPhoneNumberBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 1) { + ref = endpoint_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 1) { + endpoint_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @param value The phoneNumber to set. + * @return This builder for chaining. + */ + public Builder setPhoneNumber(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpointCase_ = 1; + endpoint_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearPhoneNumber() { + if (endpointCase_ == 1) { + endpointCase_ = 0; + endpoint_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Transfer the call to a phone number
+       * in [E.164 format](https://en.wikipedia.org/wiki/E.164).
+       * 
+ * + * string phone_number = 1; + * + * @param value The bytes for phoneNumber to set. + * @return This builder for chaining. + */ + public Builder setPhoneNumberBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpointCase_ = 1; + endpoint_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @return Whether the sipUri field is set. + */ + @java.lang.Override + public boolean hasSipUri() { + return endpointCase_ == 2; + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @return The sipUri. + */ + @java.lang.Override + public java.lang.String getSipUri() { + java.lang.Object ref = ""; + if (endpointCase_ == 2) { + ref = endpoint_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (endpointCase_ == 2) { + endpoint_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @return The bytes for sipUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSipUriBytes() { + java.lang.Object ref = ""; + if (endpointCase_ == 2) { + ref = endpoint_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (endpointCase_ == 2) { + endpoint_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @param value The sipUri to set. + * @return This builder for chaining. + */ + public Builder setSipUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + endpointCase_ = 2; + endpoint_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearSipUri() { + if (endpointCase_ == 2) { + endpointCase_ = 0; + endpoint_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Transfer the call to a SIP endpoint.
+       * 
+ * + * string sip_uri = 2; + * + * @param value The bytes for sipUri to set. + * @return This builder for chaining. + */ + public Builder setSipUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + endpointCase_ = 2; + endpoint_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + private static final com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TelephonyTransferCall parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int messageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + PAYLOAD(2), + LIVE_AGENT_HANDOFF(3), + END_INTERACTION(4), + MIXED_AUDIO(5), + TELEPHONY_TRANSFER_CALL(6), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 1: + return TEXT; + case 2: + return PAYLOAD; + case 3: + return LIVE_AGENT_HANDOFF; + case 4: + return END_INTERACTION; + case 5: + return MIXED_AUDIO; + case 6: + return TELEPHONY_TRANSFER_CALL; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return messageCase_ == 1; + } + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text getText() { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder getTextOrBuilder() { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + + public static final int PAYLOAD_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return messageCase_ == 2; + } + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int LIVE_AGENT_HANDOFF_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + @java.lang.Override + public boolean hasLiveAgentHandoff() { + return messageCase_ == 3; + } + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return The liveAgentHandoff. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff getLiveAgentHandoff() { + if (messageCase_ == 3) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder() { + if (messageCase_ == 3) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + + public static final int END_INTERACTION_FIELD_NUMBER = 4; + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return Whether the endInteraction field is set. + */ + @java.lang.Override + public boolean hasEndInteraction() { + return messageCase_ == 4; + } + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return The endInteraction. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction getEndInteraction() { + if (messageCase_ == 4) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder() { + if (messageCase_ == 4) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + + public static final int MIXED_AUDIO_FIELD_NUMBER = 5; + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return Whether the mixedAudio field is set. + */ + @java.lang.Override + public boolean hasMixedAudio() { + return messageCase_ == 5; + } + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return The mixedAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getMixedAudio() { + if (messageCase_ == 5) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder + getMixedAudioOrBuilder() { + if (messageCase_ == 5) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + + public static final int TELEPHONY_TRANSFER_CALL_FIELD_NUMBER = 6; + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return Whether the telephonyTransferCall field is set. + */ + @java.lang.Override + public boolean hasTelephonyTransferCall() { + return messageCase_ == 6; + } + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return The telephonyTransferCall. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + getTelephonyTransferCall() { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder + getTelephonyTransferCallOrBuilder() { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (messageCase_ == 1) { + output.writeMessage(1, (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_); + } + if (messageCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Struct) message_); + } + if (messageCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_); + } + if (messageCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_); + } + if (messageCase_ == 5) { + output.writeMessage(5, (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_); + } + if (messageCase_ == 6) { + output.writeMessage( + 6, (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (messageCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_); + } + if (messageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Struct) message_); + } + if (messageCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_); + } + if (messageCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_); + } + if (messageCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_); + } + if (messageCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.v2.ResponseMessage)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.ResponseMessage other = + (com.google.cloud.dialogflow.v2.ResponseMessage) obj; + + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 1: + if (!getText().equals(other.getText())) return false; + break; + case 2: + if (!getPayload().equals(other.getPayload())) return false; + break; + case 3: + if (!getLiveAgentHandoff().equals(other.getLiveAgentHandoff())) return false; + break; + case 4: + if (!getEndInteraction().equals(other.getEndInteraction())) return false; + break; + case 5: + if (!getMixedAudio().equals(other.getMixedAudio())) return false; + break; + case 6: + if (!getTelephonyTransferCall().equals(other.getTelephonyTransferCall())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (messageCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + break; + case 3: + hash = (37 * hash) + LIVE_AGENT_HANDOFF_FIELD_NUMBER; + hash = (53 * hash) + getLiveAgentHandoff().hashCode(); + break; + case 4: + hash = (37 * hash) + END_INTERACTION_FIELD_NUMBER; + hash = (53 * hash) + getEndInteraction().hashCode(); + break; + case 5: + hash = (37 * hash) + MIXED_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getMixedAudio().hashCode(); + break; + case 6: + hash = (37 * hash) + TELEPHONY_TRANSFER_CALL_FIELD_NUMBER; + hash = (53 * hash) + getTelephonyTransferCall().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.dialogflow.v2.ResponseMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response messages from an automated agent.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.ResponseMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ResponseMessage) + com.google.cloud.dialogflow.v2.ResponseMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.ResponseMessage.class, + com.google.cloud.dialogflow.v2.ResponseMessage.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.ResponseMessage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (textBuilder_ != null) { + textBuilder_.clear(); + } + if (payloadBuilder_ != null) { + payloadBuilder_.clear(); + } + if (liveAgentHandoffBuilder_ != null) { + liveAgentHandoffBuilder_.clear(); + } + if (endInteractionBuilder_ != null) { + endInteractionBuilder_.clear(); + } + if (mixedAudioBuilder_ != null) { + mixedAudioBuilder_.clear(); + } + if (telephonyTransferCallBuilder_ != null) { + telephonyTransferCallBuilder_.clear(); + } + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_ResponseMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage build() { + com.google.cloud.dialogflow.v2.ResponseMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage buildPartial() { + com.google.cloud.dialogflow.v2.ResponseMessage result = + new com.google.cloud.dialogflow.v2.ResponseMessage(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.dialogflow.v2.ResponseMessage result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.dialogflow.v2.ResponseMessage result) { + result.messageCase_ = messageCase_; + result.message_ = this.message_; + if (messageCase_ == 1 && textBuilder_ != null) { + result.message_ = textBuilder_.build(); + } + if (messageCase_ == 2 && payloadBuilder_ != null) { + result.message_ = payloadBuilder_.build(); + } + if (messageCase_ == 3 && liveAgentHandoffBuilder_ != null) { + result.message_ = liveAgentHandoffBuilder_.build(); + } + if (messageCase_ == 4 && endInteractionBuilder_ != null) { + result.message_ = endInteractionBuilder_.build(); + } + if (messageCase_ == 5 && mixedAudioBuilder_ != null) { + result.message_ = mixedAudioBuilder_.build(); + } + if (messageCase_ == 6 && telephonyTransferCallBuilder_ != null) { + result.message_ = telephonyTransferCallBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.v2.ResponseMessage) { + return mergeFrom((com.google.cloud.dialogflow.v2.ResponseMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.ResponseMessage other) { + if (other == com.google.cloud.dialogflow.v2.ResponseMessage.getDefaultInstance()) return this; + switch (other.getMessageCase()) { + case TEXT: + { + mergeText(other.getText()); + break; + } + case PAYLOAD: + { + mergePayload(other.getPayload()); + break; + } + case LIVE_AGENT_HANDOFF: + { + mergeLiveAgentHandoff(other.getLiveAgentHandoff()); + break; + } + case END_INTERACTION: + { + mergeEndInteraction(other.getEndInteraction()); + break; + } + case MIXED_AUDIO: + { + mergeMixedAudio(other.getMixedAudio()); + break; + } + case TELEPHONY_TRANSFER_CALL: + { + mergeTelephonyTransferCall(other.getTelephonyTransferCall()); + break; + } + case MESSAGE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetTextFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetPayloadFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetLiveAgentHandoffFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetEndInteractionFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetMixedAudioFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetTelephonyTransferCallFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.Text, + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder> + textBuilder_; + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return messageCase_ == 1; + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return The text. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.Text getText() { + if (textBuilder_ == null) { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } else { + if (messageCase_ == 1) { + return textBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + public Builder setText(com.google.cloud.dialogflow.v2.ResponseMessage.Text value) { + if (textBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + textBuilder_.setMessage(value); + } + messageCase_ = 1; + return this; + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + public Builder setText( + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder builderForValue) { + if (textBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + textBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 1; + return this; + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + public Builder mergeText(com.google.cloud.dialogflow.v2.ResponseMessage.Text value) { + if (textBuilder_ == null) { + if (messageCase_ == 1 + && message_ + != com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.Text.newBuilder( + (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 1) { + textBuilder_.mergeFrom(value); + } else { + textBuilder_.setMessage(value); + } + } + messageCase_ = 1; + return this; + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + public Builder clearText() { + if (textBuilder_ == null) { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + } + textBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder getTextBuilder() { + return internalGetTextFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder getTextOrBuilder() { + if ((messageCase_ == 1) && (textBuilder_ != null)) { + return textBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 1) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Returns a text response.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.Text, + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder> + internalGetTextFieldBuilder() { + if (textBuilder_ == null) { + if (!(messageCase_ == 1)) { + message_ = com.google.cloud.dialogflow.v2.ResponseMessage.Text.getDefaultInstance(); + } + textBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.Text, + com.google.cloud.dialogflow.v2.ResponseMessage.Text.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder>( + (com.google.cloud.dialogflow.v2.ResponseMessage.Text) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 1; + onChanged(); + return textBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + payloadBuilder_; + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return messageCase_ == 2; + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Struct getPayload() { + if (payloadBuilder_ == null) { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (messageCase_ == 2) { + return payloadBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder setPayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + payloadBuilder_.setMessage(value); + } + messageCase_ = 2; + return this; + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (payloadBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 2; + return this; + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder mergePayload(com.google.protobuf.Struct value) { + if (payloadBuilder_ == null) { + if (messageCase_ == 2 && message_ != com.google.protobuf.Struct.getDefaultInstance()) { + message_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 2) { + payloadBuilder_.mergeFrom(value); + } else { + payloadBuilder_.setMessage(value); + } + } + messageCase_ = 2; + return this; + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public Builder clearPayload() { + if (payloadBuilder_ == null) { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + } + payloadBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + public com.google.protobuf.Struct.Builder getPayloadBuilder() { + return internalGetPayloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { + if ((messageCase_ == 2) && (payloadBuilder_ != null)) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 2) { + return (com.google.protobuf.Struct) message_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Returns a response containing a custom, platform-specific payload.
+     * 
+ * + * .google.protobuf.Struct payload = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + if (!(messageCase_ == 2)) { + message_ = com.google.protobuf.Struct.getDefaultInstance(); + } + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) message_, getParentForChildren(), isClean()); + message_ = null; + } + messageCase_ = 2; + onChanged(); + return payloadBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder> + liveAgentHandoffBuilder_; + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + @java.lang.Override + public boolean hasLiveAgentHandoff() { + return messageCase_ == 3; + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return The liveAgentHandoff. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff getLiveAgentHandoff() { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 3) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } else { + if (messageCase_ == 3) { + return liveAgentHandoffBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + public Builder setLiveAgentHandoff( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff value) { + if (liveAgentHandoffBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + liveAgentHandoffBuilder_.setMessage(value); + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + public Builder setLiveAgentHandoff( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder builderForValue) { + if (liveAgentHandoffBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + liveAgentHandoffBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + public Builder mergeLiveAgentHandoff( + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff value) { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 3 + && message_ + != com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.newBuilder( + (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 3) { + liveAgentHandoffBuilder_.mergeFrom(value); + } else { + liveAgentHandoffBuilder_.setMessage(value); + } + } + messageCase_ = 3; + return this; + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + public Builder clearLiveAgentHandoff() { + if (liveAgentHandoffBuilder_ == null) { + if (messageCase_ == 3) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 3) { + messageCase_ = 0; + message_ = null; + } + liveAgentHandoffBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder + getLiveAgentHandoffBuilder() { + return internalGetLiveAgentHandoffFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder() { + if ((messageCase_ == 3) && (liveAgentHandoffBuilder_ != null)) { + return liveAgentHandoffBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 3) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Hands off conversation to a live agent.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder> + internalGetLiveAgentHandoffFieldBuilder() { + if (liveAgentHandoffBuilder_ == null) { + if (!(messageCase_ == 3)) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.getDefaultInstance(); + } + liveAgentHandoffBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder>( + (com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 3; + onChanged(); + return liveAgentHandoffBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder> + endInteractionBuilder_; + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return Whether the endInteraction field is set. + */ + @java.lang.Override + public boolean hasEndInteraction() { + return messageCase_ == 4; + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return The endInteraction. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction getEndInteraction() { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 4) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } else { + if (messageCase_ == 4) { + return endInteractionBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + public Builder setEndInteraction( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction value) { + if (endInteractionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + endInteractionBuilder_.setMessage(value); + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + public Builder setEndInteraction( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder builderForValue) { + if (endInteractionBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + endInteractionBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + public Builder mergeEndInteraction( + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction value) { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 4 + && message_ + != com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.newBuilder( + (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 4) { + endInteractionBuilder_.mergeFrom(value); + } else { + endInteractionBuilder_.setMessage(value); + } + } + messageCase_ = 4; + return this; + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + public Builder clearEndInteraction() { + if (endInteractionBuilder_ == null) { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 4) { + messageCase_ = 0; + message_ = null; + } + endInteractionBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder + getEndInteractionBuilder() { + return internalGetEndInteractionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder() { + if ((messageCase_ == 4) && (endInteractionBuilder_ != null)) { + return endInteractionBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 4) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A signal that indicates the interaction with the Dialogflow agent has
+     * ended.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder> + internalGetEndInteractionFieldBuilder() { + if (endInteractionBuilder_ == null) { + if (!(messageCase_ == 4)) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.getDefaultInstance(); + } + endInteractionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder>( + (com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 4; + onChanged(); + return endInteractionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder> + mixedAudioBuilder_; + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return Whether the mixedAudio field is set. + */ + @java.lang.Override + public boolean hasMixedAudio() { + return messageCase_ == 5; + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return The mixedAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getMixedAudio() { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 5) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } else { + if (messageCase_ == 5) { + return mixedAudioBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + public Builder setMixedAudio(com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio value) { + if (mixedAudioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + mixedAudioBuilder_.setMessage(value); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + public Builder setMixedAudio( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder builderForValue) { + if (mixedAudioBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + mixedAudioBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + public Builder mergeMixedAudio( + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio value) { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 5 + && message_ + != com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.newBuilder( + (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 5) { + mixedAudioBuilder_.mergeFrom(value); + } else { + mixedAudioBuilder_.setMessage(value); + } + } + messageCase_ = 5; + return this; + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + public Builder clearMixedAudio() { + if (mixedAudioBuilder_ == null) { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 5) { + messageCase_ = 0; + message_ = null; + } + mixedAudioBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder + getMixedAudioBuilder() { + return internalGetMixedAudioFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder + getMixedAudioOrBuilder() { + if ((messageCase_ == 5) && (mixedAudioBuilder_ != null)) { + return mixedAudioBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 5) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + } + + /** + * + * + *
+     * An audio response message composed of both the synthesized Dialogflow
+     * agent responses and the audios hosted in places known to the client.
+     * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder> + internalGetMixedAudioFieldBuilder() { + if (mixedAudioBuilder_ == null) { + if (!(messageCase_ == 5)) { + message_ = com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.getDefaultInstance(); + } + mixedAudioBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder>( + (com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 5; + onChanged(); + return mixedAudioBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder> + telephonyTransferCallBuilder_; + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return Whether the telephonyTransferCall field is set. + */ + @java.lang.Override + public boolean hasTelephonyTransferCall() { + return messageCase_ == 6; + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return The telephonyTransferCall. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + getTelephonyTransferCall() { + if (telephonyTransferCallBuilder_ == null) { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } else { + if (messageCase_ == 6) { + return telephonyTransferCallBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + public Builder setTelephonyTransferCall( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall value) { + if (telephonyTransferCallBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + telephonyTransferCallBuilder_.setMessage(value); + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + public Builder setTelephonyTransferCall( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder + builderForValue) { + if (telephonyTransferCallBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + telephonyTransferCallBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + public Builder mergeTelephonyTransferCall( + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall value) { + if (telephonyTransferCallBuilder_ == null) { + if (messageCase_ == 6 + && message_ + != com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance()) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.newBuilder( + (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) + message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 6) { + telephonyTransferCallBuilder_.mergeFrom(value); + } else { + telephonyTransferCallBuilder_.setMessage(value); + } + } + messageCase_ = 6; + return this; + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + public Builder clearTelephonyTransferCall() { + if (telephonyTransferCallBuilder_ == null) { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 6) { + messageCase_ = 0; + message_ = null; + } + telephonyTransferCallBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder + getTelephonyTransferCallBuilder() { + return internalGetTelephonyTransferCallFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder + getTelephonyTransferCallOrBuilder() { + if ((messageCase_ == 6) && (telephonyTransferCallBuilder_ != null)) { + return telephonyTransferCallBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 6) { + return (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_; + } + return com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * A signal that the client should transfer the phone call connected to
+     * this agent to a third-party endpoint.
+     * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder> + internalGetTelephonyTransferCallFieldBuilder() { + if (telephonyTransferCallBuilder_ == null) { + if (!(messageCase_ == 6)) { + message_ = + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall + .getDefaultInstance(); + } + telephonyTransferCallBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall.Builder, + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder>( + (com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 6; + onChanged(); + return telephonyTransferCallBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ResponseMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ResponseMessage) + private static final com.google.cloud.dialogflow.v2.ResponseMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ResponseMessage(); + } + + public static com.google.cloud.dialogflow.v2.ResponseMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResponseMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.ResponseMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessageOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessageOrBuilder.java new file mode 100644 index 000000000000..9876272b802b --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ResponseMessageOrBuilder.java @@ -0,0 +1,273 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/dialogflow/v2/participant.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.dialogflow.v2; + +@com.google.protobuf.Generated +public interface ResponseMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.ResponseMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return Whether the text field is set. + */ + boolean hasText(); + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + * + * @return The text. + */ + com.google.cloud.dialogflow.v2.ResponseMessage.Text getText(); + + /** + * + * + *
+   * Returns a text response.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.Text text = 1; + */ + com.google.cloud.dialogflow.v2.ResponseMessage.TextOrBuilder getTextOrBuilder(); + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + * + * @return The payload. + */ + com.google.protobuf.Struct getPayload(); + + /** + * + * + *
+   * Returns a response containing a custom, platform-specific payload.
+   * 
+ * + * .google.protobuf.Struct payload = 2; + */ + com.google.protobuf.StructOrBuilder getPayloadOrBuilder(); + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return Whether the liveAgentHandoff field is set. + */ + boolean hasLiveAgentHandoff(); + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + * + * @return The liveAgentHandoff. + */ + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff getLiveAgentHandoff(); + + /** + * + * + *
+   * Hands off conversation to a live agent.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoff live_agent_handoff = 3; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessage.LiveAgentHandoffOrBuilder + getLiveAgentHandoffOrBuilder(); + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return Whether the endInteraction field is set. + */ + boolean hasEndInteraction(); + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + * + * @return The endInteraction. + */ + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteraction getEndInteraction(); + + /** + * + * + *
+   * A signal that indicates the interaction with the Dialogflow agent has
+   * ended.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.EndInteraction end_interaction = 4; + */ + com.google.cloud.dialogflow.v2.ResponseMessage.EndInteractionOrBuilder + getEndInteractionOrBuilder(); + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return Whether the mixedAudio field is set. + */ + boolean hasMixedAudio(); + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + * + * @return The mixedAudio. + */ + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudio getMixedAudio(); + + /** + * + * + *
+   * An audio response message composed of both the synthesized Dialogflow
+   * agent responses and the audios hosted in places known to the client.
+   * 
+ * + * .google.cloud.dialogflow.v2.ResponseMessage.MixedAudio mixed_audio = 5; + */ + com.google.cloud.dialogflow.v2.ResponseMessage.MixedAudioOrBuilder getMixedAudioOrBuilder(); + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return Whether the telephonyTransferCall field is set. + */ + boolean hasTelephonyTransferCall(); + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + * + * @return The telephonyTransferCall. + */ + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall getTelephonyTransferCall(); + + /** + * + * + *
+   * A signal that the client should transfer the phone call connected to
+   * this agent to a third-party endpoint.
+   * 
+ * + * + * .google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCall telephony_transfer_call = 6; + * + */ + com.google.cloud.dialogflow.v2.ResponseMessage.TelephonyTransferCallOrBuilder + getTelephonyTransferCallOrBuilder(); + + com.google.cloud.dialogflow.v2.ResponseMessage.MessageCase getMessageCase(); +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResult.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResult.java index 50d509ebbcd0..0c0544a09b05 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResult.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResult.java @@ -134,6 +134,61 @@ public com.google.cloud.dialogflow.v2.SentimentOrBuilder getQueryTextSentimentOr : queryTextSentiment_; } + public static final int STATUS_FIELD_NUMBER = 3; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -151,6 +206,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getQueryTextSentiment()); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getStatus()); + } getUnknownFields().writeTo(output); } @@ -163,6 +221,9 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getQueryTextSentiment()); } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -183,6 +244,10 @@ public boolean equals(final java.lang.Object obj) { if (hasQueryTextSentiment()) { if (!getQueryTextSentiment().equals(other.getQueryTextSentiment())) return false; } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -198,6 +263,10 @@ public int hashCode() { hash = (37 * hash) + QUERY_TEXT_SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + getQueryTextSentiment().hashCode(); } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -353,6 +422,7 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { internalGetQueryTextSentimentFieldBuilder(); + internalGetStatusFieldBuilder(); } } @@ -365,6 +435,11 @@ public Builder clear() { queryTextSentimentBuilder_.dispose(); queryTextSentimentBuilder_ = null; } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } return this; } @@ -409,6 +484,10 @@ private void buildPartial0(com.google.cloud.dialogflow.v2.SentimentAnalysisResul : queryTextSentimentBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } result.bitField0_ |= to_bitField0_; } @@ -428,6 +507,9 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.SentimentAnalysisResult if (other.hasQueryTextSentiment()) { mergeQueryTextSentiment(other.getQueryTextSentiment()); } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -461,6 +543,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 26: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -676,6 +764,209 @@ public com.google.cloud.dialogflow.v2.SentimentOrBuilder getQueryTextSentimentOr return queryTextSentimentBuilder_; } + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000002); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * Output only. The status of the sentiment analysis operation.
+     * If the operation failed, this field will contain the error details.
+     * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+     * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.SentimentAnalysisResult) } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResultOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResultOrBuilder.java index 3be930634f39..e58278c36cb8 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResultOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SentimentAnalysisResultOrBuilder.java @@ -62,4 +62,47 @@ public interface SentimentAnalysisResultOrBuilder * .google.cloud.dialogflow.v2.Sentiment query_text_sentiment = 1; */ com.google.cloud.dialogflow.v2.SentimentOrBuilder getQueryTextSentimentOrBuilder(); + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * Output only. The status of the sentiment analysis operation.
+   * If the operation failed, this field will contain the error details.
+   * For example, it might indicate a quota issue (RESOURCE_EXHAUSTED).
+   * 
+ * + * .google.rpc.Status status = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SessionProto.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SessionProto.java index e4e55d9aeb5c..50d84e52aed1 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SessionProto.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SessionProto.java @@ -109,182 +109,171 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n" - + "(google/cloud/dialogflow/v2/session.pro" + "\n(google/cloud/dialogflow/v2/session.pro" + "to\022\032google.cloud.dialogflow.v2\032\034google/a" + "pi/annotations.proto\032\027google/api/client." + "proto\032\037google/api/field_behavior.proto\032\031" - + "google/api/resource.proto\032-google/cloud/dialogflow/v2/audio_config.proto\032(google" + + "google/api/resource.proto\032-google/cloud/" + + "dialogflow/v2/audio_config.proto\032(google" + "/cloud/dialogflow/v2/context.proto\032\'goog" - + "le/cloud/dialogflow/v2/intent.proto\0324google/cloud/dialogflow/v2/session_entity_t" - + "ype.proto\032\036google/protobuf/duration.proto\032" - + " google/protobuf/field_mask.proto\032\034goo" - + "gle/protobuf/struct.proto\032\027google/rpc/status.proto\032\030google/type/latlng.proto\"\367\002\n" - + "\023DetectIntentRequest\022;\n" - + "\007session\030\001 \001(\tB*\342A\001\002\372A#\n" - + "!dialogflow.googleapis.com/Session\022A\n" - + "\014query_params\030\002 \001(\0132+.google.cloud.dialogflow.v2.QueryParameters\022A\n" - + "\013query_input\030\003" - + " \001(\0132&.google.cloud.dialogflow.v2.QueryInputB\004\342A\001\002\022J\n" - + "\023output_audio_config\030\004" - + " \001(\0132-.google.cloud.dialogflow.v2.OutputAudioConfig\022<\n" - + "\030output_audio_config_mask\030\007" - + " \001(\0132\032.google.protobuf.FieldMask\022\023\n" - + "\013input_audio\030\005 \001(\014\"\370\001\n" - + "\024DetectIntentResponse\022\023\n" - + "\013response_id\030\001 \001(\t\022=\n" - + "\014query_result\030\002 \001(\0132\'.google.cloud.dialogflow.v2.QueryResult\022*\n" - + "\016webhook_status\030\003 \001(\0132\022.google.rpc.Status\022\024\n" - + "\014output_audio\030\004 \001(\014\022J\n" - + "\023output_audio_config\030\006" - + " \001(\0132-.google.cloud.dialogflow.v2.OutputAudioConfig\"\237\004\n" - + "\017QueryParameters\022\021\n" - + "\ttime_zone\030\001 \001(\t\022)\n" - + "\014geo_location\030\002 \001(\0132\023.google.type.LatLng\0225\n" - + "\010contexts\030\003 \003(\0132#.google.cloud.dialogflow.v2.Context\022\026\n" - + "\016reset_contexts\030\004 \001(\010\022K\n" - + "\024session_entity_types\030\005" - + " \003(\0132-.google.cloud.dialogflow.v2.SessionEntityType\022(\n" - + "\007payload\030\006 \001(\0132\027.google.protobuf.Struct\022e\n" - + "!sentiment_analysis_request_config\030\n" - + " \001(\0132:.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig\022X\n" - + "\017webhook_headers\030\016 \003(\0132?.goog" - + "le.cloud.dialogflow.v2.QueryParameters.WebhookHeadersEntry\022\020\n" - + "\010platform\030\022 \001(\t\0325\n" - + "\023WebhookHeadersEntry\022\013\n" - + "\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\001\"\313\001\n\n" - + "QueryInput\022D\n" - + "\014audio_config\030\001" - + " \001(\0132,.google.cloud.dialogflow.v2.InputAudioConfigH\000\0225\n" - + "\004text\030\002 \001(\0132%.google.cloud.dialogflow.v2.TextInputH\000\0227\n" - + "\005event\030\003 \001(\0132&.google.cloud.dialogflow.v2.EventInputH\000B\007\n" - + "\005input\"\256\005\n" - + "\013QueryResult\022\022\n\n" - + "query_text\030\001 \001(\t\022\025\n\r" - + "language_code\030\017 \001(\t\022%\n" - + "\035speech_recognition_confidence\030\002 \001(\002\022\016\n" - + "\006action\030\003 \001(\t\022+\n\n" - + "parameters\030\004 \001(\0132\027.google.protobuf.Struct\022#\n" - + "\033all_required_params_present\030\005 \001(\010\022\034\n" - + "\024cancels_slot_filling\030\025 \001(\010\022\030\n" - + "\020fulfillment_text\030\006 \001(\t\022H\n" - + "\024fulfillment_messages\030\007" - + " \003(\0132*.google.cloud.dialogflow.v2.Intent.Message\022\026\n" - + "\016webhook_source\030\010 \001(\t\0220\n" - + "\017webhook_payload\030\t \001(\0132\027.google.protobuf.Struct\022<\n" - + "\017output_contexts\030\n" - + " \003(\0132#.google.cloud.dialogflow.v2.Context\0222\n" - + "\006intent\030\013 \001(\0132\".google.cloud.dialogflow.v2.Intent\022#\n" - + "\033intent_detection_confidence\030\014 \001(\002\0220\n" - + "\017diagnostic_info\030\016 \001(\0132\027.google.protobuf.Struct\022V\n" - + "\031sentiment_analysis_result\030\021" - + " \001(\01323.google.cloud.dialogflow.v2.SentimentAnalysisResult\"\275\003\n" - + "\034StreamingDetectIntentRequest\022;\n" - + "\007session\030\001 \001(\tB*\342A\001\002\372A#\n" - + "!dialogflow.googleapis.com/Session\022A\n" - + "\014query_params\030\002 \001(\0132+.google.cloud.dialogflow.v2.QueryParameters\022A\n" - + "\013query_input\030\003" - + " \001(\0132&.google.cloud.dialogflow.v2.QueryInputB\004\342A\001\002\022\034\n" - + "\020single_utterance\030\004 \001(\010B\002\030\001\022J\n" - + "\023output_audio_config\030\005 \001(\0132-.goog" - + "le.cloud.dialogflow.v2.OutputAudioConfig\022<\n" - + "\030output_audio_config_mask\030\007" - + " \001(\0132\032.google.protobuf.FieldMask\022\023\n" - + "\013input_audio\030\006 \001(\014\022\035\n" - + "\025enable_debugging_info\030\010 \001(\010\"\260\007\n" - + "\036CloudConversationDebuggingInfo\022\031\n" - + "\021audio_data_chunks\030\001 \001(\005\0229\n" - + "\026result_end_time_offset\030\002 \001(\0132\031.google.protobuf.Duration\0227\n" - + "\024first_audio_duration\030\003 \001(\0132\031.google.protobuf.Duration\022\030\n" - + "\020single_utterance\030\005 \001(\010\022C\n" - + " speech_partial_results_end_times\030\006" - + " \003(\0132\031.google.protobuf.Duration\022A\n" - + "\036speech_final_results_end_times\030\007" - + " \003(\0132\031.google.protobuf.Duration\022\031\n" - + "\021partial_responses\030\010 \001(\005\022,\n" - + "$speaker_id_passive_latency_ms_offset\030\t \001(\005\022\037\n" - + "\027bargein_event_triggered\030\n" - + " \001(\010\022\037\n" - + "\027speech_single_utterance\030\013 \001(\010\022=\n" - + "\032dtmf_partial_results_times\030\014 \003(\0132\031.google.protobuf.Duration\022;\n" - + "\030dtmf_final_results_times\030\r" - + " \003(\0132\031.google.protobuf.Duration\022C\n" - + " single_utterance_end_time_offset\030\016" - + " \001(\0132\031.google.protobuf.Duration\0224\n" - + "\021no_speech_timeout\030\017 \001(\0132\031.google.protobuf.Duration\0226\n" - + "\023endpointing_timeout\030\023 \001(\0132\031.google.protobuf.Duration\022\025\n\r" - + "is_input_text\030\020 \001(\010\022@\n" - + "\035client_half_close_time_offset\030\021" - + " \001(\0132\031.google.protobuf.Duration\022J\n" - + "\'client_half_close_streaming_time_offset\030\022" - + " \001(\0132\031.google.protobuf.Duration\"\251\003\n" - + "\035StreamingDetectIntentResponse\022\023\n" - + "\013response_id\030\001 \001(\t\022R\n" - + "\022recognition_result\030\002 \001(\01326.google.cloud." - + "dialogflow.v2.StreamingRecognitionResult\022=\n" - + "\014query_result\030\003 \001(\0132\'.google.cloud.dialogflow.v2.QueryResult\022*\n" - + "\016webhook_status\030\004 \001(\0132\022.google.rpc.Status\022\024\n" - + "\014output_audio\030\005 \001(\014\022J\n" - + "\023output_audio_config\030\006 \001(\0132-" - + ".google.cloud.dialogflow.v2.OutputAudioConfig\022R\n" - + "\016debugging_info\030\010 \001(\0132:.google.c" - + "loud.dialogflow.v2.CloudConversationDebuggingInfo\"\374\003\n" - + "\032StreamingRecognitionResult\022X\n" - + "\014message_type\030\001 \001(\0162B.google.cloud.di" - + "alogflow.v2.StreamingRecognitionResult.MessageType\022\022\n\n" - + "transcript\030\002 \001(\t\022\020\n" - + "\010is_final\030\003 \001(\010\022\022\n\n" - + "confidence\030\004 \001(\002\022D\n" - + "\020speech_word_info\030\007" - + " \003(\0132*.google.cloud.dialogflow.v2.SpeechWordInfo\0224\n" - + "\021speech_end_offset\030\010 \001(\0132\031.google.protobuf.Duration\022\025\n\r" - + "language_code\030\n" - + " \001(\t\"\266\001\n" - + "\013MessageType\022\034\n" - + "\030MESSAGE_TYPE_UNSPECIFIED\020\000\022\016\n\n" - + "TRANSCRIPT\020\001\022\017\n" - + "\013DTMF_DIGITS\020\003\022\033\n" - + "\027END_OF_SINGLE_UTTERANCE\020\002\022\027\n" - + "\023PARTIAL_DTMF_DIGITS\020\004\022\031\n" - + "\025SPEECH_ACTIVITY_BEGIN\020\005\022\027\n" - + "\023SPEECH_ACTIVITY_END\020\006\"<\n" - + "\tTextInput\022\022\n" - + "\004text\030\001 \001(\tB\004\342A\001\001\022\033\n\r" - + "language_code\030\002 \001(\tB\004\342A\001\002\"j\n\n" - + "EventInput\022\022\n" - + "\004name\030\001 \001(\tB\004\342A\001\002\022+\n\n" - + "parameters\030\002 \001(\0132\027.google.protobuf.Struct\022\033\n\r" - + "language_code\030\003 \001(\tB\004\342A\001\002\"F\n" - + "\036SentimentAnalysisRequestConfig\022$\n" - + "\034analyze_query_text_sentiment\030\001 \001(\010\"^\n" - + "\027SentimentAnalysisResult\022C\n" - + "\024query_text_sentiment\030\001 \001(\0132%.google.cloud.dialogflow.v2.Sentiment\"-\n" - + "\tSentiment\022\r\n" - + "\005score\030\001 \001(\002\022\021\n" - + "\tmagnitude\030\002 \001(\0022\345\005\n" - + "\010Sessions\022\311\003\n" - + "\014DetectIntent\022/.google.cloud.dialogflo" - + "w.v2.DetectIntentRequest\0320.google.cloud." - + "dialogflow.v2.DetectIntentResponse\"\325\002\332A\023" - + "session,query_input\202\323\344\223\002\270\002\"6/v2/{session" - + "=projects/*/agent/sessions/*}:detectIntent:\001*ZR\"M/v2/{session=projects/*/agent/e" - + "nvironments/*/users/*/sessions/*}:detectIntent:\001*ZG\"B/v2/{session=projects/*/loc" - + "ations/*/agent/sessions/*}:detectIntent:\001*Z^\"Y/v2/{session=projects/*/locations/" - + "*/agent/environments/*/users/*/sessions/*}:detectIntent:\001*\022\222\001\n" - + "\025StreamingDetectIntent\0228.google.cloud.dialogflow.v2.Stream" - + "ingDetectIntentRequest\0329.google.cloud.dialogflow.v2.StreamingDetectIntentRespons" - + "e\"\000(\0010\001\032x\312A\031dialogflow.googleapis.com\322AY" - + "https://www.googleapis.com/auth/cloud-pl" - + "atform,https://www.googleapis.com/auth/dialogflowB\347\003\n" - + "\036com.google.cloud.dialogflow.v2B\014SessionProtoP\001Z>cloud.google.com/g" - + "o/dialogflow/apiv2/dialogflowpb;dialogfl" - + "owpb\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2\352A\321\002\n" - + "!dialogflow.googleapis.com/Session\022+projects/{project}/agent/sessions/{sessio" - + "n}\022Sprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{s" - + "ession}\022@projects/{project}/locations/{location}/agent/sessions/{session}\022hproje" - + "cts/{project}/locations/{location}/agent/environments/{environment}/users/{user}" - + "/sessions/{session}b\006proto3" + + "le/cloud/dialogflow/v2/intent.proto\0324goo" + + "gle/cloud/dialogflow/v2/session_entity_t" + + "ype.proto\032\036google/protobuf/duration.prot" + + "o\032 google/protobuf/field_mask.proto\032\034goo" + + "gle/protobuf/struct.proto\032\027google/rpc/st" + + "atus.proto\032\030google/type/latlng.proto\"\367\002\n" + + "\023DetectIntentRequest\022;\n\007session\030\001 \001(\tB*\342" + + "A\001\002\372A#\n!dialogflow.googleapis.com/Sessio" + + "n\022A\n\014query_params\030\002 \001(\0132+.google.cloud.d" + + "ialogflow.v2.QueryParameters\022A\n\013query_in" + + "put\030\003 \001(\0132&.google.cloud.dialogflow.v2.Q" + + "ueryInputB\004\342A\001\002\022J\n\023output_audio_config\030\004" + + " \001(\0132-.google.cloud.dialogflow.v2.Output" + + "AudioConfig\022<\n\030output_audio_config_mask\030" + + "\007 \001(\0132\032.google.protobuf.FieldMask\022\023\n\013inp" + + "ut_audio\030\005 \001(\014\"\370\001\n\024DetectIntentResponse\022" + + "\023\n\013response_id\030\001 \001(\t\022=\n\014query_result\030\002 \001" + + "(\0132\'.google.cloud.dialogflow.v2.QueryRes" + + "ult\022*\n\016webhook_status\030\003 \001(\0132\022.google.rpc" + + ".Status\022\024\n\014output_audio\030\004 \001(\014\022J\n\023output_" + + "audio_config\030\006 \001(\0132-.google.cloud.dialog" + + "flow.v2.OutputAudioConfig\"\237\004\n\017QueryParam" + + "eters\022\021\n\ttime_zone\030\001 \001(\t\022)\n\014geo_location" + + "\030\002 \001(\0132\023.google.type.LatLng\0225\n\010contexts\030" + + "\003 \003(\0132#.google.cloud.dialogflow.v2.Conte" + + "xt\022\026\n\016reset_contexts\030\004 \001(\010\022K\n\024session_en" + + "tity_types\030\005 \003(\0132-.google.cloud.dialogfl" + + "ow.v2.SessionEntityType\022(\n\007payload\030\006 \001(\013" + + "2\027.google.protobuf.Struct\022e\n!sentiment_a" + + "nalysis_request_config\030\n \001(\0132:.google.cl" + + "oud.dialogflow.v2.SentimentAnalysisReque" + + "stConfig\022X\n\017webhook_headers\030\016 \003(\0132?.goog" + + "le.cloud.dialogflow.v2.QueryParameters.W" + + "ebhookHeadersEntry\022\020\n\010platform\030\022 \001(\t\0325\n\023" + + "WebhookHeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\"\313\001\n\nQueryInput\022D\n\014audio_conf" + + "ig\030\001 \001(\0132,.google.cloud.dialogflow.v2.In" + + "putAudioConfigH\000\0225\n\004text\030\002 \001(\0132%.google." + + "cloud.dialogflow.v2.TextInputH\000\0227\n\005event" + + "\030\003 \001(\0132&.google.cloud.dialogflow.v2.Even" + + "tInputH\000B\007\n\005input\"\256\005\n\013QueryResult\022\022\n\nque" + + "ry_text\030\001 \001(\t\022\025\n\rlanguage_code\030\017 \001(\t\022%\n\035" + + "speech_recognition_confidence\030\002 \001(\002\022\016\n\006a" + + "ction\030\003 \001(\t\022+\n\nparameters\030\004 \001(\0132\027.google" + + ".protobuf.Struct\022#\n\033all_required_params_" + + "present\030\005 \001(\010\022\034\n\024cancels_slot_filling\030\025 " + + "\001(\010\022\030\n\020fulfillment_text\030\006 \001(\t\022H\n\024fulfill" + + "ment_messages\030\007 \003(\0132*.google.cloud.dialo" + + "gflow.v2.Intent.Message\022\026\n\016webhook_sourc" + + "e\030\010 \001(\t\0220\n\017webhook_payload\030\t \001(\0132\027.googl" + + "e.protobuf.Struct\022<\n\017output_contexts\030\n \003" + + "(\0132#.google.cloud.dialogflow.v2.Context\022" + + "2\n\006intent\030\013 \001(\0132\".google.cloud.dialogflo" + + "w.v2.Intent\022#\n\033intent_detection_confiden" + + "ce\030\014 \001(\002\0220\n\017diagnostic_info\030\016 \001(\0132\027.goog" + + "le.protobuf.Struct\022V\n\031sentiment_analysis" + + "_result\030\021 \001(\01323.google.cloud.dialogflow." + + "v2.SentimentAnalysisResult\"\275\003\n\034Streaming" + + "DetectIntentRequest\022;\n\007session\030\001 \001(\tB*\342A" + + "\001\002\372A#\n!dialogflow.googleapis.com/Session" + + "\022A\n\014query_params\030\002 \001(\0132+.google.cloud.di" + + "alogflow.v2.QueryParameters\022A\n\013query_inp" + + "ut\030\003 \001(\0132&.google.cloud.dialogflow.v2.Qu" + + "eryInputB\004\342A\001\002\022\034\n\020single_utterance\030\004 \001(\010" + + "B\002\030\001\022J\n\023output_audio_config\030\005 \001(\0132-.goog" + + "le.cloud.dialogflow.v2.OutputAudioConfig" + + "\022<\n\030output_audio_config_mask\030\007 \001(\0132\032.goo" + + "gle.protobuf.FieldMask\022\023\n\013input_audio\030\006 " + + "\001(\014\022\035\n\025enable_debugging_info\030\010 \001(\010\"\260\007\n\036C" + + "loudConversationDebuggingInfo\022\031\n\021audio_d" + + "ata_chunks\030\001 \001(\005\0229\n\026result_end_time_offs" + + "et\030\002 \001(\0132\031.google.protobuf.Duration\0227\n\024f" + + "irst_audio_duration\030\003 \001(\0132\031.google.proto" + + "buf.Duration\022\030\n\020single_utterance\030\005 \001(\010\022C" + + "\n speech_partial_results_end_times\030\006 \003(\013" + + "2\031.google.protobuf.Duration\022A\n\036speech_fi" + + "nal_results_end_times\030\007 \003(\0132\031.google.pro" + + "tobuf.Duration\022\031\n\021partial_responses\030\010 \001(" + + "\005\022,\n$speaker_id_passive_latency_ms_offse" + + "t\030\t \001(\005\022\037\n\027bargein_event_triggered\030\n \001(\010" + + "\022\037\n\027speech_single_utterance\030\013 \001(\010\022=\n\032dtm" + + "f_partial_results_times\030\014 \003(\0132\031.google.p" + + "rotobuf.Duration\022;\n\030dtmf_final_results_t" + + "imes\030\r \003(\0132\031.google.protobuf.Duration\022C\n" + + " single_utterance_end_time_offset\030\016 \001(\0132" + + "\031.google.protobuf.Duration\0224\n\021no_speech_" + + "timeout\030\017 \001(\0132\031.google.protobuf.Duration" + + "\0226\n\023endpointing_timeout\030\023 \001(\0132\031.google.p" + + "rotobuf.Duration\022\025\n\ris_input_text\030\020 \001(\010\022" + + "@\n\035client_half_close_time_offset\030\021 \001(\0132\031" + + ".google.protobuf.Duration\022J\n\'client_half" + + "_close_streaming_time_offset\030\022 \001(\0132\031.goo" + + "gle.protobuf.Duration\"\251\003\n\035StreamingDetec" + + "tIntentResponse\022\023\n\013response_id\030\001 \001(\t\022R\n\022" + + "recognition_result\030\002 \001(\01326.google.cloud." + + "dialogflow.v2.StreamingRecognitionResult" + + "\022=\n\014query_result\030\003 \001(\0132\'.google.cloud.di" + + "alogflow.v2.QueryResult\022*\n\016webhook_statu" + + "s\030\004 \001(\0132\022.google.rpc.Status\022\024\n\014output_au" + + "dio\030\005 \001(\014\022J\n\023output_audio_config\030\006 \001(\0132-" + + ".google.cloud.dialogflow.v2.OutputAudioC" + + "onfig\022R\n\016debugging_info\030\010 \001(\0132:.google.c" + + "loud.dialogflow.v2.CloudConversationDebu" + + "ggingInfo\"\374\003\n\032StreamingRecognitionResult" + + "\022X\n\014message_type\030\001 \001(\0162B.google.cloud.di" + + "alogflow.v2.StreamingRecognitionResult.M" + + "essageType\022\022\n\ntranscript\030\002 \001(\t\022\020\n\010is_fin" + + "al\030\003 \001(\010\022\022\n\nconfidence\030\004 \001(\002\022D\n\020speech_w" + + "ord_info\030\007 \003(\0132*.google.cloud.dialogflow" + + ".v2.SpeechWordInfo\0224\n\021speech_end_offset\030" + + "\010 \001(\0132\031.google.protobuf.Duration\022\025\n\rlang" + + "uage_code\030\n \001(\t\"\266\001\n\013MessageType\022\034\n\030MESSA" + + "GE_TYPE_UNSPECIFIED\020\000\022\016\n\nTRANSCRIPT\020\001\022\017\n" + + "\013DTMF_DIGITS\020\003\022\033\n\027END_OF_SINGLE_UTTERANC" + + "E\020\002\022\027\n\023PARTIAL_DTMF_DIGITS\020\004\022\031\n\025SPEECH_A" + + "CTIVITY_BEGIN\020\005\022\027\n\023SPEECH_ACTIVITY_END\020\006" + + "\"<\n\tTextInput\022\022\n\004text\030\001 \001(\tB\004\342A\001\001\022\033\n\rlan" + + "guage_code\030\002 \001(\tB\004\342A\001\002\"j\n\nEventInput\022\022\n\004" + + "name\030\001 \001(\tB\004\342A\001\002\022+\n\nparameters\030\002 \001(\0132\027.g" + + "oogle.protobuf.Struct\022\033\n\rlanguage_code\030\003" + + " \001(\tB\004\342A\001\002\"F\n\036SentimentAnalysisRequestCo" + + "nfig\022$\n\034analyze_query_text_sentiment\030\001 \001" + + "(\010\"\210\001\n\027SentimentAnalysisResult\022C\n\024query_" + + "text_sentiment\030\001 \001(\0132%.google.cloud.dial" + + "ogflow.v2.Sentiment\022(\n\006status\030\003 \001(\0132\022.go" + + "ogle.rpc.StatusB\004\342A\001\003\"-\n\tSentiment\022\r\n\005sc" + + "ore\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001(\0022\345\005\n\010Session" + + "s\022\311\003\n\014DetectIntent\022/.google.cloud.dialog" + + "flow.v2.DetectIntentRequest\0320.google.clo" + + "ud.dialogflow.v2.DetectIntentResponse\"\325\002" + + "\332A\023session,query_input\202\323\344\223\002\270\002\"6/v2/{sess" + + "ion=projects/*/agent/sessions/*}:detectI" + + "ntent:\001*ZR\"M/v2/{session=projects/*/agen" + + "t/environments/*/users/*/sessions/*}:det" + + "ectIntent:\001*ZG\"B/v2/{session=projects/*/" + + "locations/*/agent/sessions/*}:detectInte" + + "nt:\001*Z^\"Y/v2/{session=projects/*/locatio" + + "ns/*/agent/environments/*/users/*/sessio" + + "ns/*}:detectIntent:\001*\022\222\001\n\025StreamingDetec" + + "tIntent\0228.google.cloud.dialogflow.v2.Str" + + "eamingDetectIntentRequest\0329.google.cloud" + + ".dialogflow.v2.StreamingDetectIntentResp" + + "onse\"\000(\0010\001\032x\312A\031dialogflow.googleapis.com" + + "\322AYhttps://www.googleapis.com/auth/cloud" + + "-platform,https://www.googleapis.com/aut" + + "h/dialogflowB\347\003\n\036com.google.cloud.dialog" + + "flow.v2B\014SessionProtoP\001Z>cloud.google.co" + + "m/go/dialogflow/apiv2/dialogflowpb;dialo" + + "gflowpb\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V" + + "2\352A\321\002\n!dialogflow.googleapis.com/Session" + + "\022+projects/{project}/agent/sessions/{ses" + + "sion}\022Sprojects/{project}/agent/environm" + + "ents/{environment}/users/{user}/sessions" + + "/{session}\022@projects/{project}/locations" + + "/{location}/agent/sessions/{session}\022hpr" + + "ojects/{project}/locations/{location}/ag" + + "ent/environments/{environment}/users/{us" + + "er}/sessions/{session}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -478,7 +467,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SentimentAnalysisResult_descriptor, new java.lang.String[] { - "QueryTextSentiment", + "QueryTextSentiment", "Status", }); internal_static_google_cloud_dialogflow_v2_Sentiment_descriptor = getDescriptor().getMessageType(13); diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java index 89f7f39ddd75..c3d69418ecdf 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java @@ -80,36 +80,6 @@ public interface GeminiAsrConfigOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig) com.google.protobuf.MessageOrBuilder { - /** - * - * - *
-     * Optional. The Gemini ASR model ID used for transcription.
-     * This value overrides the default model ID configured on the server.
-     * Example: "gemini-3-flash-lite-asr-preview"
-     * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The modelId. - */ - java.lang.String getModelId(); - - /** - * - * - *
-     * Optional. The Gemini ASR model ID used for transcription.
-     * This value overrides the default model ID configured on the server.
-     * Example: "gemini-3-flash-lite-asr-preview"
-     * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for modelId. - */ - com.google.protobuf.ByteString getModelIdBytes(); - /** * * @@ -234,7 +204,6 @@ private GeminiAsrConfig(com.google.protobuf.GeneratedMessage.Builder builder) } private GeminiAsrConfig() { - modelId_ = ""; startOfSpeechSensitivity_ = 0; endOfSpeechSensitivity_ = 0; } @@ -603,63 +572,6 @@ private EndSensitivity(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig.EndSensitivity) } - public static final int MODEL_ID_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object modelId_ = ""; - - /** - * - * - *
-     * Optional. The Gemini ASR model ID used for transcription.
-     * This value overrides the default model ID configured on the server.
-     * Example: "gemini-3-flash-lite-asr-preview"
-     * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The modelId. - */ - @java.lang.Override - public java.lang.String getModelId() { - java.lang.Object ref = modelId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - modelId_ = s; - return s; - } - } - - /** - * - * - *
-     * Optional. The Gemini ASR model ID used for transcription.
-     * This value overrides the default model ID configured on the server.
-     * Example: "gemini-3-flash-lite-asr-preview"
-     * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for modelId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getModelIdBytes() { - java.lang.Object ref = modelId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - modelId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int SILENCE_DURATION_MS_FIELD_NUMBER = 2; private int silenceDurationMs_ = 0; @@ -806,9 +718,6 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(modelId_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, modelId_); - } if (silenceDurationMs_ != 0) { output.writeInt32(2, silenceDurationMs_); } @@ -836,9 +745,6 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(modelId_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, modelId_); - } if (silenceDurationMs_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, silenceDurationMs_); } @@ -873,7 +779,6 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig other = (com.google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig) obj; - if (!getModelId().equals(other.getModelId())) return false; if (getSilenceDurationMs() != other.getSilenceDurationMs()) return false; if (getPrefixPaddingMs() != other.getPrefixPaddingMs()) return false; if (startOfSpeechSensitivity_ != other.startOfSpeechSensitivity_) return false; @@ -889,8 +794,6 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + MODEL_ID_FIELD_NUMBER; - hash = (53 * hash) + getModelId().hashCode(); hash = (37 * hash) + SILENCE_DURATION_MS_FIELD_NUMBER; hash = (53 * hash) + getSilenceDurationMs(); hash = (37 * hash) + PREFIX_PADDING_MS_FIELD_NUMBER; @@ -1044,7 +947,6 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { public Builder clear() { super.clear(); bitField0_ = 0; - modelId_ = ""; silenceDurationMs_ = 0; prefixPaddingMs_ = 0; startOfSpeechSensitivity_ = 0; @@ -1089,18 +991,15 @@ private void buildPartial0( com.google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { - result.modelId_ = modelId_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { result.silenceDurationMs_ = silenceDurationMs_; } - if (((from_bitField0_ & 0x00000004) != 0)) { + if (((from_bitField0_ & 0x00000002) != 0)) { result.prefixPaddingMs_ = prefixPaddingMs_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000004) != 0)) { result.startOfSpeechSensitivity_ = startOfSpeechSensitivity_; } - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000008) != 0)) { result.endOfSpeechSensitivity_ = endOfSpeechSensitivity_; } } @@ -1121,11 +1020,6 @@ public Builder mergeFrom( if (other == com.google.cloud.dialogflow.v2.SpeechToTextConfig.GeminiAsrConfig .getDefaultInstance()) return this; - if (!other.getModelId().isEmpty()) { - modelId_ = other.modelId_; - bitField0_ |= 0x00000001; - onChanged(); - } if (other.getSilenceDurationMs() != 0) { setSilenceDurationMs(other.getSilenceDurationMs()); } @@ -1164,34 +1058,28 @@ public Builder mergeFrom( case 0: done = true; break; - case 10: - { - modelId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 case 16: { silenceDurationMs_ = input.readInt32(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; break; } // case 16 case 24: { prefixPaddingMs_ = input.readInt32(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; break; } // case 24 case 32: { startOfSpeechSensitivity_ = input.readEnum(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; break; } // case 32 case 40: { endOfSpeechSensitivity_ = input.readEnum(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; break; } // case 40 default: @@ -1213,127 +1101,6 @@ public Builder mergeFrom( private int bitField0_; - private java.lang.Object modelId_ = ""; - - /** - * - * - *
-       * Optional. The Gemini ASR model ID used for transcription.
-       * This value overrides the default model ID configured on the server.
-       * Example: "gemini-3-flash-lite-asr-preview"
-       * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The modelId. - */ - public java.lang.String getModelId() { - java.lang.Object ref = modelId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - modelId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * - * - *
-       * Optional. The Gemini ASR model ID used for transcription.
-       * This value overrides the default model ID configured on the server.
-       * Example: "gemini-3-flash-lite-asr-preview"
-       * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for modelId. - */ - public com.google.protobuf.ByteString getModelIdBytes() { - java.lang.Object ref = modelId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - modelId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * - * - *
-       * Optional. The Gemini ASR model ID used for transcription.
-       * This value overrides the default model ID configured on the server.
-       * Example: "gemini-3-flash-lite-asr-preview"
-       * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The modelId to set. - * @return This builder for chaining. - */ - public Builder setModelId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - modelId_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * - * - *
-       * Optional. The Gemini ASR model ID used for transcription.
-       * This value overrides the default model ID configured on the server.
-       * Example: "gemini-3-flash-lite-asr-preview"
-       * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearModelId() { - modelId_ = getDefaultInstance().getModelId(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - /** - * - * - *
-       * Optional. The Gemini ASR model ID used for transcription.
-       * This value overrides the default model ID configured on the server.
-       * Example: "gemini-3-flash-lite-asr-preview"
-       * 
- * - * string model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for modelId to set. - * @return This builder for chaining. - */ - public Builder setModelIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - modelId_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - private int silenceDurationMs_; /** @@ -1369,7 +1136,7 @@ public int getSilenceDurationMs() { public Builder setSilenceDurationMs(int value) { silenceDurationMs_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1387,7 +1154,7 @@ public Builder setSilenceDurationMs(int value) { * @return This builder for chaining. */ public Builder clearSilenceDurationMs() { - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); silenceDurationMs_ = 0; onChanged(); return this; @@ -1428,7 +1195,7 @@ public int getPrefixPaddingMs() { public Builder setPrefixPaddingMs(int value) { prefixPaddingMs_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1446,7 +1213,7 @@ public Builder setPrefixPaddingMs(int value) { * @return This builder for chaining. */ public Builder clearPrefixPaddingMs() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); prefixPaddingMs_ = 0; onChanged(); return this; @@ -1488,7 +1255,7 @@ public int getStartOfSpeechSensitivityValue() { */ public Builder setStartOfSpeechSensitivityValue(int value) { startOfSpeechSensitivity_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1538,7 +1305,7 @@ public Builder setStartOfSpeechSensitivity( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; startOfSpeechSensitivity_ = value.getNumber(); onChanged(); return this; @@ -1558,7 +1325,7 @@ public Builder setStartOfSpeechSensitivity( * @return This builder for chaining. */ public Builder clearStartOfSpeechSensitivity() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); startOfSpeechSensitivity_ = 0; onChanged(); return this; @@ -1600,7 +1367,7 @@ public int getEndOfSpeechSensitivityValue() { */ public Builder setEndOfSpeechSensitivityValue(int value) { endOfSpeechSensitivity_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1649,7 +1416,7 @@ public Builder setEndOfSpeechSensitivity( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; endOfSpeechSensitivity_ = value.getNumber(); onChanged(); return this; @@ -1669,7 +1436,7 @@ public Builder setEndOfSpeechSensitivity( * @return This builder for chaining. */ public Builder clearEndOfSpeechSensitivity() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000008); endOfSpeechSensitivity_ = 0; onChanged(); return this; @@ -2211,6 +1978,47 @@ public boolean getUseGeminiAsr() { return useGeminiAsr_; } + public static final int DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER = 17; + private boolean disableInterimInputTranscripts_ = false; + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2258,6 +2066,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (useGeminiAsr_ != false) { output.writeBool(16, useGeminiAsr_); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(17, disableInterimInputTranscripts_); + } getUnknownFields().writeTo(output); } @@ -2306,6 +2117,11 @@ public int getSerializedSize() { if (useGeminiAsr_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, useGeminiAsr_); } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 17, disableInterimInputTranscripts_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2335,6 +2151,12 @@ public boolean equals(final java.lang.Object obj) { if (!getGeminiAsrConfig().equals(other.getGeminiAsrConfig())) return false; } if (getUseGeminiAsr() != other.getUseGeminiAsr()) return false; + if (hasDisableInterimInputTranscripts() != other.hasDisableInterimInputTranscripts()) + return false; + if (hasDisableInterimInputTranscripts()) { + if (getDisableInterimInputTranscripts() != other.getDisableInterimInputTranscripts()) + return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2370,6 +2192,12 @@ public int hashCode() { } hash = (37 * hash) + USE_GEMINI_ASR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseGeminiAsr()); + if (hasDisableInterimInputTranscripts()) { + hash = (37 * hash) + DISABLE_INTERIM_INPUT_TRANSCRIPTS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getDisableInterimInputTranscripts()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2534,6 +2362,7 @@ public Builder clear() { geminiAsrConfigBuilder_ = null; } useGeminiAsr_ = false; + disableInterimInputTranscripts_ = false; return this; } @@ -2604,6 +2433,10 @@ private void buildPartial0(com.google.cloud.dialogflow.v2.SpeechToTextConfig res if (((from_bitField0_ & 0x00000200) != 0)) { result.useGeminiAsr_ = useGeminiAsr_; } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.disableInterimInputTranscripts_ = disableInterimInputTranscripts_; + to_bitField0_ |= 0x00000002; + } result.bitField0_ |= to_bitField0_; } @@ -2661,6 +2494,9 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.SpeechToTextConfig other if (other.getUseGeminiAsr() != false) { setUseGeminiAsr(other.getUseGeminiAsr()); } + if (other.hasDisableInterimInputTranscripts()) { + setDisableInterimInputTranscripts(other.getDisableInterimInputTranscripts()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2749,6 +2585,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000200; break; } // case 128 + case 136: + { + disableInterimInputTranscripts_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 136 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4054,6 +3896,90 @@ public Builder clearUseGeminiAsr() { return this; } + private boolean disableInterimInputTranscripts_; + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + @java.lang.Override + public boolean hasDisableInterimInputTranscripts() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + @java.lang.Override + public boolean getDisableInterimInputTranscripts() { + return disableInterimInputTranscripts_; + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The disableInterimInputTranscripts to set. + * @return This builder for chaining. + */ + public Builder setDisableInterimInputTranscripts(boolean value) { + + disableInterimInputTranscripts_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Disables emission of interim input transcriptions when set to
+     * `true`.
+     * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDisableInterimInputTranscripts() { + bitField0_ = (bitField0_ & ~0x00000400); + disableInterimInputTranscripts_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.SpeechToTextConfig) } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java index 4586df2baaab..d947c258283e 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java @@ -375,4 +375,36 @@ public interface SpeechToTextConfigOrBuilder * @return The useGeminiAsr. */ boolean getUseGeminiAsr(); + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the disableInterimInputTranscripts field is set. + */ + boolean hasDisableInterimInputTranscripts(); + + /** + * + * + *
+   * Optional. Disables emission of interim input transcriptions when set to
+   * `true`.
+   * 
+ * + * + * optional bool disable_interim_input_transcripts = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The disableInterimInputTranscripts. + */ + boolean getDisableInterimInputTranscripts(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SummarizationSection.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SummarizationSection.java index 3475ff57b8c4..62794a74c12c 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SummarizationSection.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SummarizationSection.java @@ -142,9 +142,10 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * "Unsatisfied" or "Satisfied" depending on the customer's feelings at
-     * the end of the conversation.
-     * Section name: "customer_satisfaction".
+     * Customer satisfaction derived from the text transcript only (not audio).
+     * Categorized based on customer statements by the end of the conversation.
+     * `D` for dissatisfied and `N` for neutral or satisfied (default).
+     * Section name: `customer_satisfaction`.
      * 
* * CUSTOMER_SATISFACTION = 5; @@ -272,9 +273,10 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * "Unsatisfied" or "Satisfied" depending on the customer's feelings at
-     * the end of the conversation.
-     * Section name: "customer_satisfaction".
+     * Customer satisfaction derived from the text transcript only (not audio).
+     * Categorized based on customer statements by the end of the conversation.
+     * `D` for dissatisfied and `N` for neutral or satisfied (default).
+     * Section name: `customer_satisfaction`.
      * 
* * CUSTOMER_SATISFACTION = 5; diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto index 7aa9b83d779c..9dd0129c7942 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto @@ -195,6 +195,11 @@ message InputAudioConfig { // Cloud Speech-to-Text. If false, Cloud Speech-to-Text will be used. // If unset, this setting is inherited from the ConversationProfile. optional bool use_gemini_asr = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables emission of interim input transcriptions when set to + // `true`. + optional bool disable_interim_input_transcripts = 32 + [(google.api.field_behavior) = OPTIONAL]; } // Description of which voice to use for speech synthesis. @@ -335,11 +340,6 @@ message SpeechToTextConfig { END_SENSITIVITY_LOW = 2; } - // Optional. The Gemini ASR model ID used for transcription. - // This value overrides the default model ID configured on the server. - // Example: "gemini-3-flash-lite-asr-preview" - string model_id = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The required duration of detected silence (or non-speech) // before end-of-speech is committed. int32 silence_duration_ms = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -439,6 +439,11 @@ message SpeechToTextConfig { // Optional. If true, Gemini ASR will be used for transcription instead of // Cloud Speech-to-Text. bool use_gemini_asr = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables emission of interim input transcriptions when set to + // `true`. + optional bool disable_interim_input_transcripts = 17 + [(google.api.field_behavior) = OPTIONAL]; } // [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_profile.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_profile.proto index 281c0b052877..a31cc8ccfcc9 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_profile.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_profile.proto @@ -689,9 +689,10 @@ message HumanAgentAssistantConfig { // Section name: "reason_for_cancellation". REASON_FOR_CANCELLATION = 4; - // "Unsatisfied" or "Satisfied" depending on the customer's feelings at - // the end of the conversation. - // Section name: "customer_satisfaction". + // Customer satisfaction derived from the text transcript only (not + // audio). Categorized based on customer statements by the end of the + // conversation. `D` for dissatisfied and `N` for neutral or satisfied + // (default). Section name: `customer_satisfaction`. CUSTOMER_SATISFACTION = 5; // Key entities extracted from the conversation, such as ticket number, diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/generator.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/generator.proto index 6288ef8d1d13..a2088ecfc81b 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/generator.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/generator.proto @@ -335,9 +335,10 @@ message SummarizationSection { // Section name: "reason_for_cancellation". REASON_FOR_CANCELLATION = 4; - // "Unsatisfied" or "Satisfied" depending on the customer's feelings at - // the end of the conversation. - // Section name: "customer_satisfaction". + // Customer satisfaction derived from the text transcript only (not audio). + // Categorized based on customer statements by the end of the conversation. + // `D` for dissatisfied and `N` for neutral or satisfied (default). + // Section name: `customer_satisfaction`. CUSTOMER_SATISFACTION = 5; // Key entities extracted from the conversation, such as ticket number, diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto index b94a62faaeb1..1f90d6cd0d7f 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto @@ -353,6 +353,10 @@ message Message { // Only one of `content` and `companion_query` should be set - not both. string content = 2 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Automated agent responses. + repeated ResponseMessage response_messages = 11 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. The message language. // This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) // language tag. Example: "en-US". @@ -1150,6 +1154,32 @@ message AutomatedAgentReply { // call. DetectIntentResponse detect_intent_response = 1; + // Response messages from the automated agent. + repeated ResponseMessage response_messages = 3; + + // Name of the intent if an intent is matched for the query. + // For a V2 query, the value format is `projects//locations/ + // /agent/intents/`. + // For a V3 query, the value format is `projects//locations/ + // /agents//intents/`. + string intent = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Event name if an event is triggered for the query. + string event = 5; + + // The confidence of the match. Values range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // This value is for informational purpose only and is only used to help match + // the best intent within the classification threshold. This value may change + // for the same end-user expression at any time due to a model retraining or + // change in implementation. + float match_confidence = 9; + + // The collection of current parameters at the time of this response. + google.protobuf.Struct parameters = 10; + // AutomatedAgentReply type. AutomatedAgentReplyType automated_agent_reply_type = 7; @@ -1162,6 +1192,9 @@ message AutomatedAgentReply { // Format: `projects//locations//agents//flows//pages/`. string cx_current_page = 11; + + // The auth code for accessing Call Companion UI. + bytes call_companion_auth_code = 12; } // Represents article answer. @@ -1417,6 +1450,102 @@ message AssistQueryParameters { map documents_metadata_filters = 1; } +// Response messages from an automated agent. +message ResponseMessage { + // The text response message. + message Text { + // A collection of text response variants. If multiple variants are + // defined, only one text response variant is returned at runtime. + repeated string text = 1; + } + + // Indicates that the conversation should be handed off to a human agent. + // + // Dialogflow only uses this to determine which conversations were handed off + // to a human agent for measurement purposes. What else to do with this signal + // is up to you and your handoff procedures. + // + // You may set this, for example: + // + // * In the entry fulfillment of a CX Page if entering the page indicates + // something went extremely wrong in the conversation. + // * In a webhook response when you determine that the customer issue can only + // be handled by a human. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that interaction with the Dialogflow agent has ended. + message EndInteraction {} + + // Represents an audio message that is composed of both segments + // synthesized from the Dialogflow agent prompts and ones hosted externally + // at the specified URIs. + message MixedAudio { + // Represents one segment of audio. + message Segment { + // Content of the segment. + oneof content { + // Raw audio synthesized from the Dialogflow agent's response using + // the output config specified in the request. + bytes audio = 1; + + // Client-specific URI that points to an audio clip accessible to the + // client. + string uri = 2; + } + + // Whether the playback of this segment can be interrupted by the end + // user's speech and the client should then start the next Dialogflow + // request. + bool allow_playback_interruption = 3; + } + + // Segments this audio response is composed of. + repeated Segment segments = 1; + } + + // Represents the signal that telles the client to transfer the phone call + // connected to the agent to a third-party endpoint. + message TelephonyTransferCall { + // Endpoint to transfer the call to. + oneof endpoint { + // Transfer the call to a phone number + // in [E.164 format](https://en.wikipedia.org/wiki/E.164). + string phone_number = 1; + + // Transfer the call to a SIP endpoint. + string sip_uri = 2; + } + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Hands off conversation to a live agent. + LiveAgentHandoff live_agent_handoff = 3; + + // A signal that indicates the interaction with the Dialogflow agent has + // ended. + EndInteraction end_interaction = 4; + + // An audio response message composed of both the synthesized Dialogflow + // agent responses and the audios hosted in places known to the client. + MixedAudio mixed_audio = 5; + + // A signal that the client should transfer the phone call connected to + // this agent to a third-party endpoint. + TelephonyTransferCall telephony_transfer_call = 6; + } +} + // The request message for // [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist]. message SuggestKnowledgeAssistRequest { @@ -2028,6 +2157,11 @@ message BidiStreamingAnalyzeContentRequest { // If unset, this setting is inherited from the ConversationProfile. optional bool use_gemini_asr = 25 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables emission of interim input transcriptions when set to + // `true`. + optional bool disable_interim_input_transcripts = 26 + [(google.api.field_behavior) = OPTIONAL]; } // Required. The name of the participant to fetch response for. diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/session.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/session.proto index 025b28f6c153..8bb13132009f 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/session.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/session.proto @@ -801,6 +801,11 @@ message SentimentAnalysisRequestConfig { message SentimentAnalysisResult { // The sentiment analysis result for `query_text`. Sentiment query_text_sentiment = 1; + + // Output only. The status of the sentiment analysis operation. + // If the operation failed, this field will contain the error details. + // For example, it might indicate a quota issue (RESOURCE_EXHAUSTED). + google.rpc.Status status = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // The sentiment, such as positive/negative feeling or association, for a unit diff --git a/java-modelarmor/google-cloud-modelarmor/src/main/java/com/google/cloud/modelarmor/v1/ModelArmorClient.java b/java-modelarmor/google-cloud-modelarmor/src/main/java/com/google/cloud/modelarmor/v1/ModelArmorClient.java index f998d9b626ff..52ae5d3269df 100644 --- a/java-modelarmor/google-cloud-modelarmor/src/main/java/com/google/cloud/modelarmor/v1/ModelArmorClient.java +++ b/java-modelarmor/google-cloud-modelarmor/src/main/java/com/google/cloud/modelarmor/v1/ModelArmorClient.java @@ -252,7 +252,9 @@ * * *

ListLocations - *

Lists information about the supported locations for this service. + *

Lists information about the supported locations for this service. + *

This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: ***Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. + *

For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. * *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    @@ -1403,6 +1405,18 @@ public final SanitizeModelResponseResponse sanitizeModelResponse( /** * Lists information about the supported locations for this service. * + *

    This method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *

    For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * *

    Sample code: * *

    {@code
    @@ -1436,6 +1450,18 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque
       /**
        * Lists information about the supported locations for this service.
        *
    +   * 

    This method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *

    For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * *

    Sample code: * *

    {@code
    @@ -1470,6 +1496,18 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque
       /**
        * Lists information about the supported locations for this service.
        *
    +   * 

    This method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *

    For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * *

    Sample code: * *

    {@code
    diff --git a/java-modelarmor/google-cloud-modelarmor/src/main/resources/META-INF/native-image/com.google.cloud.modelarmor.v1/reflect-config.json b/java-modelarmor/google-cloud-modelarmor/src/main/resources/META-INF/native-image/com.google.cloud.modelarmor.v1/reflect-config.json
    index aa5e68aea7b5..fbd7f3baa184 100644
    --- a/java-modelarmor/google-cloud-modelarmor/src/main/resources/META-INF/native-image/com.google.cloud.modelarmor.v1/reflect-config.json
    +++ b/java-modelarmor/google-cloud-modelarmor/src/main/resources/META-INF/native-image/com.google.cloud.modelarmor.v1/reflect-config.json
    @@ -773,6 +773,51 @@
         "allDeclaredClasses": true,
         "allPublicClasses": true
       },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.FilterVersionAlias",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.FilterVersionConfig",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.FilterVersionConfig$Builder",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.FilterVersionSelector",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.FilterVersionSelector$Builder",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
       {
         "name": "com.google.cloud.modelarmor.v1.FloorSetting",
         "queryAllDeclaredConstructors": true,
    @@ -980,6 +1025,24 @@
         "allDeclaredClasses": true,
         "allPublicClasses": true
       },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.McpServerFloorSetting",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
    +  {
    +    "name": "com.google.cloud.modelarmor.v1.McpServerFloorSetting$Builder",
    +    "queryAllDeclaredConstructors": true,
    +    "queryAllPublicConstructors": true,
    +    "queryAllDeclaredMethods": true,
    +    "allPublicMethods": true,
    +    "allDeclaredClasses": true,
    +    "allPublicClasses": true
    +  },
       {
         "name": "com.google.cloud.modelarmor.v1.MessageItem",
         "queryAllDeclaredConstructors": true,
    diff --git a/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientHttpJsonTest.java b/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientHttpJsonTest.java
    index 0c8be533af4a..5be7492a5756 100644
    --- a/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientHttpJsonTest.java
    +++ b/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientHttpJsonTest.java
    @@ -548,6 +548,7 @@ public void getFloorSettingTest() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockService.addResponse(expectedResponse);
     
    @@ -599,6 +600,7 @@ public void getFloorSettingTest2() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockService.addResponse(expectedResponse);
     
    @@ -650,6 +652,7 @@ public void updateFloorSettingTest() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockService.addResponse(expectedResponse);
     
    @@ -663,6 +666,7 @@ public void updateFloorSettingTest() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         FieldMask updateMask = FieldMask.newBuilder().build();
     
    @@ -702,6 +706,7 @@ public void updateFloorSettingExceptionTest() throws Exception {
                   .addAllIntegratedServices(new ArrayList())
                   .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                   .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +              .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                   .build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           client.updateFloorSetting(floorSetting, updateMask);
    diff --git a/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientTest.java b/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientTest.java
    index 853ae0ea1e90..d28bf9bc4133 100644
    --- a/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientTest.java
    +++ b/java-modelarmor/google-cloud-modelarmor/src/test/java/com/google/cloud/modelarmor/v1/ModelArmorClientTest.java
    @@ -495,6 +495,7 @@ public void getFloorSettingTest() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockModelArmor.addResponse(expectedResponse);
     
    @@ -540,6 +541,7 @@ public void getFloorSettingTest2() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockModelArmor.addResponse(expectedResponse);
     
    @@ -585,6 +587,7 @@ public void updateFloorSettingTest() throws Exception {
                 .addAllIntegratedServices(new ArrayList())
                 .setAiPlatformFloorSetting(AiPlatformFloorSetting.newBuilder().build())
                 .setFloorSettingMetadata(FloorSetting.FloorSettingMetadata.newBuilder().build())
    +            .setGoogleMcpServerFloorSetting(McpServerFloorSetting.newBuilder().build())
                 .build();
         mockModelArmor.addResponse(expectedResponse);
     
    diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItem.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItem.java
    index 54b8137babbe..55b84de601bf 100644
    --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItem.java
    +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItem.java
    @@ -54,6 +54,7 @@ private ByteDataItem(com.google.protobuf.GeneratedMessage.Builder builder) {
       private ByteDataItem() {
         byteDataType_ = 0;
         byteData_ = com.google.protobuf.ByteString.EMPTY;
    +    fileLabel_ = "";
       }
     
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    @@ -440,6 +441,61 @@ public com.google.protobuf.ByteString getByteData() {
         return byteData_;
       }
     
    +  public static final int FILE_LABEL_FIELD_NUMBER = 3;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object fileLabel_ = "";
    +
    +  /**
    +   *
    +   *
    +   * 
    +   * Optional. Label of the file. This is used to identify the file in the
    +   * response.
    +   * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileLabel. + */ + @java.lang.Override + public java.lang.String getFileLabel() { + java.lang.Object ref = fileLabel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileLabel_ = s; + return s; + } + } + + /** + * + * + *
    +   * Optional. Label of the file. This is used to identify the file in the
    +   * response.
    +   * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileLabelBytes() { + java.lang.Object ref = fileLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -462,6 +518,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!byteData_.isEmpty()) { output.writeBytes(2, byteData_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fileLabel_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, fileLabel_); + } getUnknownFields().writeTo(output); } @@ -479,6 +538,9 @@ public int getSerializedSize() { if (!byteData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, byteData_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fileLabel_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, fileLabel_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -497,6 +559,7 @@ public boolean equals(final java.lang.Object obj) { if (byteDataType_ != other.byteDataType_) return false; if (!getByteData().equals(other.getByteData())) return false; + if (!getFileLabel().equals(other.getFileLabel())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -512,6 +575,8 @@ public int hashCode() { hash = (53 * hash) + byteDataType_; hash = (37 * hash) + BYTE_DATA_FIELD_NUMBER; hash = (53 * hash) + getByteData().hashCode(); + hash = (37 * hash) + FILE_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFileLabel().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -654,6 +719,7 @@ public Builder clear() { bitField0_ = 0; byteDataType_ = 0; byteData_ = com.google.protobuf.ByteString.EMPTY; + fileLabel_ = ""; return this; } @@ -696,6 +762,9 @@ private void buildPartial0(com.google.cloud.modelarmor.v1.ByteDataItem result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.byteData_ = byteData_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fileLabel_ = fileLabel_; + } } @java.lang.Override @@ -716,6 +785,11 @@ public Builder mergeFrom(com.google.cloud.modelarmor.v1.ByteDataItem other) { if (!other.getByteData().isEmpty()) { setByteData(other.getByteData()); } + if (!other.getFileLabel().isEmpty()) { + fileLabel_ = other.fileLabel_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -754,6 +828,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + fileLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -938,6 +1018,122 @@ public Builder clearByteData() { return this; } + private java.lang.Object fileLabel_ = ""; + + /** + * + * + *
    +     * Optional. Label of the file. This is used to identify the file in the
    +     * response.
    +     * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileLabel. + */ + public java.lang.String getFileLabel() { + java.lang.Object ref = fileLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
    +     * Optional. Label of the file. This is used to identify the file in the
    +     * response.
    +     * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileLabel. + */ + public com.google.protobuf.ByteString getFileLabelBytes() { + java.lang.Object ref = fileLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
    +     * Optional. Label of the file. This is used to identify the file in the
    +     * response.
    +     * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The fileLabel to set. + * @return This builder for chaining. + */ + public Builder setFileLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fileLabel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. Label of the file. This is used to identify the file in the
    +     * response.
    +     * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFileLabel() { + fileLabel_ = getDefaultInstance().getFileLabel(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. Label of the file. This is used to identify the file in the
    +     * response.
    +     * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for fileLabel to set. + * @return This builder for chaining. + */ + public Builder setFileLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fileLabel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.ByteDataItem) } diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItemOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItemOrBuilder.java index 8902305373b8..fec7f7978c2e 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItemOrBuilder.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/ByteDataItemOrBuilder.java @@ -68,4 +68,32 @@ public interface ByteDataItemOrBuilder * @return The byteData. */ com.google.protobuf.ByteString getByteData(); + + /** + * + * + *
    +   * Optional. Label of the file. This is used to identify the file in the
    +   * response.
    +   * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileLabel. + */ + java.lang.String getFileLabel(); + + /** + * + * + *
    +   * Optional. Label of the file. This is used to identify the file in the
    +   * response.
    +   * 
    + * + * string file_label = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileLabel. + */ + com.google.protobuf.ByteString getFileLabelBytes(); } diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionAlias.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionAlias.java new file mode 100644 index 000000000000..58d1197151ed --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionAlias.java @@ -0,0 +1,259 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +/** + * + * + *
    + * Enum for Filter Version Aliases.
    + * These aliases provide a way to always point to a specific track
    + * without needing to update the version in templates.
    + * 
    + * + * Protobuf enum {@code google.cloud.modelarmor.v1.FilterVersionAlias} + */ +@com.google.protobuf.Generated +public enum FilterVersionAlias implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
    +   * The default value. If used, it will resolve to the `STABLE` alias.
    +   * 
    + * + * FILTER_VERSION_ALIAS_UNSPECIFIED = 0; + */ + FILTER_VERSION_ALIAS_UNSPECIFIED(0), + /** + * + * + *
    +   * The `STABLE` alias points to the most recent stable model version.
    +   * Using this alias means no code changes are required when a new model
    +   * becomes the stable version.
    +   * 
    + * + * FILTER_VERSION_ALIAS_STABLE = 1; + */ + FILTER_VERSION_ALIAS_STABLE(1), + /** + * + * + *
    +   * The `LATEST` alias points to the newest model version available.
    +   * This version is subject to frequent revisions and offers SLO guarantees
    +   * but does not assure stability, providing the most current security
    +   * protections.
    +   * 
    + * + * FILTER_VERSION_ALIAS_LATEST = 2; + */ + FILTER_VERSION_ALIAS_LATEST(2), + /** + * + * + *
    +   * The `LEGACY` alias could be used for sanitization operations for a
    +   * transition period. New templates cannot be created with this version.
    +   * 
    + * + * FILTER_VERSION_ALIAS_LEGACY = 3; + */ + FILTER_VERSION_ALIAS_LEGACY(3), + /** + * + * + *
    +   * The `RETIRED` alias could be used for versions that are no longer available
    +   * to be used. While new templates cannot be created with this alias, any
    +   * existing template or request using `RETIRED` version will fall back to
    +   * the current `STABLE` version for sanitization operations.
    +   * 
    + * + * FILTER_VERSION_ALIAS_RETIRED = 4; + */ + FILTER_VERSION_ALIAS_RETIRED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "FilterVersionAlias"); + } + + /** + * + * + *
    +   * The default value. If used, it will resolve to the `STABLE` alias.
    +   * 
    + * + * FILTER_VERSION_ALIAS_UNSPECIFIED = 0; + */ + public static final int FILTER_VERSION_ALIAS_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
    +   * The `STABLE` alias points to the most recent stable model version.
    +   * Using this alias means no code changes are required when a new model
    +   * becomes the stable version.
    +   * 
    + * + * FILTER_VERSION_ALIAS_STABLE = 1; + */ + public static final int FILTER_VERSION_ALIAS_STABLE_VALUE = 1; + + /** + * + * + *
    +   * The `LATEST` alias points to the newest model version available.
    +   * This version is subject to frequent revisions and offers SLO guarantees
    +   * but does not assure stability, providing the most current security
    +   * protections.
    +   * 
    + * + * FILTER_VERSION_ALIAS_LATEST = 2; + */ + public static final int FILTER_VERSION_ALIAS_LATEST_VALUE = 2; + + /** + * + * + *
    +   * The `LEGACY` alias could be used for sanitization operations for a
    +   * transition period. New templates cannot be created with this version.
    +   * 
    + * + * FILTER_VERSION_ALIAS_LEGACY = 3; + */ + public static final int FILTER_VERSION_ALIAS_LEGACY_VALUE = 3; + + /** + * + * + *
    +   * The `RETIRED` alias could be used for versions that are no longer available
    +   * to be used. While new templates cannot be created with this alias, any
    +   * existing template or request using `RETIRED` version will fall back to
    +   * the current `STABLE` version for sanitization operations.
    +   * 
    + * + * FILTER_VERSION_ALIAS_RETIRED = 4; + */ + public static final int FILTER_VERSION_ALIAS_RETIRED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FilterVersionAlias valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FilterVersionAlias forNumber(int value) { + switch (value) { + case 0: + return FILTER_VERSION_ALIAS_UNSPECIFIED; + case 1: + return FILTER_VERSION_ALIAS_STABLE; + case 2: + return FILTER_VERSION_ALIAS_LATEST; + case 3: + return FILTER_VERSION_ALIAS_LEGACY; + case 4: + return FILTER_VERSION_ALIAS_RETIRED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FilterVersionAlias findValueByNumber(int number) { + return FilterVersionAlias.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto.getDescriptor().getEnumTypes().get(8); + } + + private static final FilterVersionAlias[] VALUES = values(); + + public static FilterVersionAlias valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private FilterVersionAlias(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.modelarmor.v1.FilterVersionAlias) +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfig.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfig.java new file mode 100644 index 000000000000..9a289e2fe1e0 --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfig.java @@ -0,0 +1,2008 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +/** + * + * + *
    + * Message describing a Filter Version Configuration.
    + * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.FilterVersionConfig} + */ +@com.google.protobuf.Generated +public final class FilterVersionConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.modelarmor.v1.FilterVersionConfig) + FilterVersionConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "FilterVersionConfig"); + } + + // Use FilterVersionConfig.newBuilder() to construct. + private FilterVersionConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FilterVersionConfig() { + filterVersion_ = ""; + filterVersionAlias_ = 0; + messageItems_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.FilterVersionConfig.class, + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder.class); + } + + private int bitField0_; + public static final int FILTER_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filterVersion_ = ""; + + /** + * + * + *
    +   * Output only. The identifier for this specific version.
    +   * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The filterVersion. + */ + @java.lang.Override + public java.lang.String getFilterVersion() { + java.lang.Object ref = filterVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filterVersion_ = s; + return s; + } + } + + /** + * + * + *
    +   * Output only. The identifier for this specific version.
    +   * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for filterVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterVersionBytes() { + java.lang.Object ref = filterVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filterVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_VERSION_ALIAS_FIELD_NUMBER = 2; + private int filterVersionAlias_ = 0; + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionAlias field is set. + */ + @java.lang.Override + public boolean hasFilterVersionAlias() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for filterVersionAlias. + */ + @java.lang.Override + public int getFilterVersionAliasValue() { + return filterVersionAlias_; + } + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionAlias. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionAlias getFilterVersionAlias() { + com.google.cloud.modelarmor.v1.FilterVersionAlias result = + com.google.cloud.modelarmor.v1.FilterVersionAlias.forNumber(filterVersionAlias_); + return result == null ? com.google.cloud.modelarmor.v1.FilterVersionAlias.UNRECOGNIZED : result; + } + + public static final int RELEASE_DATE_FIELD_NUMBER = 3; + private com.google.type.Date releaseDate_; + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the releaseDate field is set. + */ + @java.lang.Override + public boolean hasReleaseDate() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The releaseDate. + */ + @java.lang.Override + public com.google.type.Date getReleaseDate() { + return releaseDate_ == null ? com.google.type.Date.getDefaultInstance() : releaseDate_; + } + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.type.DateOrBuilder getReleaseDateOrBuilder() { + return releaseDate_ == null ? com.google.type.Date.getDefaultInstance() : releaseDate_; + } + + public static final int PROJECTED_DEPRECATION_DATE_FIELD_NUMBER = 4; + private com.google.type.Date projectedDeprecationDate_; + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the projectedDeprecationDate field is set. + */ + @java.lang.Override + public boolean hasProjectedDeprecationDate() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The projectedDeprecationDate. + */ + @java.lang.Override + public com.google.type.Date getProjectedDeprecationDate() { + return projectedDeprecationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : projectedDeprecationDate_; + } + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.type.DateOrBuilder getProjectedDeprecationDateOrBuilder() { + return projectedDeprecationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : projectedDeprecationDate_; + } + + public static final int MESSAGE_ITEMS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List messageItems_; + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getMessageItemsList() { + return messageItems_; + } + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMessageItemsOrBuilderList() { + return messageItems_; + } + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMessageItemsCount() { + return messageItems_.size(); + } + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.MessageItem getMessageItems(int index) { + return messageItems_.get(index); + } + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.MessageItemOrBuilder getMessageItemsOrBuilder(int index) { + return messageItems_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filterVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filterVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(2, filterVersionAlias_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getReleaseDate()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getProjectedDeprecationDate()); + } + for (int i = 0; i < messageItems_.size(); i++) { + output.writeMessage(5, messageItems_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filterVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filterVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, filterVersionAlias_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReleaseDate()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getProjectedDeprecationDate()); + } + for (int i = 0; i < messageItems_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, messageItems_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.modelarmor.v1.FilterVersionConfig)) { + return super.equals(obj); + } + com.google.cloud.modelarmor.v1.FilterVersionConfig other = + (com.google.cloud.modelarmor.v1.FilterVersionConfig) obj; + + if (!getFilterVersion().equals(other.getFilterVersion())) return false; + if (hasFilterVersionAlias() != other.hasFilterVersionAlias()) return false; + if (hasFilterVersionAlias()) { + if (filterVersionAlias_ != other.filterVersionAlias_) return false; + } + if (hasReleaseDate() != other.hasReleaseDate()) return false; + if (hasReleaseDate()) { + if (!getReleaseDate().equals(other.getReleaseDate())) return false; + } + if (hasProjectedDeprecationDate() != other.hasProjectedDeprecationDate()) return false; + if (hasProjectedDeprecationDate()) { + if (!getProjectedDeprecationDate().equals(other.getProjectedDeprecationDate())) return false; + } + if (!getMessageItemsList().equals(other.getMessageItemsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getFilterVersion().hashCode(); + if (hasFilterVersionAlias()) { + hash = (37 * hash) + FILTER_VERSION_ALIAS_FIELD_NUMBER; + hash = (53 * hash) + filterVersionAlias_; + } + if (hasReleaseDate()) { + hash = (37 * hash) + RELEASE_DATE_FIELD_NUMBER; + hash = (53 * hash) + getReleaseDate().hashCode(); + } + if (hasProjectedDeprecationDate()) { + hash = (37 * hash) + PROJECTED_DEPRECATION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getProjectedDeprecationDate().hashCode(); + } + if (getMessageItemsCount() > 0) { + hash = (37 * hash) + MESSAGE_ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getMessageItemsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.modelarmor.v1.FilterVersionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
    +   * Message describing a Filter Version Configuration.
    +   * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.FilterVersionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.modelarmor.v1.FilterVersionConfig) + com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.FilterVersionConfig.class, + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder.class); + } + + // Construct using com.google.cloud.modelarmor.v1.FilterVersionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReleaseDateFieldBuilder(); + internalGetProjectedDeprecationDateFieldBuilder(); + internalGetMessageItemsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filterVersion_ = ""; + filterVersionAlias_ = 0; + releaseDate_ = null; + if (releaseDateBuilder_ != null) { + releaseDateBuilder_.dispose(); + releaseDateBuilder_ = null; + } + projectedDeprecationDate_ = null; + if (projectedDeprecationDateBuilder_ != null) { + projectedDeprecationDateBuilder_.dispose(); + projectedDeprecationDateBuilder_ = null; + } + if (messageItemsBuilder_ == null) { + messageItems_ = java.util.Collections.emptyList(); + } else { + messageItems_ = null; + messageItemsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfig getDefaultInstanceForType() { + return com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfig build() { + com.google.cloud.modelarmor.v1.FilterVersionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfig buildPartial() { + com.google.cloud.modelarmor.v1.FilterVersionConfig result = + new com.google.cloud.modelarmor.v1.FilterVersionConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.modelarmor.v1.FilterVersionConfig result) { + if (messageItemsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + messageItems_ = java.util.Collections.unmodifiableList(messageItems_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.messageItems_ = messageItems_; + } else { + result.messageItems_ = messageItemsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.modelarmor.v1.FilterVersionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filterVersion_ = filterVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filterVersionAlias_ = filterVersionAlias_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.releaseDate_ = + releaseDateBuilder_ == null ? releaseDate_ : releaseDateBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.projectedDeprecationDate_ = + projectedDeprecationDateBuilder_ == null + ? projectedDeprecationDate_ + : projectedDeprecationDateBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.modelarmor.v1.FilterVersionConfig) { + return mergeFrom((com.google.cloud.modelarmor.v1.FilterVersionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.modelarmor.v1.FilterVersionConfig other) { + if (other == com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance()) + return this; + if (!other.getFilterVersion().isEmpty()) { + filterVersion_ = other.filterVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFilterVersionAlias()) { + setFilterVersionAliasValue(other.getFilterVersionAliasValue()); + } + if (other.hasReleaseDate()) { + mergeReleaseDate(other.getReleaseDate()); + } + if (other.hasProjectedDeprecationDate()) { + mergeProjectedDeprecationDate(other.getProjectedDeprecationDate()); + } + if (messageItemsBuilder_ == null) { + if (!other.messageItems_.isEmpty()) { + if (messageItems_.isEmpty()) { + messageItems_ = other.messageItems_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureMessageItemsIsMutable(); + messageItems_.addAll(other.messageItems_); + } + onChanged(); + } + } else { + if (!other.messageItems_.isEmpty()) { + if (messageItemsBuilder_.isEmpty()) { + messageItemsBuilder_.dispose(); + messageItemsBuilder_ = null; + messageItems_ = other.messageItems_; + bitField0_ = (bitField0_ & ~0x00000010); + messageItemsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMessageItemsFieldBuilder() + : null; + } else { + messageItemsBuilder_.addAllMessages(other.messageItems_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + filterVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + filterVersionAlias_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetReleaseDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetProjectedDeprecationDateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.cloud.modelarmor.v1.MessageItem m = + input.readMessage( + com.google.cloud.modelarmor.v1.MessageItem.parser(), extensionRegistry); + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + messageItems_.add(m); + } else { + messageItemsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object filterVersion_ = ""; + + /** + * + * + *
    +     * Output only. The identifier for this specific version.
    +     * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The filterVersion. + */ + public java.lang.String getFilterVersion() { + java.lang.Object ref = filterVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filterVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
    +     * Output only. The identifier for this specific version.
    +     * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for filterVersion. + */ + public com.google.protobuf.ByteString getFilterVersionBytes() { + java.lang.Object ref = filterVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filterVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
    +     * Output only. The identifier for this specific version.
    +     * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The filterVersion to set. + * @return This builder for chaining. + */ + public Builder setFilterVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filterVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The identifier for this specific version.
    +     * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFilterVersion() { + filterVersion_ = getDefaultInstance().getFilterVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The identifier for this specific version.
    +     * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for filterVersion to set. + * @return This builder for chaining. + */ + public Builder setFilterVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filterVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int filterVersionAlias_ = 0; + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionAlias field is set. + */ + @java.lang.Override + public boolean hasFilterVersionAlias() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for filterVersionAlias. + */ + @java.lang.Override + public int getFilterVersionAliasValue() { + return filterVersionAlias_; + } + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for filterVersionAlias to set. + * @return This builder for chaining. + */ + public Builder setFilterVersionAliasValue(int value) { + filterVersionAlias_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionAlias. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionAlias getFilterVersionAlias() { + com.google.cloud.modelarmor.v1.FilterVersionAlias result = + com.google.cloud.modelarmor.v1.FilterVersionAlias.forNumber(filterVersionAlias_); + return result == null + ? com.google.cloud.modelarmor.v1.FilterVersionAlias.UNRECOGNIZED + : result; + } + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The filterVersionAlias to set. + * @return This builder for chaining. + */ + public Builder setFilterVersionAlias(com.google.cloud.modelarmor.v1.FilterVersionAlias value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + filterVersionAlias_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The alias associated with this version, if any (e.g.,
    +     * "STABLE", "LATEST"). This will be populated if this version is currently
    +     * mapped to an alias.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFilterVersionAlias() { + bitField0_ = (bitField0_ & ~0x00000002); + filterVersionAlias_ = 0; + onChanged(); + return this; + } + + private com.google.type.Date releaseDate_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + releaseDateBuilder_; + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the releaseDate field is set. + */ + public boolean hasReleaseDate() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The releaseDate. + */ + public com.google.type.Date getReleaseDate() { + if (releaseDateBuilder_ == null) { + return releaseDate_ == null ? com.google.type.Date.getDefaultInstance() : releaseDate_; + } else { + return releaseDateBuilder_.getMessage(); + } + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReleaseDate(com.google.type.Date value) { + if (releaseDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + releaseDate_ = value; + } else { + releaseDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReleaseDate(com.google.type.Date.Builder builderForValue) { + if (releaseDateBuilder_ == null) { + releaseDate_ = builderForValue.build(); + } else { + releaseDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeReleaseDate(com.google.type.Date value) { + if (releaseDateBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && releaseDate_ != null + && releaseDate_ != com.google.type.Date.getDefaultInstance()) { + getReleaseDateBuilder().mergeFrom(value); + } else { + releaseDate_ = value; + } + } else { + releaseDateBuilder_.mergeFrom(value); + } + if (releaseDate_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearReleaseDate() { + bitField0_ = (bitField0_ & ~0x00000004); + releaseDate_ = null; + if (releaseDateBuilder_ != null) { + releaseDateBuilder_.dispose(); + releaseDateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.Date.Builder getReleaseDateBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReleaseDateFieldBuilder().getBuilder(); + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.DateOrBuilder getReleaseDateOrBuilder() { + if (releaseDateBuilder_ != null) { + return releaseDateBuilder_.getMessageOrBuilder(); + } else { + return releaseDate_ == null ? com.google.type.Date.getDefaultInstance() : releaseDate_; + } + } + + /** + * + * + *
    +     * Output only. The date when this version was released.
    +     * 
    + * + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + internalGetReleaseDateFieldBuilder() { + if (releaseDateBuilder_ == null) { + releaseDateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + getReleaseDate(), getParentForChildren(), isClean()); + releaseDate_ = null; + } + return releaseDateBuilder_; + } + + private com.google.type.Date projectedDeprecationDate_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + projectedDeprecationDateBuilder_; + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the projectedDeprecationDate field is set. + */ + public boolean hasProjectedDeprecationDate() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The projectedDeprecationDate. + */ + public com.google.type.Date getProjectedDeprecationDate() { + if (projectedDeprecationDateBuilder_ == null) { + return projectedDeprecationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : projectedDeprecationDate_; + } else { + return projectedDeprecationDateBuilder_.getMessage(); + } + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setProjectedDeprecationDate(com.google.type.Date value) { + if (projectedDeprecationDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + projectedDeprecationDate_ = value; + } else { + projectedDeprecationDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setProjectedDeprecationDate(com.google.type.Date.Builder builderForValue) { + if (projectedDeprecationDateBuilder_ == null) { + projectedDeprecationDate_ = builderForValue.build(); + } else { + projectedDeprecationDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeProjectedDeprecationDate(com.google.type.Date value) { + if (projectedDeprecationDateBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && projectedDeprecationDate_ != null + && projectedDeprecationDate_ != com.google.type.Date.getDefaultInstance()) { + getProjectedDeprecationDateBuilder().mergeFrom(value); + } else { + projectedDeprecationDate_ = value; + } + } else { + projectedDeprecationDateBuilder_.mergeFrom(value); + } + if (projectedDeprecationDate_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearProjectedDeprecationDate() { + bitField0_ = (bitField0_ & ~0x00000008); + projectedDeprecationDate_ = null; + if (projectedDeprecationDateBuilder_ != null) { + projectedDeprecationDateBuilder_.dispose(); + projectedDeprecationDateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.Date.Builder getProjectedDeprecationDateBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetProjectedDeprecationDateFieldBuilder().getBuilder(); + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.type.DateOrBuilder getProjectedDeprecationDateOrBuilder() { + if (projectedDeprecationDateBuilder_ != null) { + return projectedDeprecationDateBuilder_.getMessageOrBuilder(); + } else { + return projectedDeprecationDate_ == null + ? com.google.type.Date.getDefaultInstance() + : projectedDeprecationDate_; + } + } + + /** + * + * + *
    +     * Output only. The estimated date when this version is projected to be
    +     * deprecated.
    +     * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + internalGetProjectedDeprecationDateFieldBuilder() { + if (projectedDeprecationDateBuilder_ == null) { + projectedDeprecationDateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + getProjectedDeprecationDate(), getParentForChildren(), isClean()); + projectedDeprecationDate_ = null; + } + return projectedDeprecationDateBuilder_; + } + + private java.util.List messageItems_ = + java.util.Collections.emptyList(); + + private void ensureMessageItemsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + messageItems_ = + new java.util.ArrayList(messageItems_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.modelarmor.v1.MessageItem, + com.google.cloud.modelarmor.v1.MessageItem.Builder, + com.google.cloud.modelarmor.v1.MessageItemOrBuilder> + messageItemsBuilder_; + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getMessageItemsList() { + if (messageItemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(messageItems_); + } else { + return messageItemsBuilder_.getMessageList(); + } + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMessageItemsCount() { + if (messageItemsBuilder_ == null) { + return messageItems_.size(); + } else { + return messageItemsBuilder_.getCount(); + } + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.MessageItem getMessageItems(int index) { + if (messageItemsBuilder_ == null) { + return messageItems_.get(index); + } else { + return messageItemsBuilder_.getMessage(index); + } + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMessageItems(int index, com.google.cloud.modelarmor.v1.MessageItem value) { + if (messageItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessageItemsIsMutable(); + messageItems_.set(index, value); + onChanged(); + } else { + messageItemsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMessageItems( + int index, com.google.cloud.modelarmor.v1.MessageItem.Builder builderForValue) { + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + messageItems_.set(index, builderForValue.build()); + onChanged(); + } else { + messageItemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMessageItems(com.google.cloud.modelarmor.v1.MessageItem value) { + if (messageItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessageItemsIsMutable(); + messageItems_.add(value); + onChanged(); + } else { + messageItemsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMessageItems(int index, com.google.cloud.modelarmor.v1.MessageItem value) { + if (messageItemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessageItemsIsMutable(); + messageItems_.add(index, value); + onChanged(); + } else { + messageItemsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMessageItems( + com.google.cloud.modelarmor.v1.MessageItem.Builder builderForValue) { + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + messageItems_.add(builderForValue.build()); + onChanged(); + } else { + messageItemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMessageItems( + int index, com.google.cloud.modelarmor.v1.MessageItem.Builder builderForValue) { + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + messageItems_.add(index, builderForValue.build()); + onChanged(); + } else { + messageItemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMessageItems( + java.lang.Iterable values) { + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messageItems_); + onChanged(); + } else { + messageItemsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMessageItems() { + if (messageItemsBuilder_ == null) { + messageItems_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + messageItemsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMessageItems(int index) { + if (messageItemsBuilder_ == null) { + ensureMessageItemsIsMutable(); + messageItems_.remove(index); + onChanged(); + } else { + messageItemsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.MessageItem.Builder getMessageItemsBuilder(int index) { + return internalGetMessageItemsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.MessageItemOrBuilder getMessageItemsOrBuilder(int index) { + if (messageItemsBuilder_ == null) { + return messageItems_.get(index); + } else { + return messageItemsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMessageItemsOrBuilderList() { + if (messageItemsBuilder_ != null) { + return messageItemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messageItems_); + } + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.MessageItem.Builder addMessageItemsBuilder() { + return internalGetMessageItemsFieldBuilder() + .addBuilder(com.google.cloud.modelarmor.v1.MessageItem.getDefaultInstance()); + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.MessageItem.Builder addMessageItemsBuilder(int index) { + return internalGetMessageItemsFieldBuilder() + .addBuilder(index, com.google.cloud.modelarmor.v1.MessageItem.getDefaultInstance()); + } + + /** + * + * + *
    +     * Output only. Extra information regarding this filter version
    +     * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMessageItemsBuilderList() { + return internalGetMessageItemsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.modelarmor.v1.MessageItem, + com.google.cloud.modelarmor.v1.MessageItem.Builder, + com.google.cloud.modelarmor.v1.MessageItemOrBuilder> + internalGetMessageItemsFieldBuilder() { + if (messageItemsBuilder_ == null) { + messageItemsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.modelarmor.v1.MessageItem, + com.google.cloud.modelarmor.v1.MessageItem.Builder, + com.google.cloud.modelarmor.v1.MessageItemOrBuilder>( + messageItems_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + messageItems_ = null; + } + return messageItemsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.FilterVersionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.modelarmor.v1.FilterVersionConfig) + private static final com.google.cloud.modelarmor.v1.FilterVersionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.modelarmor.v1.FilterVersionConfig(); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilterVersionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfigOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfigOrBuilder.java new file mode 100644 index 000000000000..00b5e8e172ec --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionConfigOrBuilder.java @@ -0,0 +1,257 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +@com.google.protobuf.Generated +public interface FilterVersionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.modelarmor.v1.FilterVersionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +   * Output only. The identifier for this specific version.
    +   * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The filterVersion. + */ + java.lang.String getFilterVersion(); + + /** + * + * + *
    +   * Output only. The identifier for this specific version.
    +   * 
    + * + * string filter_version = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for filterVersion. + */ + com.google.protobuf.ByteString getFilterVersionBytes(); + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionAlias field is set. + */ + boolean hasFilterVersionAlias(); + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for filterVersionAlias. + */ + int getFilterVersionAliasValue(); + + /** + * + * + *
    +   * Output only. The alias associated with this version, if any (e.g.,
    +   * "STABLE", "LATEST"). This will be populated if this version is currently
    +   * mapped to an alias.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionAlias filter_version_alias = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionAlias. + */ + com.google.cloud.modelarmor.v1.FilterVersionAlias getFilterVersionAlias(); + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the releaseDate field is set. + */ + boolean hasReleaseDate(); + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The releaseDate. + */ + com.google.type.Date getReleaseDate(); + + /** + * + * + *
    +   * Output only. The date when this version was released.
    +   * 
    + * + * optional .google.type.Date release_date = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.type.DateOrBuilder getReleaseDateOrBuilder(); + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the projectedDeprecationDate field is set. + */ + boolean hasProjectedDeprecationDate(); + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The projectedDeprecationDate. + */ + com.google.type.Date getProjectedDeprecationDate(); + + /** + * + * + *
    +   * Output only. The estimated date when this version is projected to be
    +   * deprecated.
    +   * 
    + * + * + * optional .google.type.Date projected_deprecation_date = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.type.DateOrBuilder getProjectedDeprecationDateOrBuilder(); + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMessageItemsList(); + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.modelarmor.v1.MessageItem getMessageItems(int index); + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMessageItemsCount(); + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMessageItemsOrBuilderList(); + + /** + * + * + *
    +   * Output only. Extra information regarding this filter version
    +   * 
    + * + * + * repeated .google.cloud.modelarmor.v1.MessageItem message_items = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.modelarmor.v1.MessageItemOrBuilder getMessageItemsOrBuilder(int index); +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelector.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelector.java new file mode 100644 index 000000000000..fe0e7b8e5ce8 --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelector.java @@ -0,0 +1,995 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +/** + * + * + *
    + * Represents the configuration for selecting a Filter Version.
    + * Allows customers to choose to use either a specific version or a predefined
    + * alias.
    + * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.FilterVersionSelector} + */ +@com.google.protobuf.Generated +public final class FilterVersionSelector extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.modelarmor.v1.FilterVersionSelector) + FilterVersionSelectorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "FilterVersionSelector"); + } + + // Use FilterVersionSelector.newBuilder() to construct. + private FilterVersionSelector(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FilterVersionSelector() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.FilterVersionSelector.class, + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder.class); + } + + private int versionSpecCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object versionSpec_; + + public enum VersionSpecCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VERSION(1), + ALIAS(2), + VERSIONSPEC_NOT_SET(0); + private final int value; + + private VersionSpecCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionSpecCase valueOf(int value) { + return forNumber(value); + } + + public static VersionSpecCase forNumber(int value) { + switch (value) { + case 1: + return VERSION; + case 2: + return ALIAS; + case 0: + return VERSIONSPEC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public VersionSpecCase getVersionSpecCase() { + return VersionSpecCase.forNumber(versionSpecCase_); + } + + public static final int VERSION_FIELD_NUMBER = 1; + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return versionSpecCase_ == 1; + } + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = ""; + if (versionSpecCase_ == 1) { + ref = versionSpec_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (versionSpecCase_ == 1) { + versionSpec_ = s; + } + return s; + } + } + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = ""; + if (versionSpecCase_ == 1) { + ref = versionSpec_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (versionSpecCase_ == 1) { + versionSpec_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALIAS_FIELD_NUMBER = 2; + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return Whether the alias field is set. + */ + public boolean hasAlias() { + return versionSpecCase_ == 2; + } + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The enum numeric value on the wire for alias. + */ + public int getAliasValue() { + if (versionSpecCase_ == 2) { + return (java.lang.Integer) versionSpec_; + } + return 0; + } + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The alias. + */ + public com.google.cloud.modelarmor.v1.FilterVersionAlias getAlias() { + if (versionSpecCase_ == 2) { + com.google.cloud.modelarmor.v1.FilterVersionAlias result = + com.google.cloud.modelarmor.v1.FilterVersionAlias.forNumber( + (java.lang.Integer) versionSpec_); + return result == null + ? com.google.cloud.modelarmor.v1.FilterVersionAlias.UNRECOGNIZED + : result; + } + return com.google.cloud.modelarmor.v1.FilterVersionAlias.FILTER_VERSION_ALIAS_UNSPECIFIED; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (versionSpecCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, versionSpec_); + } + if (versionSpecCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) versionSpec_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (versionSpecCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, versionSpec_); + } + if (versionSpecCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 2, ((java.lang.Integer) versionSpec_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.modelarmor.v1.FilterVersionSelector)) { + return super.equals(obj); + } + com.google.cloud.modelarmor.v1.FilterVersionSelector other = + (com.google.cloud.modelarmor.v1.FilterVersionSelector) obj; + + if (!getVersionSpecCase().equals(other.getVersionSpecCase())) return false; + switch (versionSpecCase_) { + case 1: + if (!getVersion().equals(other.getVersion())) return false; + break; + case 2: + if (getAliasValue() != other.getAliasValue()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (versionSpecCase_) { + case 1: + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + break; + case 2: + hash = (37 * hash) + ALIAS_FIELD_NUMBER; + hash = (53 * hash) + getAliasValue(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.modelarmor.v1.FilterVersionSelector prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
    +   * Represents the configuration for selecting a Filter Version.
    +   * Allows customers to choose to use either a specific version or a predefined
    +   * alias.
    +   * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.FilterVersionSelector} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.modelarmor.v1.FilterVersionSelector) + com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.FilterVersionSelector.class, + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder.class); + } + + // Construct using com.google.cloud.modelarmor.v1.FilterVersionSelector.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + versionSpecCase_ = 0; + versionSpec_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelector getDefaultInstanceForType() { + return com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelector build() { + com.google.cloud.modelarmor.v1.FilterVersionSelector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelector buildPartial() { + com.google.cloud.modelarmor.v1.FilterVersionSelector result = + new com.google.cloud.modelarmor.v1.FilterVersionSelector(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.modelarmor.v1.FilterVersionSelector result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.modelarmor.v1.FilterVersionSelector result) { + result.versionSpecCase_ = versionSpecCase_; + result.versionSpec_ = this.versionSpec_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.modelarmor.v1.FilterVersionSelector) { + return mergeFrom((com.google.cloud.modelarmor.v1.FilterVersionSelector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.modelarmor.v1.FilterVersionSelector other) { + if (other == com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance()) + return this; + switch (other.getVersionSpecCase()) { + case VERSION: + { + versionSpecCase_ = 1; + versionSpec_ = other.versionSpec_; + onChanged(); + break; + } + case ALIAS: + { + setAliasValue(other.getAliasValue()); + break; + } + case VERSIONSPEC_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + versionSpecCase_ = 1; + versionSpec_ = s; + break; + } // case 10 + case 16: + { + int rawValue = input.readEnum(); + versionSpecCase_ = 2; + versionSpec_ = rawValue; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int versionSpecCase_ = 0; + private java.lang.Object versionSpec_; + + public VersionSpecCase getVersionSpecCase() { + return VersionSpecCase.forNumber(versionSpecCase_); + } + + public Builder clearVersionSpec() { + versionSpecCase_ = 0; + versionSpec_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return versionSpecCase_ == 1; + } + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = ""; + if (versionSpecCase_ == 1) { + ref = versionSpec_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (versionSpecCase_ == 1) { + versionSpec_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = ""; + if (versionSpecCase_ == 1) { + ref = versionSpec_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (versionSpecCase_ == 1) { + versionSpec_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + versionSpecCase_ = 1; + versionSpec_ = value; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + if (versionSpecCase_ == 1) { + versionSpecCase_ = 0; + versionSpec_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
    +     * Allows customers to pin to a specific, immutable Filter Version.
    +     * This provides stability, as this will not change after a version upgrade.
    +     * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +     * Requests providing an invalid or non-existent version string will be
    +     * rejected with an `INVALID_ARGUMENT` error.
    +     * 
    + * + * string version = 1; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + versionSpecCase_ = 1; + versionSpec_ = value; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return Whether the alias field is set. + */ + @java.lang.Override + public boolean hasAlias() { + return versionSpecCase_ == 2; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The enum numeric value on the wire for alias. + */ + @java.lang.Override + public int getAliasValue() { + if (versionSpecCase_ == 2) { + return ((java.lang.Integer) versionSpec_).intValue(); + } + return 0; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @param value The enum numeric value on the wire for alias to set. + * @return This builder for chaining. + */ + public Builder setAliasValue(int value) { + versionSpecCase_ = 2; + versionSpec_ = value; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The alias. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionAlias getAlias() { + if (versionSpecCase_ == 2) { + com.google.cloud.modelarmor.v1.FilterVersionAlias result = + com.google.cloud.modelarmor.v1.FilterVersionAlias.forNumber( + (java.lang.Integer) versionSpec_); + return result == null + ? com.google.cloud.modelarmor.v1.FilterVersionAlias.UNRECOGNIZED + : result; + } + return com.google.cloud.modelarmor.v1.FilterVersionAlias.FILTER_VERSION_ALIAS_UNSPECIFIED; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @param value The alias to set. + * @return This builder for chaining. + */ + public Builder setAlias(com.google.cloud.modelarmor.v1.FilterVersionAlias value) { + if (value == null) { + throw new NullPointerException(); + } + versionSpecCase_ = 2; + versionSpec_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
    +     * Allows customers to use a predefined alias that dynamically
    +     * points to a specific version based on internal upgrades.
    +     * This offers flexibility and reduces the need for template updates.
    +     * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return This builder for chaining. + */ + public Builder clearAlias() { + if (versionSpecCase_ == 2) { + versionSpecCase_ = 0; + versionSpec_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.FilterVersionSelector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.modelarmor.v1.FilterVersionSelector) + private static final com.google.cloud.modelarmor.v1.FilterVersionSelector DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.modelarmor.v1.FilterVersionSelector(); + } + + public static com.google.cloud.modelarmor.v1.FilterVersionSelector getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilterVersionSelector parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelector getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelectorOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelectorOrBuilder.java new file mode 100644 index 000000000000..266f52925bf5 --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FilterVersionSelectorOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +@com.google.protobuf.Generated +public interface FilterVersionSelectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.modelarmor.v1.FilterVersionSelector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return Whether the version field is set. + */ + boolean hasVersion(); + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return The version. + */ + java.lang.String getVersion(); + + /** + * + * + *
    +   * Allows customers to pin to a specific, immutable Filter Version.
    +   * This provides stability, as this will not change after a version upgrade.
    +   * Expected format is a case-sensitive string, e.g., "v1", "v2".
    +   * Requests providing an invalid or non-existent version string will be
    +   * rejected with an `INVALID_ARGUMENT` error.
    +   * 
    + * + * string version = 1; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return Whether the alias field is set. + */ + boolean hasAlias(); + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The enum numeric value on the wire for alias. + */ + int getAliasValue(); + + /** + * + * + *
    +   * Allows customers to use a predefined alias that dynamically
    +   * points to a specific version based on internal upgrades.
    +   * This offers flexibility and reduces the need for template updates.
    +   * 
    + * + * .google.cloud.modelarmor.v1.FilterVersionAlias alias = 2; + * + * @return The alias. + */ + com.google.cloud.modelarmor.v1.FilterVersionAlias getAlias(); + + com.google.cloud.modelarmor.v1.FilterVersionSelector.VersionSpecCase getVersionSpecCase(); +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSetting.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSetting.java index 638b30a5ece5..79a2c9a929a4 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSetting.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSetting.java @@ -101,6 +101,16 @@ public enum IntegratedService implements com.google.protobuf.ProtocolMessageEnum * AI_PLATFORM = 1; */ AI_PLATFORM(1), + /** + * + * + *
    +     * Google MCP Server (via Shim Service Extension)
    +     * 
    + * + * GOOGLE_MCP_SERVER = 2; + */ + GOOGLE_MCP_SERVER(2), UNRECOGNIZED(-1), ; @@ -136,6 +146,17 @@ public enum IntegratedService implements com.google.protobuf.ProtocolMessageEnum */ public static final int AI_PLATFORM_VALUE = 1; + /** + * + * + *
    +     * Google MCP Server (via Shim Service Extension)
    +     * 
    + * + * GOOGLE_MCP_SERVER = 2; + */ + public static final int GOOGLE_MCP_SERVER_VALUE = 2; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( @@ -164,6 +185,8 @@ public static IntegratedService forNumber(int value) { return INTEGRATED_SERVICE_UNSPECIFIED; case 1: return AI_PLATFORM; + case 2: + return GOOGLE_MCP_SERVER; default: return null; } @@ -2099,6 +2122,66 @@ public boolean hasFloorSettingMetadata() { : floorSettingMetadata_; } + public static final int GOOGLE_MCP_SERVER_FLOOR_SETTING_FIELD_NUMBER = 9; + private com.google.cloud.modelarmor.v1.McpServerFloorSetting googleMcpServerFloorSetting_; + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the googleMcpServerFloorSetting field is set. + */ + @java.lang.Override + public boolean hasGoogleMcpServerFloorSetting() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The googleMcpServerFloorSetting. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSetting getGoogleMcpServerFloorSetting() { + return googleMcpServerFloorSetting_ == null + ? com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance() + : googleMcpServerFloorSetting_; + } + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder + getGoogleMcpServerFloorSettingOrBuilder() { + return googleMcpServerFloorSetting_ == null + ? com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance() + : googleMcpServerFloorSetting_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2142,6 +2225,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000020) != 0)) { output.writeMessage(8, getFloorSettingMetadata()); } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(9, getGoogleMcpServerFloorSetting()); + } getUnknownFields().writeTo(output); } @@ -2189,6 +2275,11 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getFloorSettingMetadata()); } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, getGoogleMcpServerFloorSetting()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2233,6 +2324,11 @@ public boolean equals(final java.lang.Object obj) { if (hasFloorSettingMetadata()) { if (!getFloorSettingMetadata().equals(other.getFloorSettingMetadata())) return false; } + if (hasGoogleMcpServerFloorSetting() != other.hasGoogleMcpServerFloorSetting()) return false; + if (hasGoogleMcpServerFloorSetting()) { + if (!getGoogleMcpServerFloorSetting().equals(other.getGoogleMcpServerFloorSetting())) + return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2276,6 +2372,10 @@ public int hashCode() { hash = (37 * hash) + FLOOR_SETTING_METADATA_FIELD_NUMBER; hash = (53 * hash) + getFloorSettingMetadata().hashCode(); } + if (hasGoogleMcpServerFloorSetting()) { + hash = (37 * hash) + GOOGLE_MCP_SERVER_FLOOR_SETTING_FIELD_NUMBER; + hash = (53 * hash) + getGoogleMcpServerFloorSetting().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2422,6 +2522,7 @@ private void maybeForceBuilderInitialization() { internalGetFilterConfigFieldBuilder(); internalGetAiPlatformFloorSettingFieldBuilder(); internalGetFloorSettingMetadataFieldBuilder(); + internalGetGoogleMcpServerFloorSettingFieldBuilder(); } } @@ -2457,6 +2558,11 @@ public Builder clear() { floorSettingMetadataBuilder_.dispose(); floorSettingMetadataBuilder_ = null; } + googleMcpServerFloorSetting_ = null; + if (googleMcpServerFloorSettingBuilder_ != null) { + googleMcpServerFloorSettingBuilder_.dispose(); + googleMcpServerFloorSettingBuilder_ = null; + } return this; } @@ -2532,6 +2638,13 @@ private void buildPartial0(com.google.cloud.modelarmor.v1.FloorSetting result) { : floorSettingMetadataBuilder_.build(); to_bitField0_ |= 0x00000020; } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.googleMcpServerFloorSetting_ = + googleMcpServerFloorSettingBuilder_ == null + ? googleMcpServerFloorSetting_ + : googleMcpServerFloorSettingBuilder_.build(); + to_bitField0_ |= 0x00000040; + } result.bitField0_ |= to_bitField0_; } @@ -2581,6 +2694,9 @@ public Builder mergeFrom(com.google.cloud.modelarmor.v1.FloorSetting other) { if (other.hasFloorSettingMetadata()) { mergeFloorSettingMetadata(other.getFloorSettingMetadata()); } + if (other.hasGoogleMcpServerFloorSetting()) { + mergeGoogleMcpServerFloorSetting(other.getGoogleMcpServerFloorSetting()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2673,6 +2789,14 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 66 + case 74: + { + input.readMessage( + internalGetGoogleMcpServerFloorSettingFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4233,6 +4357,224 @@ public Builder clearFloorSettingMetadata() { return floorSettingMetadataBuilder_; } + private com.google.cloud.modelarmor.v1.McpServerFloorSetting googleMcpServerFloorSetting_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.McpServerFloorSetting, + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder, + com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder> + googleMcpServerFloorSettingBuilder_; + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the googleMcpServerFloorSetting field is set. + */ + public boolean hasGoogleMcpServerFloorSetting() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The googleMcpServerFloorSetting. + */ + public com.google.cloud.modelarmor.v1.McpServerFloorSetting getGoogleMcpServerFloorSetting() { + if (googleMcpServerFloorSettingBuilder_ == null) { + return googleMcpServerFloorSetting_ == null + ? com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance() + : googleMcpServerFloorSetting_; + } else { + return googleMcpServerFloorSettingBuilder_.getMessage(); + } + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGoogleMcpServerFloorSetting( + com.google.cloud.modelarmor.v1.McpServerFloorSetting value) { + if (googleMcpServerFloorSettingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + googleMcpServerFloorSetting_ = value; + } else { + googleMcpServerFloorSettingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGoogleMcpServerFloorSetting( + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder builderForValue) { + if (googleMcpServerFloorSettingBuilder_ == null) { + googleMcpServerFloorSetting_ = builderForValue.build(); + } else { + googleMcpServerFloorSettingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGoogleMcpServerFloorSetting( + com.google.cloud.modelarmor.v1.McpServerFloorSetting value) { + if (googleMcpServerFloorSettingBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && googleMcpServerFloorSetting_ != null + && googleMcpServerFloorSetting_ + != com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance()) { + getGoogleMcpServerFloorSettingBuilder().mergeFrom(value); + } else { + googleMcpServerFloorSetting_ = value; + } + } else { + googleMcpServerFloorSettingBuilder_.mergeFrom(value); + } + if (googleMcpServerFloorSetting_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGoogleMcpServerFloorSetting() { + bitField0_ = (bitField0_ & ~0x00000100); + googleMcpServerFloorSetting_ = null; + if (googleMcpServerFloorSettingBuilder_ != null) { + googleMcpServerFloorSettingBuilder_.dispose(); + googleMcpServerFloorSettingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder + getGoogleMcpServerFloorSettingBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetGoogleMcpServerFloorSettingFieldBuilder().getBuilder(); + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder + getGoogleMcpServerFloorSettingOrBuilder() { + if (googleMcpServerFloorSettingBuilder_ != null) { + return googleMcpServerFloorSettingBuilder_.getMessageOrBuilder(); + } else { + return googleMcpServerFloorSetting_ == null + ? com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance() + : googleMcpServerFloorSetting_; + } + } + + /** + * + * + *
    +     * Optional. Google MCP Server floor setting.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.McpServerFloorSetting, + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder, + com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder> + internalGetGoogleMcpServerFloorSettingFieldBuilder() { + if (googleMcpServerFloorSettingBuilder_ == null) { + googleMcpServerFloorSettingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.McpServerFloorSetting, + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder, + com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder>( + getGoogleMcpServerFloorSetting(), getParentForChildren(), isClean()); + googleMcpServerFloorSetting_ = null; + } + return googleMcpServerFloorSettingBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.FloorSetting) } diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSettingOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSettingOrBuilder.java index 0f37ae7da6d0..539589f47964 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSettingOrBuilder.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/FloorSettingOrBuilder.java @@ -375,4 +375,48 @@ public interface FloorSettingOrBuilder */ com.google.cloud.modelarmor.v1.FloorSetting.FloorSettingMetadataOrBuilder getFloorSettingMetadataOrBuilder(); + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the googleMcpServerFloorSetting field is set. + */ + boolean hasGoogleMcpServerFloorSetting(); + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The googleMcpServerFloorSetting. + */ + com.google.cloud.modelarmor.v1.McpServerFloorSetting getGoogleMcpServerFloorSetting(); + + /** + * + * + *
    +   * Optional. Google MCP Server floor setting.
    +   * 
    + * + * + * optional .google.cloud.modelarmor.v1.McpServerFloorSetting google_mcp_server_floor_setting = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder + getGoogleMcpServerFloorSettingOrBuilder(); } diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSetting.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSetting.java new file mode 100644 index 000000000000..0e1e7bebe190 --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSetting.java @@ -0,0 +1,874 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +/** + * + * + *
    + * Message describing MCP Server Floor Setting.
    + * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.McpServerFloorSetting} + */ +@com.google.protobuf.Generated +public final class McpServerFloorSetting extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.modelarmor.v1.McpServerFloorSetting) + McpServerFloorSettingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "McpServerFloorSetting"); + } + + // Use McpServerFloorSetting.newBuilder() to construct. + private McpServerFloorSetting(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private McpServerFloorSetting() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.McpServerFloorSetting.class, + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder.class); + } + + private int enforcementTypeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object enforcementType_; + + public enum EnforcementTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INSPECT_ONLY(1), + INSPECT_AND_BLOCK(2), + ENFORCEMENTTYPE_NOT_SET(0); + private final int value; + + private EnforcementTypeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EnforcementTypeCase valueOf(int value) { + return forNumber(value); + } + + public static EnforcementTypeCase forNumber(int value) { + switch (value) { + case 1: + return INSPECT_ONLY; + case 2: + return INSPECT_AND_BLOCK; + case 0: + return ENFORCEMENTTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EnforcementTypeCase getEnforcementTypeCase() { + return EnforcementTypeCase.forNumber(enforcementTypeCase_); + } + + public static final int INSPECT_ONLY_FIELD_NUMBER = 1; + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect only mode.
    +   * No action will be taken on the request.
    +   * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectOnly field is set. + */ + @java.lang.Override + public boolean hasInspectOnly() { + return enforcementTypeCase_ == 1; + } + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect only mode.
    +   * No action will be taken on the request.
    +   * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectOnly. + */ + @java.lang.Override + public boolean getInspectOnly() { + if (enforcementTypeCase_ == 1) { + return (java.lang.Boolean) enforcementType_; + } + return false; + } + + public static final int INSPECT_AND_BLOCK_FIELD_NUMBER = 2; + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect and block
    +   * mode. Requests that trip Model Armor filters will be blocked.
    +   * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectAndBlock field is set. + */ + @java.lang.Override + public boolean hasInspectAndBlock() { + return enforcementTypeCase_ == 2; + } + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect and block
    +   * mode. Requests that trip Model Armor filters will be blocked.
    +   * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectAndBlock. + */ + @java.lang.Override + public boolean getInspectAndBlock() { + if (enforcementTypeCase_ == 2) { + return (java.lang.Boolean) enforcementType_; + } + return false; + } + + public static final int ENABLE_CLOUD_LOGGING_FIELD_NUMBER = 3; + private boolean enableCloudLogging_ = false; + + /** + * + * + *
    +   * Optional. If true, log Model Armor filter results to Cloud Logging.
    +   * 
    + * + * bool enable_cloud_logging = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enableCloudLogging. + */ + @java.lang.Override + public boolean getEnableCloudLogging() { + return enableCloudLogging_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (enforcementTypeCase_ == 1) { + output.writeBool(1, (boolean) ((java.lang.Boolean) enforcementType_)); + } + if (enforcementTypeCase_ == 2) { + output.writeBool(2, (boolean) ((java.lang.Boolean) enforcementType_)); + } + if (enableCloudLogging_ != false) { + output.writeBool(3, enableCloudLogging_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enforcementTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 1, (boolean) ((java.lang.Boolean) enforcementType_)); + } + if (enforcementTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 2, (boolean) ((java.lang.Boolean) enforcementType_)); + } + if (enableCloudLogging_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enableCloudLogging_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.modelarmor.v1.McpServerFloorSetting)) { + return super.equals(obj); + } + com.google.cloud.modelarmor.v1.McpServerFloorSetting other = + (com.google.cloud.modelarmor.v1.McpServerFloorSetting) obj; + + if (getEnableCloudLogging() != other.getEnableCloudLogging()) return false; + if (!getEnforcementTypeCase().equals(other.getEnforcementTypeCase())) return false; + switch (enforcementTypeCase_) { + case 1: + if (getInspectOnly() != other.getInspectOnly()) return false; + break; + case 2: + if (getInspectAndBlock() != other.getInspectAndBlock()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_CLOUD_LOGGING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableCloudLogging()); + switch (enforcementTypeCase_) { + case 1: + hash = (37 * hash) + INSPECT_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInspectOnly()); + break; + case 2: + hash = (37 * hash) + INSPECT_AND_BLOCK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInspectAndBlock()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.modelarmor.v1.McpServerFloorSetting prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
    +   * Message describing MCP Server Floor Setting.
    +   * 
    + * + * Protobuf type {@code google.cloud.modelarmor.v1.McpServerFloorSetting} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.modelarmor.v1.McpServerFloorSetting) + com.google.cloud.modelarmor.v1.McpServerFloorSettingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.modelarmor.v1.McpServerFloorSetting.class, + com.google.cloud.modelarmor.v1.McpServerFloorSetting.Builder.class); + } + + // Construct using com.google.cloud.modelarmor.v1.McpServerFloorSetting.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enableCloudLogging_ = false; + enforcementTypeCase_ = 0; + enforcementType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.modelarmor.v1.V1mainProto + .internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSetting getDefaultInstanceForType() { + return com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSetting build() { + com.google.cloud.modelarmor.v1.McpServerFloorSetting result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSetting buildPartial() { + com.google.cloud.modelarmor.v1.McpServerFloorSetting result = + new com.google.cloud.modelarmor.v1.McpServerFloorSetting(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.modelarmor.v1.McpServerFloorSetting result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableCloudLogging_ = enableCloudLogging_; + } + } + + private void buildPartialOneofs(com.google.cloud.modelarmor.v1.McpServerFloorSetting result) { + result.enforcementTypeCase_ = enforcementTypeCase_; + result.enforcementType_ = this.enforcementType_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.modelarmor.v1.McpServerFloorSetting) { + return mergeFrom((com.google.cloud.modelarmor.v1.McpServerFloorSetting) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.modelarmor.v1.McpServerFloorSetting other) { + if (other == com.google.cloud.modelarmor.v1.McpServerFloorSetting.getDefaultInstance()) + return this; + if (other.getEnableCloudLogging() != false) { + setEnableCloudLogging(other.getEnableCloudLogging()); + } + switch (other.getEnforcementTypeCase()) { + case INSPECT_ONLY: + { + setInspectOnly(other.getInspectOnly()); + break; + } + case INSPECT_AND_BLOCK: + { + setInspectAndBlock(other.getInspectAndBlock()); + break; + } + case ENFORCEMENTTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enforcementType_ = input.readBool(); + enforcementTypeCase_ = 1; + break; + } // case 8 + case 16: + { + enforcementType_ = input.readBool(); + enforcementTypeCase_ = 2; + break; + } // case 16 + case 24: + { + enableCloudLogging_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int enforcementTypeCase_ = 0; + private java.lang.Object enforcementType_; + + public EnforcementTypeCase getEnforcementTypeCase() { + return EnforcementTypeCase.forNumber(enforcementTypeCase_); + } + + public Builder clearEnforcementType() { + enforcementTypeCase_ = 0; + enforcementType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect only mode.
    +     * No action will be taken on the request.
    +     * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectOnly field is set. + */ + public boolean hasInspectOnly() { + return enforcementTypeCase_ == 1; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect only mode.
    +     * No action will be taken on the request.
    +     * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectOnly. + */ + public boolean getInspectOnly() { + if (enforcementTypeCase_ == 1) { + return (java.lang.Boolean) enforcementType_; + } + return false; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect only mode.
    +     * No action will be taken on the request.
    +     * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The inspectOnly to set. + * @return This builder for chaining. + */ + public Builder setInspectOnly(boolean value) { + + enforcementTypeCase_ = 1; + enforcementType_ = value; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect only mode.
    +     * No action will be taken on the request.
    +     * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearInspectOnly() { + if (enforcementTypeCase_ == 1) { + enforcementTypeCase_ = 0; + enforcementType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect and block
    +     * mode. Requests that trip Model Armor filters will be blocked.
    +     * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectAndBlock field is set. + */ + public boolean hasInspectAndBlock() { + return enforcementTypeCase_ == 2; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect and block
    +     * mode. Requests that trip Model Armor filters will be blocked.
    +     * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectAndBlock. + */ + public boolean getInspectAndBlock() { + if (enforcementTypeCase_ == 2) { + return (java.lang.Boolean) enforcementType_; + } + return false; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect and block
    +     * mode. Requests that trip Model Armor filters will be blocked.
    +     * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The inspectAndBlock to set. + * @return This builder for chaining. + */ + public Builder setInspectAndBlock(boolean value) { + + enforcementTypeCase_ = 2; + enforcementType_ = value; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. If true, Model Armor filters will be run in inspect and block
    +     * mode. Requests that trip Model Armor filters will be blocked.
    +     * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearInspectAndBlock() { + if (enforcementTypeCase_ == 2) { + enforcementTypeCase_ = 0; + enforcementType_ = null; + onChanged(); + } + return this; + } + + private boolean enableCloudLogging_; + + /** + * + * + *
    +     * Optional. If true, log Model Armor filter results to Cloud Logging.
    +     * 
    + * + * bool enable_cloud_logging = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enableCloudLogging. + */ + @java.lang.Override + public boolean getEnableCloudLogging() { + return enableCloudLogging_; + } + + /** + * + * + *
    +     * Optional. If true, log Model Armor filter results to Cloud Logging.
    +     * 
    + * + * bool enable_cloud_logging = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enableCloudLogging to set. + * @return This builder for chaining. + */ + public Builder setEnableCloudLogging(boolean value) { + + enableCloudLogging_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
    +     * Optional. If true, log Model Armor filter results to Cloud Logging.
    +     * 
    + * + * bool enable_cloud_logging = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnableCloudLogging() { + bitField0_ = (bitField0_ & ~0x00000004); + enableCloudLogging_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.McpServerFloorSetting) + } + + // @@protoc_insertion_point(class_scope:google.cloud.modelarmor.v1.McpServerFloorSetting) + private static final com.google.cloud.modelarmor.v1.McpServerFloorSetting DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.modelarmor.v1.McpServerFloorSetting(); + } + + public static com.google.cloud.modelarmor.v1.McpServerFloorSetting getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public McpServerFloorSetting parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.modelarmor.v1.McpServerFloorSetting getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSettingOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSettingOrBuilder.java new file mode 100644 index 000000000000..5c7e4efca293 --- /dev/null +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/McpServerFloorSettingOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/modelarmor/v1/service.proto +// Protobuf Java Version: 4.33.6 + +package com.google.cloud.modelarmor.v1; + +@com.google.protobuf.Generated +public interface McpServerFloorSettingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.modelarmor.v1.McpServerFloorSetting) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect only mode.
    +   * No action will be taken on the request.
    +   * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectOnly field is set. + */ + boolean hasInspectOnly(); + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect only mode.
    +   * No action will be taken on the request.
    +   * 
    + * + * bool inspect_only = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectOnly. + */ + boolean getInspectOnly(); + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect and block
    +   * mode. Requests that trip Model Armor filters will be blocked.
    +   * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the inspectAndBlock field is set. + */ + boolean hasInspectAndBlock(); + + /** + * + * + *
    +   * Optional. If true, Model Armor filters will be run in inspect and block
    +   * mode. Requests that trip Model Armor filters will be blocked.
    +   * 
    + * + * bool inspect_and_block = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The inspectAndBlock. + */ + boolean getInspectAndBlock(); + + /** + * + * + *
    +   * Optional. If true, log Model Armor filter results to Cloud Logging.
    +   * 
    + * + * bool enable_cloud_logging = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enableCloudLogging. + */ + boolean getEnableCloudLogging(); + + com.google.cloud.modelarmor.v1.McpServerFloorSetting.EnforcementTypeCase getEnforcementTypeCase(); +} diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadata.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadata.java index 891dac384139..395492317c11 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadata.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadata.java @@ -81,8 +81,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
        * Optional. Optional Source language of the user prompt.
        *
    -   * If multi-language detection is enabled but language is not set in that case
    -   * we would automatically detect the source language.
    +   * If multi-language detection is enabled and this field is not set, the
    +   * source language will be automatically detected. When a source language is
    +   * provided, Model Armor uses it to sanitize the input. In that case the
    +   * system does not perform auto-detection and relies solely on the specified
    +   * language.
    +   *
    +   * This string field accepts a language code from the ISO-639 standard.
    +   * For a list of languages supported by Model Armor, see
    +   * [Model Armor supported languages]
    +   * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +   * For a comprehensive list of language codes, see
    +   * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
        * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -108,8 +118,18 @@ public java.lang.String getSourceLanguage() { *
        * Optional. Optional Source language of the user prompt.
        *
    -   * If multi-language detection is enabled but language is not set in that case
    -   * we would automatically detect the source language.
    +   * If multi-language detection is enabled and this field is not set, the
    +   * source language will be automatically detected. When a source language is
    +   * provided, Model Armor uses it to sanitize the input. In that case the
    +   * system does not perform auto-detection and relies solely on the specified
    +   * language.
    +   *
    +   * This string field accepts a language code from the ISO-639 standard.
    +   * For a list of languages supported by Model Armor, see
    +   * [Model Armor supported languages]
    +   * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +   * For a comprehensive list of language codes, see
    +   * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
        * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -495,8 +515,18 @@ public Builder mergeFrom( *
          * Optional. Optional Source language of the user prompt.
          *
    -     * If multi-language detection is enabled but language is not set in that case
    -     * we would automatically detect the source language.
    +     * If multi-language detection is enabled and this field is not set, the
    +     * source language will be automatically detected. When a source language is
    +     * provided, Model Armor uses it to sanitize the input. In that case the
    +     * system does not perform auto-detection and relies solely on the specified
    +     * language.
    +     *
    +     * This string field accepts a language code from the ISO-639 standard.
    +     * For a list of languages supported by Model Armor, see
    +     * [Model Armor supported languages]
    +     * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +     * For a comprehensive list of language codes, see
    +     * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
          * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -521,8 +551,18 @@ public java.lang.String getSourceLanguage() { *
          * Optional. Optional Source language of the user prompt.
          *
    -     * If multi-language detection is enabled but language is not set in that case
    -     * we would automatically detect the source language.
    +     * If multi-language detection is enabled and this field is not set, the
    +     * source language will be automatically detected. When a source language is
    +     * provided, Model Armor uses it to sanitize the input. In that case the
    +     * system does not perform auto-detection and relies solely on the specified
    +     * language.
    +     *
    +     * This string field accepts a language code from the ISO-639 standard.
    +     * For a list of languages supported by Model Armor, see
    +     * [Model Armor supported languages]
    +     * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +     * For a comprehensive list of language codes, see
    +     * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
          * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -547,8 +587,18 @@ public com.google.protobuf.ByteString getSourceLanguageBytes() { *
          * Optional. Optional Source language of the user prompt.
          *
    -     * If multi-language detection is enabled but language is not set in that case
    -     * we would automatically detect the source language.
    +     * If multi-language detection is enabled and this field is not set, the
    +     * source language will be automatically detected. When a source language is
    +     * provided, Model Armor uses it to sanitize the input. In that case the
    +     * system does not perform auto-detection and relies solely on the specified
    +     * language.
    +     *
    +     * This string field accepts a language code from the ISO-639 standard.
    +     * For a list of languages supported by Model Armor, see
    +     * [Model Armor supported languages]
    +     * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +     * For a comprehensive list of language codes, see
    +     * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
          * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -572,8 +622,18 @@ public Builder setSourceLanguage(java.lang.String value) { *
          * Optional. Optional Source language of the user prompt.
          *
    -     * If multi-language detection is enabled but language is not set in that case
    -     * we would automatically detect the source language.
    +     * If multi-language detection is enabled and this field is not set, the
    +     * source language will be automatically detected. When a source language is
    +     * provided, Model Armor uses it to sanitize the input. In that case the
    +     * system does not perform auto-detection and relies solely on the specified
    +     * language.
    +     *
    +     * This string field accepts a language code from the ISO-639 standard.
    +     * For a list of languages supported by Model Armor, see
    +     * [Model Armor supported languages]
    +     * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +     * For a comprehensive list of language codes, see
    +     * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
          * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -593,8 +653,18 @@ public Builder clearSourceLanguage() { *
          * Optional. Optional Source language of the user prompt.
          *
    -     * If multi-language detection is enabled but language is not set in that case
    -     * we would automatically detect the source language.
    +     * If multi-language detection is enabled and this field is not set, the
    +     * source language will be automatically detected. When a source language is
    +     * provided, Model Armor uses it to sanitize the input. In that case the
    +     * system does not perform auto-detection and relies solely on the specified
    +     * language.
    +     *
    +     * This string field accepts a language code from the ISO-639 standard.
    +     * For a list of languages supported by Model Armor, see
    +     * [Model Armor supported languages]
    +     * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +     * For a comprehensive list of language codes, see
    +     * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
          * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadataOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadataOrBuilder.java index 3707b3a6f521..03ad3382a334 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadataOrBuilder.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/MultiLanguageDetectionMetadataOrBuilder.java @@ -32,8 +32,18 @@ public interface MultiLanguageDetectionMetadataOrBuilder *
        * Optional. Optional Source language of the user prompt.
        *
    -   * If multi-language detection is enabled but language is not set in that case
    -   * we would automatically detect the source language.
    +   * If multi-language detection is enabled and this field is not set, the
    +   * source language will be automatically detected. When a source language is
    +   * provided, Model Armor uses it to sanitize the input. In that case the
    +   * system does not perform auto-detection and relies solely on the specified
    +   * language.
    +   *
    +   * This string field accepts a language code from the ISO-639 standard.
    +   * For a list of languages supported by Model Armor, see
    +   * [Model Armor supported languages]
    +   * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +   * For a comprehensive list of language codes, see
    +   * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
        * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -48,8 +58,18 @@ public interface MultiLanguageDetectionMetadataOrBuilder *
        * Optional. Optional Source language of the user prompt.
        *
    -   * If multi-language detection is enabled but language is not set in that case
    -   * we would automatically detect the source language.
    +   * If multi-language detection is enabled and this field is not set, the
    +   * source language will be automatically detected. When a source language is
    +   * provided, Model Armor uses it to sanitize the input. In that case the
    +   * system does not perform auto-detection and relies solely on the specified
    +   * language.
    +   *
    +   * This string field accepts a language code from the ISO-639 standard.
    +   * For a list of languages supported by Model Armor, see
    +   * [Model Armor supported languages]
    +   * (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported).
    +   * For a comprehensive list of language codes, see
    +   * [ISO-639](https://cloud.google.com/translate/docs/languages#nmt).
        * 
    * * string source_language = 1 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResult.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResult.java index e985c4274ceb..db7e6b68a457 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResult.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResult.java @@ -183,6 +183,52 @@ public interface SanitizationMetadataOrBuilder * */ com.google.cloud.modelarmor.v1.DataItemOrBuilder getStreamChunkProcessedOrBuilder(); + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionConfig field is set. + */ + boolean hasFilterVersionConfig(); + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionConfig. + */ + com.google.cloud.modelarmor.v1.FilterVersionConfig getFilterVersionConfig(); + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder getFilterVersionConfigOrBuilder(); } /** @@ -386,6 +432,69 @@ public com.google.cloud.modelarmor.v1.DataItemOrBuilder getStreamChunkProcessedO : streamChunkProcessed_; } + public static final int FILTER_VERSION_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.modelarmor.v1.FilterVersionConfig filterVersionConfig_; + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionConfig field is set. + */ + @java.lang.Override + public boolean hasFilterVersionConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionConfig. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfig getFilterVersionConfig() { + return filterVersionConfig_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance() + : filterVersionConfig_; + } + + /** + * + * + *
    +     * Output only. Provides details about the Filter Version configuration used
    +     * to sanitize this request.
    +     * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder + getFilterVersionConfigOrBuilder() { + return filterVersionConfig_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance() + : filterVersionConfig_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -412,6 +521,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getStreamChunkProcessed()); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getFilterVersionConfig()); + } getUnknownFields().writeTo(output); } @@ -436,6 +548,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStreamChunkProcessed()); } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFilterVersionConfig()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -461,6 +577,10 @@ public boolean equals(final java.lang.Object obj) { if (hasStreamChunkProcessed()) { if (!getStreamChunkProcessed().equals(other.getStreamChunkProcessed())) return false; } + if (hasFilterVersionConfig() != other.hasFilterVersionConfig()) return false; + if (hasFilterVersionConfig()) { + if (!getFilterVersionConfig().equals(other.getFilterVersionConfig())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -484,6 +604,10 @@ public int hashCode() { hash = (37 * hash) + STREAM_CHUNK_PROCESSED_FIELD_NUMBER; hash = (53 * hash) + getStreamChunkProcessed().hashCode(); } + if (hasFilterVersionConfig()) { + hash = (37 * hash) + FILTER_VERSION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getFilterVersionConfig().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -630,6 +754,7 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { internalGetStreamChunkProcessedFieldBuilder(); + internalGetFilterVersionConfigFieldBuilder(); } } @@ -645,6 +770,11 @@ public Builder clear() { streamChunkProcessedBuilder_.dispose(); streamChunkProcessedBuilder_ = null; } + filterVersionConfig_ = null; + if (filterVersionConfigBuilder_ != null) { + filterVersionConfigBuilder_.dispose(); + filterVersionConfigBuilder_ = null; + } return this; } @@ -702,6 +832,13 @@ private void buildPartial0( : streamChunkProcessedBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.filterVersionConfig_ = + filterVersionConfigBuilder_ == null + ? filterVersionConfig_ + : filterVersionConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } result.bitField0_ |= to_bitField0_; } @@ -736,6 +873,9 @@ public Builder mergeFrom( if (other.hasStreamChunkProcessed()) { mergeStreamChunkProcessed(other.getStreamChunkProcessed()); } + if (other.hasFilterVersionConfig()) { + mergeFilterVersionConfig(other.getFilterVersionConfig()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -788,6 +928,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 50: + { + input.readMessage( + internalGetFilterVersionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1247,6 +1394,233 @@ public com.google.cloud.modelarmor.v1.DataItemOrBuilder getStreamChunkProcessedO return streamChunkProcessedBuilder_; } + private com.google.cloud.modelarmor.v1.FilterVersionConfig filterVersionConfig_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionConfig, + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder, + com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder> + filterVersionConfigBuilder_; + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the filterVersionConfig field is set. + */ + public boolean hasFilterVersionConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The filterVersionConfig. + */ + public com.google.cloud.modelarmor.v1.FilterVersionConfig getFilterVersionConfig() { + if (filterVersionConfigBuilder_ == null) { + return filterVersionConfig_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance() + : filterVersionConfig_; + } else { + return filterVersionConfigBuilder_.getMessage(); + } + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFilterVersionConfig( + com.google.cloud.modelarmor.v1.FilterVersionConfig value) { + if (filterVersionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filterVersionConfig_ = value; + } else { + filterVersionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFilterVersionConfig( + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder builderForValue) { + if (filterVersionConfigBuilder_ == null) { + filterVersionConfig_ = builderForValue.build(); + } else { + filterVersionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeFilterVersionConfig( + com.google.cloud.modelarmor.v1.FilterVersionConfig value) { + if (filterVersionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && filterVersionConfig_ != null + && filterVersionConfig_ + != com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance()) { + getFilterVersionConfigBuilder().mergeFrom(value); + } else { + filterVersionConfig_ = value; + } + } else { + filterVersionConfigBuilder_.mergeFrom(value); + } + if (filterVersionConfig_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFilterVersionConfig() { + bitField0_ = (bitField0_ & ~0x00000010); + filterVersionConfig_ = null; + if (filterVersionConfigBuilder_ != null) { + filterVersionConfigBuilder_.dispose(); + filterVersionConfigBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder + getFilterVersionConfigBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetFilterVersionConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder + getFilterVersionConfigOrBuilder() { + if (filterVersionConfigBuilder_ != null) { + return filterVersionConfigBuilder_.getMessageOrBuilder(); + } else { + return filterVersionConfig_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionConfig.getDefaultInstance() + : filterVersionConfig_; + } + } + + /** + * + * + *
    +       * Output only. Provides details about the Filter Version configuration used
    +       * to sanitize this request.
    +       * 
    + * + * + * .google.cloud.modelarmor.v1.FilterVersionConfig filter_version_config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionConfig, + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder, + com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder> + internalGetFilterVersionConfigFieldBuilder() { + if (filterVersionConfigBuilder_ == null) { + filterVersionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionConfig, + com.google.cloud.modelarmor.v1.FilterVersionConfig.Builder, + com.google.cloud.modelarmor.v1.FilterVersionConfigOrBuilder>( + getFilterVersionConfig(), getParentForChildren(), isClean()); + filterVersionConfig_ = null; + } + return filterVersionConfigBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.SanitizationResult.SanitizationMetadata) } @@ -1399,7 +1773,7 @@ public int getFilterResultsCount() { * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -1427,7 +1801,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -1445,7 +1819,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -1470,7 +1844,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -2256,7 +2630,7 @@ public int getFilterResultsCount() { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2284,7 +2658,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2302,7 +2676,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2327,7 +2701,7 @@ public boolean containsFilterResults(java.lang.String key) { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2359,7 +2733,7 @@ public Builder clearFilterResults() { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2387,7 +2761,7 @@ public Builder removeFilterResults(java.lang.String key) { * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2412,7 +2786,7 @@ public Builder putFilterResults( * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * @@ -2437,7 +2811,7 @@ public Builder putAllFilterResults( * *
          * Output only. Results for all filters where the key is the filter name -
    -     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +     * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
          * 
    * * diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResultOrBuilder.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResultOrBuilder.java index c76a2a5f8561..4b3f184e54f4 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResultOrBuilder.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/SanitizationResultOrBuilder.java @@ -75,7 +75,7 @@ public interface SanitizationResultOrBuilder * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -89,7 +89,7 @@ public interface SanitizationResultOrBuilder * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -107,7 +107,7 @@ public interface SanitizationResultOrBuilder * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -122,7 +122,7 @@ public interface SanitizationResultOrBuilder * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * @@ -140,7 +140,7 @@ com.google.cloud.modelarmor.v1.FilterResult getFilterResultsOrDefault( * *
        * Output only. Results for all filters where the key is the filter name -
    -   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
    +   * either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp".
        * 
    * * diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/Template.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/Template.java index d451ea31bacd..a65928f1334a 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/Template.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/Template.java @@ -298,6 +298,59 @@ public interface TemplateMetadataOrBuilder com.google.cloud.modelarmor.v1.Template.TemplateMetadata.MultiLanguageDetectionOrBuilder getMultiLanguageDetectionOrBuilder(); + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filterVersionSelector field is set. + */ + boolean hasFilterVersionSelector(); + + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filterVersionSelector. + */ + com.google.cloud.modelarmor.v1.FilterVersionSelector getFilterVersionSelector(); + + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder + getFilterVersionSelectorOrBuilder(); + /** * * @@ -379,6 +432,40 @@ public interface TemplateMetadataOrBuilder * @return The enum numeric value on the wire of modalities at the given index. */ int getModalitiesValue(int index); + + /** + * + * + *
    +     * Optional. Indicates whether the template is subject to data residency
    +     * compliance. If true (default for new templates), the template is subject
    +     * to data residency compliance. If false, the template bypasses data
    +     * residency compliance checks.
    +     * 
    + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataResidencyCompliant field is set. + */ + boolean hasDataResidencyCompliant(); + + /** + * + * + *
    +     * Optional. Indicates whether the template is subject to data residency
    +     * compliance. If true (default for new templates), the template is subject
    +     * to data residency compliance. If false, the template bypasses data
    +     * residency compliance checks.
    +     * 
    + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataResidencyCompliant. + */ + boolean getDataResidencyCompliant(); } /** @@ -1492,6 +1579,75 @@ public boolean hasMultiLanguageDetection() { : multiLanguageDetection_; } + public static final int FILTER_VERSION_SELECTOR_FIELD_NUMBER = 10; + private com.google.cloud.modelarmor.v1.FilterVersionSelector filterVersionSelector_; + + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filterVersionSelector field is set. + */ + @java.lang.Override + public boolean hasFilterVersionSelector() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filterVersionSelector. + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelector getFilterVersionSelector() { + return filterVersionSelector_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance() + : filterVersionSelector_; + } + + /** + * + * + *
    +     * Optional. Specifies the configuration for the Filter version to be used.
    +     * If this field is populated, it takes precedence over any values set in
    +     * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +     * `PiAndJailbreakFilterSettings`.
    +     * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder + getFilterVersionSelectorOrBuilder() { + return filterVersionSelector_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance() + : filterVersionSelector_; + } + public static final int MODALITIES_FIELD_NUMBER = 11; @SuppressWarnings("serial") @@ -1611,6 +1767,49 @@ public int getModalitiesValue(int index) { private int modalitiesMemoizedSerializedSize; + public static final int DATA_RESIDENCY_COMPLIANT_FIELD_NUMBER = 12; + private boolean dataResidencyCompliant_ = false; + + /** + * + * + *
    +     * Optional. Indicates whether the template is subject to data residency
    +     * compliance. If true (default for new templates), the template is subject
    +     * to data residency compliance. If false, the template bypasses data
    +     * residency compliance checks.
    +     * 
    + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataResidencyCompliant field is set. + */ + @java.lang.Override + public boolean hasDataResidencyCompliant() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
    +     * Optional. Indicates whether the template is subject to data residency
    +     * compliance. If true (default for new templates), the template is subject
    +     * to data residency compliance. If false, the template bypasses data
    +     * residency compliance checks.
    +     * 
    + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataResidencyCompliant. + */ + @java.lang.Override + public boolean getDataResidencyCompliant() { + return dataResidencyCompliant_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1659,6 +1858,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(9, getMultiLanguageDetection()); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getFilterVersionSelector()); + } if (getModalitiesList().size() > 0) { output.writeUInt32NoTag(90); output.writeUInt32NoTag(modalitiesMemoizedSerializedSize); @@ -1666,6 +1868,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < modalities_.size(); i++) { output.writeEnumNoTag(modalities_.getInt(i)); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeBool(12, dataResidencyCompliant_); + } getUnknownFields().writeTo(output); } @@ -1717,6 +1922,11 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 9, getMultiLanguageDetection()); } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getFilterVersionSelector()); + } { int dataSize = 0; for (int i = 0; i < modalities_.size(); i++) { @@ -1730,6 +1940,9 @@ public int getSerializedSize() { } modalitiesMemoizedSerializedSize = dataSize; } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, dataResidencyCompliant_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1762,7 +1975,15 @@ public boolean equals(final java.lang.Object obj) { if (hasMultiLanguageDetection()) { if (!getMultiLanguageDetection().equals(other.getMultiLanguageDetection())) return false; } + if (hasFilterVersionSelector() != other.hasFilterVersionSelector()) return false; + if (hasFilterVersionSelector()) { + if (!getFilterVersionSelector().equals(other.getFilterVersionSelector())) return false; + } if (!modalities_.equals(other.modalities_)) return false; + if (hasDataResidencyCompliant() != other.hasDataResidencyCompliant()) return false; + if (hasDataResidencyCompliant()) { + if (getDataResidencyCompliant() != other.getDataResidencyCompliant()) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1796,10 +2017,18 @@ public int hashCode() { hash = (37 * hash) + MULTI_LANGUAGE_DETECTION_FIELD_NUMBER; hash = (53 * hash) + getMultiLanguageDetection().hashCode(); } + if (hasFilterVersionSelector()) { + hash = (37 * hash) + FILTER_VERSION_SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getFilterVersionSelector().hashCode(); + } if (getModalitiesCount() > 0) { hash = (37 * hash) + MODALITIES_FIELD_NUMBER; hash = (53 * hash) + modalities_.hashCode(); } + if (hasDataResidencyCompliant()) { + hash = (37 * hash) + DATA_RESIDENCY_COMPLIANT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDataResidencyCompliant()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1943,6 +2172,7 @@ private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { internalGetMultiLanguageDetectionFieldBuilder(); + internalGetFilterVersionSelectorFieldBuilder(); } } @@ -1963,7 +2193,13 @@ public Builder clear() { multiLanguageDetectionBuilder_.dispose(); multiLanguageDetectionBuilder_ = null; } + filterVersionSelector_ = null; + if (filterVersionSelectorBuilder_ != null) { + filterVersionSelectorBuilder_.dispose(); + filterVersionSelectorBuilder_ = null; + } modalities_ = emptyIntList(); + dataResidencyCompliant_ = false; return this; } @@ -2033,9 +2269,20 @@ private void buildPartial0(com.google.cloud.modelarmor.v1.Template.TemplateMetad to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000200) != 0)) { + result.filterVersionSelector_ = + filterVersionSelectorBuilder_ == null + ? filterVersionSelector_ + : filterVersionSelectorBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { modalities_.makeImmutable(); result.modalities_ = modalities_; } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.dataResidencyCompliant_ = dataResidencyCompliant_; + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -2083,17 +2330,23 @@ public Builder mergeFrom(com.google.cloud.modelarmor.v1.Template.TemplateMetadat if (other.hasMultiLanguageDetection()) { mergeMultiLanguageDetection(other.getMultiLanguageDetection()); } + if (other.hasFilterVersionSelector()) { + mergeFilterVersionSelector(other.getFilterVersionSelector()); + } if (!other.modalities_.isEmpty()) { if (modalities_.isEmpty()) { modalities_ = other.modalities_; modalities_.makeImmutable(); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; } else { ensureModalitiesIsMutable(); modalities_.addAll(other.modalities_); } onChanged(); } + if (other.hasDataResidencyCompliant()) { + setDataResidencyCompliant(other.getDataResidencyCompliant()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2176,6 +2429,14 @@ public Builder mergeFrom( bitField0_ |= 0x00000100; break; } // case 74 + case 82: + { + input.readMessage( + internalGetFilterVersionSelectorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 case 88: { int tmpRaw = input.readEnum(); @@ -2194,6 +2455,12 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 90 + case 96: + { + dataResidencyCompliant_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3112,13 +3379,258 @@ public Builder clearMultiLanguageDetection() { return multiLanguageDetectionBuilder_; } + private com.google.cloud.modelarmor.v1.FilterVersionSelector filterVersionSelector_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionSelector, + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder, + com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder> + filterVersionSelectorBuilder_; + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the filterVersionSelector field is set. + */ + public boolean hasFilterVersionSelector() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filterVersionSelector. + */ + public com.google.cloud.modelarmor.v1.FilterVersionSelector getFilterVersionSelector() { + if (filterVersionSelectorBuilder_ == null) { + return filterVersionSelector_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance() + : filterVersionSelector_; + } else { + return filterVersionSelectorBuilder_.getMessage(); + } + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFilterVersionSelector( + com.google.cloud.modelarmor.v1.FilterVersionSelector value) { + if (filterVersionSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filterVersionSelector_ = value; + } else { + filterVersionSelectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFilterVersionSelector( + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder builderForValue) { + if (filterVersionSelectorBuilder_ == null) { + filterVersionSelector_ = builderForValue.build(); + } else { + filterVersionSelectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFilterVersionSelector( + com.google.cloud.modelarmor.v1.FilterVersionSelector value) { + if (filterVersionSelectorBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && filterVersionSelector_ != null + && filterVersionSelector_ + != com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance()) { + getFilterVersionSelectorBuilder().mergeFrom(value); + } else { + filterVersionSelector_ = value; + } + } else { + filterVersionSelectorBuilder_.mergeFrom(value); + } + if (filterVersionSelector_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFilterVersionSelector() { + bitField0_ = (bitField0_ & ~0x00000200); + filterVersionSelector_ = null; + if (filterVersionSelectorBuilder_ != null) { + filterVersionSelectorBuilder_.dispose(); + filterVersionSelectorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder + getFilterVersionSelectorBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetFilterVersionSelectorFieldBuilder().getBuilder(); + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder + getFilterVersionSelectorOrBuilder() { + if (filterVersionSelectorBuilder_ != null) { + return filterVersionSelectorBuilder_.getMessageOrBuilder(); + } else { + return filterVersionSelector_ == null + ? com.google.cloud.modelarmor.v1.FilterVersionSelector.getDefaultInstance() + : filterVersionSelector_; + } + } + + /** + * + * + *
    +       * Optional. Specifies the configuration for the Filter version to be used.
    +       * If this field is populated, it takes precedence over any values set in
    +       * the deprecated `filter_version` fields within `RaiFilterSettings`,
    +       * `PiAndJailbreakFilterSettings`.
    +       * 
    + * + * + * optional .google.cloud.modelarmor.v1.FilterVersionSelector filter_version_selector = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionSelector, + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder, + com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder> + internalGetFilterVersionSelectorFieldBuilder() { + if (filterVersionSelectorBuilder_ == null) { + filterVersionSelectorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.modelarmor.v1.FilterVersionSelector, + com.google.cloud.modelarmor.v1.FilterVersionSelector.Builder, + com.google.cloud.modelarmor.v1.FilterVersionSelectorOrBuilder>( + getFilterVersionSelector(), getParentForChildren(), isClean()); + filterVersionSelector_ = null; + } + return filterVersionSelectorBuilder_; + } + private com.google.protobuf.Internal.IntList modalities_ = emptyIntList(); private void ensureModalitiesIsMutable() { if (!modalities_.isModifiable()) { modalities_ = makeMutableCopy(modalities_); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; } /** @@ -3269,7 +3781,7 @@ public Builder addAllModalities( */ public Builder clearModalities() { modalities_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } @@ -3381,6 +3893,98 @@ public Builder addAllModalitiesValue(java.lang.Iterable value return this; } + private boolean dataResidencyCompliant_; + + /** + * + * + *
    +       * Optional. Indicates whether the template is subject to data residency
    +       * compliance. If true (default for new templates), the template is subject
    +       * to data residency compliance. If false, the template bypasses data
    +       * residency compliance checks.
    +       * 
    + * + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the dataResidencyCompliant field is set. + */ + @java.lang.Override + public boolean hasDataResidencyCompliant() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
    +       * Optional. Indicates whether the template is subject to data residency
    +       * compliance. If true (default for new templates), the template is subject
    +       * to data residency compliance. If false, the template bypasses data
    +       * residency compliance checks.
    +       * 
    + * + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dataResidencyCompliant. + */ + @java.lang.Override + public boolean getDataResidencyCompliant() { + return dataResidencyCompliant_; + } + + /** + * + * + *
    +       * Optional. Indicates whether the template is subject to data residency
    +       * compliance. If true (default for new templates), the template is subject
    +       * to data residency compliance. If false, the template bypasses data
    +       * residency compliance checks.
    +       * 
    + * + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dataResidencyCompliant to set. + * @return This builder for chaining. + */ + public Builder setDataResidencyCompliant(boolean value) { + + dataResidencyCompliant_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Optional. Indicates whether the template is subject to data residency
    +       * compliance. If true (default for new templates), the template is subject
    +       * to data residency compliance. If false, the template bypasses data
    +       * residency compliance checks.
    +       * 
    + * + * + * optional bool data_residency_compliant = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataResidencyCompliant() { + bitField0_ = (bitField0_ & ~0x00000800); + dataResidencyCompliant_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.cloud.modelarmor.v1.Template.TemplateMetadata) } diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/V1mainProto.java b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/V1mainProto.java index 1361598b08fa..3e55a77fa48d 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/V1mainProto.java +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/java/com/google/cloud/modelarmor/v1/V1mainProto.java @@ -40,6 +40,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_modelarmor_v1_Template_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -68,6 +72,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_modelarmor_v1_FloorSetting_FloorSettingMetadata_MultiLanguageDetection_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_modelarmor_v1_FloorSetting_FloorSettingMetadata_MultiLanguageDetection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_modelarmor_v1_AiPlatformFloorSetting_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -152,6 +160,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseResponse_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_modelarmor_v1_SanitizationResult_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -277,7 +289,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "google/api/field_info.proto\032\031google/api/" + "resource.proto\032\033google/protobuf/empty.proto\032" + " google/protobuf/field_mask.proto\032\037g" - + "oogle/protobuf/timestamp.proto\032\026google/type/date.proto\"\305\n\n" + + "oogle/protobuf/timestamp.proto\032\026google/type/date.proto\"{\n" + + "\025FilterVersionSelector\022\021\n" + + "\007version\030\001 \001(\tH\000\022?\n" + + "\005alias\030\002 \001(\0162..goog" + + "le.cloud.modelarmor.v1.FilterVersionAliasH\000B\016\n" + + "\014version_spec\"\212\014\n" + "\010Template\022\022\n" + "\004name\030\001 \001(\tB\004\342A\001\010\0225\n" + "\013create_time\030\002" @@ -289,7 +306,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "filter_config\030\005" + " \001(\0132(.google.cloud.modelarmor.v1.FilterConfigB\004\342A\001\002\022V\n" + "\021template_metadata\030\006" - + " \001(\01325.google.cloud.modelarmor.v1.Template.TemplateMetadataB\004\342A\001\001\032\244\006\n" + + " \001(\01325.google.cloud.modelarmor.v1.Template.TemplateMetadataB\004\342A\001\001\032\351\007\n" + "\020TemplateMetadata\0220\n" + "\"ignore_partial_invocation_failures\030\001 \001(\010B\004\342A\001\001\022-\n" + "\037custom_prompt_safety_error_code\030\002 \001(\005B\004\342A\001\001\0220\n" @@ -298,24 +315,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "(custom_llm_response_safety_error_message\030\005 \001(\tB\004\342A\001\001\022%\n" + "\027log_template_operations\030\006 \001(\010B\004\342A\001\001\022%\n" + "\027log_sanitize_operations\030\007 \001(\010B\004\342A\001\001\022e\n" - + "\020enforcement_type\030\010 \001(\0162E.google.cloud.modelarmor.v1.T" - + "emplate.TemplateMetadata.EnforcementTypeB\004\342A\001\001\022t\n" - + "\030multi_language_detection\030\t \001(\0132L.google.cloud.modelarmor.v1.Template.T" - + "emplateMetadata.MultiLanguageDetectionB\004\342A\001\001\022>\n\n" + + "\020enforcement_type\030\010 \001(\0162E.google.cloud.modelarmor" + + ".v1.Template.TemplateMetadata.EnforcementTypeB\004\342A\001\001\022t\n" + + "\030multi_language_detection\030\t \001(\0132L.google.cloud.modelarmor.v1.Templ" + + "ate.TemplateMetadata.MultiLanguageDetectionB\004\342A\001\001\022]\n" + + "\027filter_version_selector\030\n" + + " \001" + + "(\01321.google.cloud.modelarmor.v1.FilterVersionSelectorB\004\342A\001\001H\000\210\001\001\022>\n\n" + "modalities\030\013" - + " \003(\0162$.google.cloud.modelarmor.v1.ModalityB\004\342A\001\001\032G\n" + + " \003(\0162$.google.cloud.modelarmor.v1.ModalityB\004\342A\001\001\022+\n" + + "\030data_residency_compliant\030\014" + + " \001(\010B\004\342A\001\001H\001\210\001\001\032G\n" + "\026MultiLanguageDetection\022-\n" + "\037enable_multi_language_detection\030\001 \001(\010B\004\342A\001\002\"\\\n" + "\017EnforcementType\022 \n" + "\034ENFORCEMENT_TYPE_UNSPECIFIED\020\000\022\020\n" + "\014INSPECT_ONLY\020\001\022\025\n" - + "\021INSPECT_AND_BLOCK\020\002\032-\n" + + "\021INSPECT_AND_BLOCK\020\002B\032\n" + + "\030_filter_version_selectorB\033\n" + + "\031_data_residency_compliant\032-\n" + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001:z\352Aw\n" - + "\"modelarmor.googleapis.com/Templ" - + "ate\022organizations/{o" - + "rganization}/locations/{location}/floorSetting*\r" + + "\013AI_PLATFORM\020\001\022\025\n" + + "\021GOOGLE_MCP_SERVER\020\002:\363\001\352A\357\001\n" + + "&modelarmor.googleapis.com/FloorSetting\0224projects/{project}/locations/{loca" + + "tion}/floorSetting\0222folders/{folder}/locations/{location}/floorSetting\022>organiza" + + "tions/{organization}/locations/{location}/floorSetting*\r" + "floorSettings2\014floorSettingB#\n" + "!_enable_floor_setting_enforcementB\034\n" - + "\032_ai_platform_floor_setting\"\221\001\n" + + "\032_ai_platform_floor_settingB\"\n" + + " _google_mcp_server_floor_setting\"\220\001\n" + + "\025McpServerFloorSetting\022\034\n" + + "\014inspect_only\030\001 \001(\010B\004\342A\001\001H\000\022!\n" + + "\021inspect_and_block\030\002 \001(\010B\004\342A\001\001H\000\022\"\n" + + "\024enable_cloud_logging\030\003 \001(\010B\004\342A\001\001B\022\n" + + "\020enforcement_type\"\221\001\n" + "\026AiPlatformFloorSetting\022\034\n" + "\014inspect_only\030\001 \001(\010B\004\342A\001\001H\000\022!\n" + "\021inspect_and_block\030\002 \001(\010B\004\342A\001\001H\000\022\"\n" @@ -367,8 +399,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB+\342A\001\002\372A$\n" + "\"modelarmor.googleapis.com/Template\"\317\001\n" + "\025CreateTemplateRequest\022;\n" - + "\006parent\030\001 \001(" - + "\tB+\342A\001\002\372A$\022\"modelarmor.googleapis.com/Template\022\031\n" + + "\006parent\030\001 \001(\tB+\342A\001" + + "\002\372A$\022\"modelarmor.googleapis.com/Template\022\031\n" + "\013template_id\030\002 \001(\tB\004\342A\001\002\022<\n" + "\010template\030\003" + " \001(\0132$.google.cloud.modelarmor.v1.TemplateB\004\342A\001\002\022 \n\n" @@ -388,44 +420,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB/\342A\001\002\372A(\n" + "&modelarmor.googleapis.com/FloorSetting\"\231\001\n" + "\031UpdateFloorSettingRequest\022E\n\r" - + "floor_setting\030\001" - + " \001(\0132(.google.cloud.modelarmor.v1.FloorSettingB\004\342A\001\002\0225\n" + + "floor_setting\030\001 \001(\013" + + "2(.google.cloud.modelarmor.v1.FloorSettingB\004\342A\001\002\0225\n" + "\013update_mask\030\002" + " \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\001\"\363\002\n" + "\014FilterConfig\022I\n" - + "\014rai_settings\030\001 \001(\0132-.google" - + ".cloud.modelarmor.v1.RaiFilterSettingsB\004\342A\001\001\022I\n" - + "\014sdp_settings\030\002 \001(\0132-.google.clou" - + "d.modelarmor.v1.SdpFilterSettingsB\004\342A\001\001\022h\n" - + " pi_and_jailbreak_filter_settings\030\003 \001(" - + "\01328.google.cloud.modelarmor.v1.PiAndJailbreakFilterSettingsB\004\342A\001\001\022c\n" - + "\035malicious_uri_filter_settings\030\004 \001(\01326.google.cloud." - + "modelarmor.v1.MaliciousUriFilterSettingsB\004\342A\001\001\"\343\002\n" + + "\014rai_settings\030\001" + + " \001(\0132-.google.cloud.modelarmor.v1.RaiFilterSettingsB\004\342A\001\001\022I\n" + + "\014sdp_settings\030\002" + + " \001(\0132-.google.cloud.modelarmor.v1.SdpFilterSettingsB\004\342A\001\001\022h\n" + + " pi_and_jailbreak_filter_settings\030\003 \001(\01328.googl" + + "e.cloud.modelarmor.v1.PiAndJailbreakFilterSettingsB\004\342A\001\001\022c\n" + + "\035malicious_uri_filter_settings\030\004 \001(\01326.google.cloud.modelarmo" + + "r.v1.MaliciousUriFilterSettingsB\004\342A\001\001\"\343\002\n" + "\034PiAndJailbreakFilterSettings\022z\n" - + "\022filter_enforcement\030\001 \001(\0162X.google.clo" - + "ud.modelarmor.v1.PiAndJailbreakFilterSet" - + "tings.PiAndJailbreakFilterEnforcementB\004\342A\001\001\022T\n" - + "\020confidence_level\030\003 \001(\01624.google.c" - + "loud.modelarmor.v1.DetectionConfidenceLevelB\004\342A\001\001\"q\n" + + "\022filter_enforcement\030\001 \001(\0162X.google.cloud.modela" + + "rmor.v1.PiAndJailbreakFilterSettings.PiAndJailbreakFilterEnforcementB\004\342A\001\001\022T\n" + + "\020confidence_level\030\003 \001(\01624.google.cloud.mode" + + "larmor.v1.DetectionConfidenceLevelB\004\342A\001\001\"q\n" + "\037PiAndJailbreakFilterEnforcement\0223\n" + "/PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED\020\000\022\013\n" + "\007ENABLED\020\001\022\014\n" + "\010DISABLED\020\002\"\202\002\n" + "\032MaliciousUriFilterSettings\022v\n" - + "\022filter_enforcement\030\001 \001(\0162T.google.cloud.m" - + "odelarmor.v1.MaliciousUriFilterSettings.MaliciousUriFilterEnforcementB\004\342A\001\001\"l\n" + + "\022filter_enforcement\030\001 \001(\0162T.google.cloud.modelarmor" + + ".v1.MaliciousUriFilterSettings.MaliciousUriFilterEnforcementB\004\342A\001\001\"l\n" + "\035MaliciousUriFilterEnforcement\0220\n" + ",MALICIOUS_URI_FILTER_ENFORCEMENT_UNSPECIFIED\020\000\022\013\n" + "\007ENABLED\020\001\022\014\n" + "\010DISABLED\020\002\"\221\002\n" + "\021RaiFilterSettings\022R\n" - + "\013rai_filters\030\001 \003(\01327.google.cl" - + "oud.modelarmor.v1.RaiFilterSettings.RaiFilterB\004\342A\001\002\032\247\001\n" + + "\013rai_filters\030\001 \003(\01327.google.cloud.model" + + "armor.v1.RaiFilterSettings.RaiFilterB\004\342A\001\002\032\247\001\n" + "\tRaiFilter\022D\n" - + "\013filter_type\030\001" - + " \001(\0162).google.cloud.modelarmor.v1.RaiFilterTypeB\004\342A\001\002\022T\n" - + "\020confidence_level\030\002 \001(" - + "\01624.google.cloud.modelarmor.v1.DetectionConfidenceLevelB\004\342A\001\001\"\302\001\n" + + "\013filter_type\030\001 \001(\0162)." + + "google.cloud.modelarmor.v1.RaiFilterTypeB\004\342A\001\002\022T\n" + + "\020confidence_level\030\002 \001(\01624.googl" + + "e.cloud.modelarmor.v1.DetectionConfidenceLevelB\004\342A\001\001\"\302\001\n" + "\021SdpFilterSettings\022H\n" + "\014basic_config\030\001" + " \001(\0132*.google.cloud.modelarmor.v1.SdpBasicConfigB\004\342A\001\001H\000\022N\n" @@ -433,8 +464,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\0132-.google.cloud.modelarmor.v1.SdpAdvancedConfigB\004\342A\001\001H\000B\023\n" + "\021sdp_configuration\"\336\001\n" + "\016SdpBasicConfig\022f\n" - + "\022filter_enforcement\030\003 \001(\0162D.google.cloud" - + ".modelarmor.v1.SdpBasicConfig.SdpBasicConfigEnforcementB\004\342A\001\001\"d\n" + + "\022filter_enforcement\030\003 \001(\0162D.google.cloud.modelarm" + + "or.v1.SdpBasicConfig.SdpBasicConfigEnforcementB\004\342A\001\001\"d\n" + "\031SdpBasicConfigEnforcement\022,\n" + "(SDP_BASIC_CONFIG_ENFORCEMENT_UNSPECIFIED\020\000\022\013\n" + "\007ENABLED\020\001\022\014\n" @@ -445,10 +476,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\031SanitizeUserPromptRequest\0229\n" + "\004name\030\001 \001(\tB+\342A\001\002\372A$\n" + "\"modelarmor.googleapis.com/Template\022D\n" - + "\020user_prompt_data\030\002" - + " \001(\0132$.google.cloud.modelarmor.v1.DataItemB\004\342A\001\002\022k\n" - + "!multi_language_detection_metadata\030\006 \001(\0132:.google.cloud.modelarmor." - + "v1.MultiLanguageDetectionMetadataB\004\342A\001\001\022L\n" + + "\020user_prompt_data\030\002 \001(\0132$." + + "google.cloud.modelarmor.v1.DataItemB\004\342A\001\002\022k\n" + + "!multi_language_detection_metadata\030\006" + + " \001(\0132:.google.cloud.modelarmor.v1.MultiLanguageDetectionMetadataB\004\342A\001\001\022L\n" + "\016streaming_mode\030\007" + " \001(\0162).google.cloud.modelarmor.v1.StreamingModeB\004\342A\001\001H\000\210\001\001B\021\n" + "\017_streaming_mode\"\213\003\n" @@ -458,32 +489,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\023model_response_data\030\002" + " \001(\0132$.google.cloud.modelarmor.v1.DataItemB\004\342A\001\002\022\031\n" + "\013user_prompt\030\004 \001(\tB\004\342A\001\001\022k\n" - + "!multi_language_detection_metadata\030\007" - + " \001(\0132:.google.cloud.modelarmor.v1.MultiLanguageDetectionMetadataB\004\342A\001\001\022L\n" + + "!multi_language_detection_metadata\030\007 \001" + + "(\0132:.google.cloud.modelarmor.v1.MultiLanguageDetectionMetadataB\004\342A\001\001\022L\n" + "\016streaming_mode\030\010" + " \001(\0162).google.cloud.modelarmor.v1.StreamingModeB\004\342A\001\001H\000\210\001\001B\021\n" + "\017_streaming_mode\"o\n" + "\032SanitizeUserPromptResponse\022Q\n" - + "\023sanitization_result\030\001 \001(\0132..goog" - + "le.cloud.modelarmor.v1.SanitizationResultB\004\342A\001\003\"r\n" + + "\023sanitization_result\030\001 \001(\0132..google.cloud." + + "modelarmor.v1.SanitizationResultB\004\342A\001\003\"r\n" + "\035SanitizeModelResponseResponse\022Q\n" - + "\023sanitization_result\030\001 \001(\0132..google.c" - + "loud.modelarmor.v1.SanitizationResultB\004\342A\001\003\"\232\005\n" + + "\023sanitization_result\030\001" + + " \001(\0132..google.cloud.modelarmor.v1.SanitizationResultB\004\342A\001\003\"\221\003\n" + + "\023FilterVersionConfig\022\034\n" + + "\016filter_version\030\001 \001(\tB\004\342A\001\003\022W\n" + + "\024filter_version_alias\030\002 \001(\0162." + + ".google.cloud.modelarmor.v1.FilterVersionAliasB\004\342A\001\003H\000\210\001\001\0222\n" + + "\014release_date\030\003" + + " \001(\0132\021.google.type.DateB\004\342A\001\003H\001\210\001\001\022@\n" + + "\032projected_deprecation_date\030\004" + + " \001(\0132\021.google.type.DateB\004\342A\001\003H\002\210\001\001\022D\n\r" + + "message_items\030\005 \003(\0132\'" + + ".google.cloud.modelarmor.v1.MessageItemB\004\342A\001\003B\027\n" + + "\025_filter_version_aliasB\017\n\r" + + "_release_dateB\035\n" + + "\033_projected_deprecation_date\"\360\005\n" + "\022SanitizationResult\022N\n" + "\022filter_match_state\030\001" + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022_\n" - + "\016filter_results\030\002 \003(\0132A.google.cloud.modelarmor.v1." - + "SanitizationResult.FilterResultsEntryB\004\342A\001\003\022M\n" - + "\021invocation_result\030\004 \001(\0162,.google." - + "cloud.modelarmor.v1.InvocationResultB\004\342A\001\003\022h\n" - + "\025sanitization_metadata\030\003 \001(\0132C.goog" - + "le.cloud.modelarmor.v1.SanitizationResult.SanitizationMetadataB\004\342A\001\003\032\271\001\n" + + "\016filter_results\030\002 \003(\0132A.google.cloud.modelarmor.v1.Sanit" + + "izationResult.FilterResultsEntryB\004\342A\001\003\022M\n" + + "\021invocation_result\030\004" + + " \001(\0162,.google.cloud.modelarmor.v1.InvocationResultB\004\342A\001\003\022h\n" + + "\025sanitization_metadata\030\003 \001(\0132C.google.cl" + + "oud.modelarmor.v1.SanitizationResult.SanitizationMetadataB\004\342A\001\003\032\217\002\n" + "\024SanitizationMetadata\022\022\n\n" + "error_code\030\001 \001(\003\022\025\n\r" + "error_message\030\002 \001(\t\022*\n" + "\"ignore_partial_invocation_failures\030\003 \001(\010\022J\n" + "\026stream_chunk_processed\030\004" - + " \001(\0132$.google.cloud.modelarmor.v1.DataItemB\004\342A\001\003\032^\n" + + " \001(\0132$.google.cloud.modelarmor.v1.DataItemB\004\342A\001\003\022T\n" + + "\025filter_version_config\030\006 \001" + + "(\0132/.google.cloud.modelarmor.v1.FilterVersionConfigB\004\342A\001\003\032^\n" + "\022FilterResultsEntry\022\013\n" + "\003key\030\001 \001(\t\0227\n" + "\005value\030\002 \001(\0132(.google.cloud.modelarmor.v1.FilterResult:\0028\001\"n\n" @@ -495,8 +541,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\0132+.google.cloud.modelarmor.v1.RaiFilterResultH\000\022H\n" + "\021sdp_filter_result\030\002" + " \001(\0132+.google.cloud.modelarmor.v1.SdpFilterResultH\000\022`\n" - + "\036pi_and_jailbreak_filter_result\030\003 \001(\01326.google.c" - + "loud.modelarmor.v1.PiAndJailbreakFilterResultH\000\022[\n" + + "\036pi_and_jailbreak_filter_result\030\003 \001(\01326.google." + + "cloud.modelarmor.v1.PiAndJailbreakFilterResultH\000\022[\n" + "\033malicious_uri_filter_result\030\004" + " \001(\01324.google.cloud.modelarmor.v1.MaliciousUriFilterResultH\000\022Q\n" + "\031csam_filter_filter_result\030\005" @@ -508,25 +554,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017execution_state\030\001" + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003 \001(\0162,.goog" - + "le.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022f\n" - + "\027rai_filter_type_results\030\004 \003(\0132E" - + ".google.cloud.modelarmor.v1.RaiFilterResult.RaiFilterTypeResultsEntry\032\356\001\n" + + "\013match_state\030\003 \001(\0162,.goo" + + "gle.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022f\n" + + "\027rai_filter_type_results\030\004 \003(\0132" + + "E.google.cloud.modelarmor.v1.RaiFilterResult.RaiFilterTypeResultsEntry\032\356\001\n" + "\023RaiFilterTypeResult\022>\n" + "\013filter_type\030\001 \001(\0162).google.cloud.modelarmor.v1.RaiFilterType\022N\n" - + "\020confidence_level\030\002" - + " \001(\01624.google.cloud.modelarmor.v1.DetectionConfidenceLevel\022G\n" + + "\020confidence_level\030\002 \001(\01624.google.cloud." + + "modelarmor.v1.DetectionConfidenceLevel\022G\n" + "\013match_state\030\003" + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\032|\n" + "\031RaiFilterTypeResultsEntry\022\013\n" + "\003key\030\001 \001(\t\022N\n" - + "\005value\030\002" - + " \001(\0132?.google.cloud.modelarmor.v1.RaiFilterResult.RaiFilterTypeResult:\0028\001\"\367\001\n" + + "\005value\030\002 \001(\0132?.google.cloud.modelarmor.v1.Ra" + + "iFilterResult.RaiFilterTypeResult:\0028\001\"\367\001\n" + "\017SdpFilterResult\022F\n" - + "\016inspect_result\030\001 \001(\013" - + "2,.google.cloud.modelarmor.v1.SdpInspectResultH\000\022L\n" - + "\021deidentify_result\030\002 \001(\0132/.go" - + "ogle.cloud.modelarmor.v1.SdpDeidentifyResultH\000\022D\n\r" + + "\016inspect_result\030\001 \001(" + + "\0132,.google.cloud.modelarmor.v1.SdpInspectResultH\000\022L\n" + + "\021deidentify_result\030\002 \001(\0132/.g" + + "oogle.cloud.modelarmor.v1.SdpDeidentifyResultH\000\022D\n\r" + "redact_result\030\003" + " \001(\0132+.google.cloud.modelarmor.v1.SdpRedactResultH\000B\010\n" + "\006result\"\340\002\n" @@ -534,19 +580,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017execution_state\030\001" + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003 \001(\0162,.goog" - + "le.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\0228\n" + + "\013match_state\030\003 \001(\0162,.goo" + + "gle.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\0228\n" + "\010findings\030\004 \003(\0132&.google.cloud.modelarmor.v1.SdpFinding\022\032\n" + "\022findings_truncated\030\005 \001(\010\022\034\n" + "\024extracted_image_text\030\006 \001(\t\"f\n" + "\010DataItem\022\016\n" + "\004text\030\001 \001(\tH\000\022=\n" + "\tbyte_item\030\002 \001(\0132(.google.cloud.modelarmor.v1.ByteDataItemH\000B\013\n" - + "\tdata_item\"\247\002\n" + + "\tdata_item\"\301\002\n" + "\014ByteDataItem\022S\n" - + "\016byte_data_type\030\001 \001(\01625.google.clou" - + "d.modelarmor.v1.ByteDataItem.ByteItemTypeB\004\342A\001\002\022\027\n" - + "\tbyte_data\030\002 \001(\014B\004\342A\001\002\"\250\001\n" + + "\016byte_data_type\030\001 \001(\01625.google.clo" + + "ud.modelarmor.v1.ByteDataItem.ByteItemTypeB\004\342A\001\002\022\027\n" + + "\tbyte_data\030\002 \001(\014B\004\342A\001\002\022\030\n\n" + + "file_label\030\003 \001(\tB\004\342A\001\001\"\250\001\n" + "\014ByteItemType\022\036\n" + "\032BYTE_ITEM_TYPE_UNSPECIFIED\020\000\022\022\n" + "\016PLAINTEXT_UTF8\020\001\022\007\n" @@ -558,75 +605,76 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\003CSV\020\007\022\t\n" + "\005IMAGE\020\010\"\322\002\n" + "\023SdpDeidentifyResult\022O\n" - + "\017execution_state\030\001" - + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + + "\017execution_state\030\001 \001(\0162" + + "0.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003 \001(\0162,.goog" - + "le.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\0222\n" + + "\013match_state\030\003" + + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\0222\n" + "\004data\030\004 \001(\0132$.google.cloud.modelarmor.v1.DataItem\022\031\n" + "\021transformed_bytes\030\005 \001(\003\022\022\n\n" + "info_types\030\006 \003(\t\"\301\001\n" + "\027SdpImageFindingLocation\022Z\n" - + "\016bounding_boxes\030\001 \003(\0132B.g" - + "oogle.cloud.modelarmor.v1.SdpImageFindingLocation.SdpBoundingBox\032J\n" + + "\016bounding_boxes\030\001 \003(\0132B.google.cloud.m" + + "odelarmor.v1.SdpImageFindingLocation.SdpBoundingBox\032J\n" + "\016SdpBoundingBox\022\013\n" + "\003top\030\001 \001(\005\022\014\n" + "\004left\030\002 \001(\005\022\r\n" + "\005width\030\003 \001(\005\022\016\n" + "\006height\030\004 \001(\005\"\217\001\n" + "\022SdpContentLocation\022U\n" - + "\026image_finding_location\030\002 \001(\01323.go" - + "ogle.cloud.modelarmor.v1.SdpImageFindingLocationH\000\022\026\n" + + "\026image_finding_location\030\002" + + " \001(\01323.google.cloud.modelarmor.v1.SdpImageFindingLocationH\000\022\026\n" + "\016container_name\030\001 \001(\tB\n\n" + "\010location\"\217\003\n\n" + "SdpFinding\022\021\n" + "\tinfo_type\030\001 \001(\t\022D\n\n" + "likelihood\030\002 \001(\01620.google.cloud.modelarmor.v1.SdpFindingLikelihood\022K\n" - + "\010location\030\003" - + " \001(\01329.google.cloud.modelarmor.v1.SdpFinding.SdpFindingLocation\032\332\001\n" - + "\022SdpFindingLocation\0229\n\n" + + "\010location\030\003 \001(\01329.go" + + "ogle.cloud.modelarmor.v1.SdpFinding.SdpFindingLocation\032\332\001\n" + + "\022SdpFindingLocation\0229\n" + + "\n" + "byte_range\030\001 \001(\0132%.google.cloud.modelarmor.v1.RangeInfo\022>\n" + "\017codepoint_range\030\002 \001(\0132%.google.cloud.modelarmor.v1.RangeInfo\022I\n" - + "\021content_locations\030\003 \003(\013" - + "2..google.cloud.modelarmor.v1.SdpContentLocation\"\355\002\n" + + "\021content_locations\030\003" + + " \003(\0132..google.cloud.modelarmor.v1.SdpContentLocation\"\355\002\n" + "\017SdpRedactResult\022O\n" - + "\017execution_state\030\001" - + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022D\n\r" - + "message_items\030\002" - + " \003(\0132\'.google.cloud.modelarmor.v1.MessageItemB\004\342A\001\003\022G\n" - + "\013match_state\030\003 \001(\016" - + "2,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022\034\n" + + "\017execution_state\030\001 \001(\016" + + "20.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022D\n\r" + + "message_items\030\002 \003(\0132" + + "\'.google.cloud.modelarmor.v1.MessageItemB\004\342A\001\003\022G\n" + + "\013match_state\030\003 \001(\0162,.google.clo" + + "ud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022\034\n" + "\016redacted_image\030\004 \001(\014B\004\342A\001\003\022>\n" + "\010findings\030\005" + " \003(\0132&.google.cloud.modelarmor.v1.SdpFindingB\004\342A\001\003\022\034\n" + "\024extracted_image_text\030\006 \001(\t\"\306\002\n" + "\032PiAndJailbreakFilterResult\022O\n" - + "\017execution_state\030\001 \001(\01620.googl" - + "e.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + + "\017execution_state\030\001" + + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003" - + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022N\n" - + "\020confidence_level\030\005" - + " \001(\01624.google.cloud.modelarmor.v1.DetectionConfidenceLevel\"\311\003\n" + + "\013match_state\030\003 \001(\016" + + "2,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022N\n" + + "\020confidence_level\030\005 \001(\01624" + + ".google.cloud.modelarmor.v1.DetectionConfidenceLevel\"\311\003\n" + "\030MaliciousUriFilterResult\022O\n" - + "\017execution_state\030\001 \001(\0162" - + "0.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + + "\017execution_state\030\001 \001(\01620.google.clou" + + "d.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" + "\013match_state\030\003" + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022q\n" - + "\033malicious_uri_matched_items\030\004 \003(\0132L.google.c" - + "loud.modelarmor.v1.MaliciousUriFilterResult.MaliciousUriMatchedItem\032`\n" + + "\033malicious_uri_matched_items\030\004 \003(\0132L.google.cloud.modelarm" + + "or.v1.MaliciousUriFilterResult.MaliciousUriMatchedItem\032`\n" + "\027MaliciousUriMatchedItem\022\013\n" + "\003uri\030\001 \001(\t\0228\n" + "\tlocations\030\002 \003(\0132%.google.cloud.modelarmor.v1.RangeInfo\"\242\004\n" + "\025VirusScanFilterResult\022O\n" - + "\017execution_state\030\001" - + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + + "\017execution_state\030\001 " + + "\001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003 \001(\0162,." - + "google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022b\n" - + "\024scanned_content_type\030\004 \001(\0162" - + "D.google.cloud.modelarmor.v1.VirusScanFilterResult.ScannedContentType\022\031\n" + + "\013match_state\030\003" + + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\022b\n" + + "\024scanned_content_type\030\004 \001(\0162D.google.clou" + + "d.modelarmor.v1.VirusScanFilterResult.ScannedContentType\022\031\n" + "\014scanned_size\030\005 \001(\003H\000\210\001\001\022>\n\r" + "virus_details\030\006 \003(\0132\'.google.cloud.modelarmor.v1.VirusDetail\"_\n" + "\022ScannedContentType\022$\n" @@ -648,14 +696,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\033POTENTIALLY_HARMFUL_CONTENT\020\004\022 \n" + "\034POTENTIALLY_UNWANTED_CONTENT\020\005\"\354\001\n" + "\020CsamFilterResult\022O\n" - + "\017execution_state\030\001" - + " \001(\01620.google.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + + "\017execution_state\030\001 \001(\01620.goog" + + "le.cloud.modelarmor.v1.FilterExecutionStateB\004\342A\001\003\022>\n\r" + "message_items\030\002 \003(\0132\'.google.cloud.modelarmor.v1.MessageItem\022G\n" - + "\013match_state\030\003 \001(\0162,.google.clo" - + "ud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\"\270\001\n" + + "\013match_state\030\003" + + " \001(\0162,.google.cloud.modelarmor.v1.FilterMatchStateB\004\342A\001\003\"\270\001\n" + "\013MessageItem\022I\n" - + "\014message_type\030\001 \001(\01623." - + "google.cloud.modelarmor.v1.MessageItem.MessageType\022\017\n" + + "\014message_type\030\001" + + " \001(\01623.google.cloud.modelarmor.v1.MessageItem.MessageType\022\017\n" + "\007message\030\002 \001(\t\"M\n" + "\013MessageType\022\034\n" + "\030MESSAGE_TYPE_UNSPECIFIED\020\000\022\010\n" @@ -705,64 +753,77 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010Modality\022\030\n" + "\024MODALITY_UNSPECIFIED\020\000\022\021\n\r" + "MODALITY_TEXT\020\001\022\022\n" - + "\016MODALITY_IMAGE\020\0022\361\022\n\n" + + "\016MODALITY_IMAGE\020\002*\277\001\n" + + "\022FilterVersionAlias\022$\n" + + " FILTER_VERSION_ALIAS_UNSPECIFIED\020\000\022\037\n" + + "\033FILTER_VERSION_ALIAS_STABLE\020\001\022\037\n" + + "\033FILTER_VERSION_ALIAS_LATEST\020\002\022\037\n" + + "\033FILTER_VERSION_ALIAS_LEGACY\020\003\022 \n" + + "\034FILTER_VERSION_ALIAS_RETIRED\020\0042\361\022\n\n" + "ModelArmor\022\264\001\n\r" - + "ListTemplates\0220.google.cloud.modelarmor.v1.ListTemplatesReq" - + "uest\0321.google.cloud.modelarmor.v1.ListTe" - + "mplatesResponse\">\332A\006parent\202\323\344\223\002/\022-/v1/{p" - + "arent=projects/*/locations/*}/templates\022\241\001\n" - + "\013GetTemplate\022..google.cloud.modelarmor.v1.GetTemplateRequest\032$.google.cloud.m" - + "odelarmor.v1.Template\"<\332A\004name\202\323\344\223\002/\022-/v" - + "1/{name=projects/*/locations/*/templates/*}\022\310\001\n" - + "\016CreateTemplate\0221.google.cloud.modelarmor.v1.CreateTemplateRequest\032$.goog" - + "le.cloud.modelarmor.v1.Template\"]\332A\033pare" - + "nt,template,template_id\202\323\344\223\0029\"-/v1/{pare" - + "nt=projects/*/locations/*}/templates:\010template\022\312\001\n" - + "\016UpdateTemplate\0221.google.cloud.modelarmor.v1.UpdateTemplateRequest\032$.g" - + "oogle.cloud.modelarmor.v1.Template\"_\332A\024t" - + "emplate,update_mask\202\323\344\223\002B26/v1/{template" - + ".name=projects/*/locations/*/templates/*}:\010template\022\231\001\n" - + "\016DeleteTemplate\0221.google.cloud.modelarmor.v1.DeleteTemplateReques" - + "t\032\026.google.protobuf.Empty\"<\332A\004name\202\323\344\223\002/" - + "*-/v1/{name=projects/*/locations/*/templates/*}\022\230\002\n" - + "\017GetFloorSetting\0222.google.cloud.modelarmor.v1.GetFloorSettingRequest\032" - + "(.google.cloud.modelarmor.v1.FloorSettin" - + "g\"\246\001\332A\004name\202\323\344\223\002\230\001\022./v1/{name=projects/*" - + "/locations/*/floorSetting}Z/\022-/v1/{name=folders/*/locations/*/floorSetting}Z5\0223/" - + "v1/{name=organizations/*/locations/*/floorSetting}\022\212\003\n" - + "\022UpdateFloorSetting\0225.google.cloud.modelarmor.v1.UpdateFloorSettin" - + "gRequest\032(.google.cloud.modelarmor.v1.Fl" - + "oorSetting\"\222\002\332A\031floor_setting,update_mas" - + "k\202\323\344\223\002\357\0012cloud.g" - + "oogle.com/go/modelarmor/apiv1/modelarmor" - + "pb;modelarmorpb\252\002\032Google.Cloud.ModelArmo" - + "r.V1\312\002\032Google\\Cloud\\ModelArmor\\V1b\006proto" - + "3" + + "ListTemplates\0220.google.cloud.modelarmor.v1.ListTemplatesRequest\0321.google.cloud" + + ".modelarmor.v1.ListTemplatesResponse\">\332A" + + "\006parent\202\323\344\223\002/\022-/v1/{parent=projects/*/locations/*}/templates\022\241\001\n" + + "\013GetTemplate\022..google.cloud.modelarmor.v1.GetTemplateReq", + "uest\032$.google.cloud.modelarmor.v1.Templa" + + "te\"<\332A\004name\202\323\344\223\002/\022-/v1/{name=projects/*/" + + "locations/*/templates/*}\022\310\001\n\016CreateTempl" + + "ate\0221.google.cloud.modelarmor.v1.CreateT" + + "emplateRequest\032$.google.cloud.modelarmor" + + ".v1.Template\"]\332A\033parent,template,templat" + + "e_id\202\323\344\223\0029\"-/v1/{parent=projects/*/locat" + + "ions/*}/templates:\010template\022\312\001\n\016UpdateTe" + + "mplate\0221.google.cloud.modelarmor.v1.Upda" + + "teTemplateRequest\032$.google.cloud.modelar" + + "mor.v1.Template\"_\332A\024template,update_mask" + + "\202\323\344\223\002B26/v1/{template.name=projects/*/lo" + + "cations/*/templates/*}:\010template\022\231\001\n\016Del" + + "eteTemplate\0221.google.cloud.modelarmor.v1" + + ".DeleteTemplateRequest\032\026.google.protobuf" + + ".Empty\"<\332A\004name\202\323\344\223\002/*-/v1/{name=project" + + "s/*/locations/*/templates/*}\022\230\002\n\017GetFloo" + + "rSetting\0222.google.cloud.modelarmor.v1.Ge" + + "tFloorSettingRequest\032(.google.cloud.mode" + + "larmor.v1.FloorSetting\"\246\001\332A\004name\202\323\344\223\002\230\001\022" + + "./v1/{name=projects/*/locations/*/floorS" + + "etting}Z/\022-/v1/{name=folders/*/locations" + + "/*/floorSetting}Z5\0223/v1/{name=organizati" + + "ons/*/locations/*/floorSetting}\022\212\003\n\022Upda" + + "teFloorSetting\0225.google.cloud.modelarmor" + + ".v1.UpdateFloorSettingRequest\032(.google.c" + + "loud.modelarmor.v1.FloorSetting\"\222\002\332A\031flo" + + "or_setting,update_mask\202\323\344\223\002\357\0012cloud.google.com/go/modela" + + "rmor/apiv1/modelarmorpb;modelarmorpb\252\002\032G" + + "oogle.Cloud.ModelArmor.V1\312\002\032Google\\Cloud" + + "\\ModelArmor\\V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -778,8 +839,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), com.google.type.DateProto.getDescriptor(), }); - internal_static_google_cloud_modelarmor_v1_Template_descriptor = + internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor = getDescriptor().getMessageType(0); + internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_modelarmor_v1_FilterVersionSelector_descriptor, + new java.lang.String[] { + "Version", "Alias", "VersionSpec", + }); + internal_static_google_cloud_modelarmor_v1_Template_descriptor = + getDescriptor().getMessageType(1); internal_static_google_cloud_modelarmor_v1_Template_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_Template_descriptor, @@ -801,7 +870,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LogSanitizeOperations", "EnforcementType", "MultiLanguageDetection", + "FilterVersionSelector", "Modalities", + "DataResidencyCompliant", }); internal_static_google_cloud_modelarmor_v1_Template_TemplateMetadata_MultiLanguageDetection_descriptor = internal_static_google_cloud_modelarmor_v1_Template_TemplateMetadata_descriptor @@ -821,7 +892,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_modelarmor_v1_FloorSetting_descriptor = - getDescriptor().getMessageType(1); + getDescriptor().getMessageType(2); internal_static_google_cloud_modelarmor_v1_FloorSetting_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_FloorSetting_descriptor, @@ -834,6 +905,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "IntegratedServices", "AiPlatformFloorSetting", "FloorSettingMetadata", + "GoogleMcpServerFloorSetting", }); internal_static_google_cloud_modelarmor_v1_FloorSetting_FloorSettingMetadata_descriptor = internal_static_google_cloud_modelarmor_v1_FloorSetting_descriptor.getNestedType(0); @@ -852,8 +924,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "EnableMultiLanguageDetection", }); + internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_modelarmor_v1_McpServerFloorSetting_descriptor, + new java.lang.String[] { + "InspectOnly", "InspectAndBlock", "EnableCloudLogging", "EnforcementType", + }); internal_static_google_cloud_modelarmor_v1_AiPlatformFloorSetting_descriptor = - getDescriptor().getMessageType(2); + getDescriptor().getMessageType(4); internal_static_google_cloud_modelarmor_v1_AiPlatformFloorSetting_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_AiPlatformFloorSetting_descriptor, @@ -861,7 +941,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InspectOnly", "InspectAndBlock", "EnableCloudLogging", "EnforcementType", }); internal_static_google_cloud_modelarmor_v1_ListTemplatesRequest_descriptor = - getDescriptor().getMessageType(3); + getDescriptor().getMessageType(5); internal_static_google_cloud_modelarmor_v1_ListTemplatesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_ListTemplatesRequest_descriptor, @@ -869,7 +949,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "Filter", "OrderBy", }); internal_static_google_cloud_modelarmor_v1_ListTemplatesResponse_descriptor = - getDescriptor().getMessageType(4); + getDescriptor().getMessageType(6); internal_static_google_cloud_modelarmor_v1_ListTemplatesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_ListTemplatesResponse_descriptor, @@ -877,7 +957,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Templates", "NextPageToken", "Unreachable", }); internal_static_google_cloud_modelarmor_v1_GetTemplateRequest_descriptor = - getDescriptor().getMessageType(5); + getDescriptor().getMessageType(7); internal_static_google_cloud_modelarmor_v1_GetTemplateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_GetTemplateRequest_descriptor, @@ -885,7 +965,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_modelarmor_v1_CreateTemplateRequest_descriptor = - getDescriptor().getMessageType(6); + getDescriptor().getMessageType(8); internal_static_google_cloud_modelarmor_v1_CreateTemplateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_CreateTemplateRequest_descriptor, @@ -893,7 +973,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "TemplateId", "Template", "RequestId", }); internal_static_google_cloud_modelarmor_v1_UpdateTemplateRequest_descriptor = - getDescriptor().getMessageType(7); + getDescriptor().getMessageType(9); internal_static_google_cloud_modelarmor_v1_UpdateTemplateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_UpdateTemplateRequest_descriptor, @@ -901,7 +981,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateMask", "Template", "RequestId", }); internal_static_google_cloud_modelarmor_v1_DeleteTemplateRequest_descriptor = - getDescriptor().getMessageType(8); + getDescriptor().getMessageType(10); internal_static_google_cloud_modelarmor_v1_DeleteTemplateRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_DeleteTemplateRequest_descriptor, @@ -909,7 +989,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "RequestId", }); internal_static_google_cloud_modelarmor_v1_GetFloorSettingRequest_descriptor = - getDescriptor().getMessageType(9); + getDescriptor().getMessageType(11); internal_static_google_cloud_modelarmor_v1_GetFloorSettingRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_GetFloorSettingRequest_descriptor, @@ -917,7 +997,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_modelarmor_v1_UpdateFloorSettingRequest_descriptor = - getDescriptor().getMessageType(10); + getDescriptor().getMessageType(12); internal_static_google_cloud_modelarmor_v1_UpdateFloorSettingRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_UpdateFloorSettingRequest_descriptor, @@ -925,7 +1005,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FloorSetting", "UpdateMask", }); internal_static_google_cloud_modelarmor_v1_FilterConfig_descriptor = - getDescriptor().getMessageType(11); + getDescriptor().getMessageType(13); internal_static_google_cloud_modelarmor_v1_FilterConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_FilterConfig_descriptor, @@ -936,7 +1016,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MaliciousUriFilterSettings", }); internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterSettings_descriptor = - getDescriptor().getMessageType(12); + getDescriptor().getMessageType(14); internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterSettings_descriptor, @@ -944,7 +1024,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FilterEnforcement", "ConfidenceLevel", }); internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterSettings_descriptor = - getDescriptor().getMessageType(13); + getDescriptor().getMessageType(15); internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterSettings_descriptor, @@ -952,7 +1032,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FilterEnforcement", }); internal_static_google_cloud_modelarmor_v1_RaiFilterSettings_descriptor = - getDescriptor().getMessageType(14); + getDescriptor().getMessageType(16); internal_static_google_cloud_modelarmor_v1_RaiFilterSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_RaiFilterSettings_descriptor, @@ -968,7 +1048,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FilterType", "ConfidenceLevel", }); internal_static_google_cloud_modelarmor_v1_SdpFilterSettings_descriptor = - getDescriptor().getMessageType(15); + getDescriptor().getMessageType(17); internal_static_google_cloud_modelarmor_v1_SdpFilterSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpFilterSettings_descriptor, @@ -976,7 +1056,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "BasicConfig", "AdvancedConfig", "SdpConfiguration", }); internal_static_google_cloud_modelarmor_v1_SdpBasicConfig_descriptor = - getDescriptor().getMessageType(16); + getDescriptor().getMessageType(18); internal_static_google_cloud_modelarmor_v1_SdpBasicConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpBasicConfig_descriptor, @@ -984,7 +1064,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FilterEnforcement", }); internal_static_google_cloud_modelarmor_v1_SdpAdvancedConfig_descriptor = - getDescriptor().getMessageType(17); + getDescriptor().getMessageType(19); internal_static_google_cloud_modelarmor_v1_SdpAdvancedConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpAdvancedConfig_descriptor, @@ -992,7 +1072,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InspectTemplate", "DeidentifyTemplate", }); internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptRequest_descriptor = - getDescriptor().getMessageType(18); + getDescriptor().getMessageType(20); internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptRequest_descriptor, @@ -1000,7 +1080,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "UserPromptData", "MultiLanguageDetectionMetadata", "StreamingMode", }); internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseRequest_descriptor = - getDescriptor().getMessageType(19); + getDescriptor().getMessageType(21); internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseRequest_descriptor, @@ -1012,7 +1092,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "StreamingMode", }); internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptResponse_descriptor = - getDescriptor().getMessageType(20); + getDescriptor().getMessageType(22); internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SanitizeUserPromptResponse_descriptor, @@ -1020,15 +1100,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SanitizationResult", }); internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseResponse_descriptor = - getDescriptor().getMessageType(21); + getDescriptor().getMessageType(23); internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SanitizeModelResponseResponse_descriptor, new java.lang.String[] { "SanitizationResult", }); + internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_modelarmor_v1_FilterVersionConfig_descriptor, + new java.lang.String[] { + "FilterVersion", + "FilterVersionAlias", + "ReleaseDate", + "ProjectedDeprecationDate", + "MessageItems", + }); internal_static_google_cloud_modelarmor_v1_SanitizationResult_descriptor = - getDescriptor().getMessageType(22); + getDescriptor().getMessageType(25); internal_static_google_cloud_modelarmor_v1_SanitizationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SanitizationResult_descriptor, @@ -1045,6 +1137,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ErrorMessage", "IgnorePartialInvocationFailures", "StreamChunkProcessed", + "FilterVersionConfig", }); internal_static_google_cloud_modelarmor_v1_SanitizationResult_FilterResultsEntry_descriptor = internal_static_google_cloud_modelarmor_v1_SanitizationResult_descriptor.getNestedType(1); @@ -1055,7 +1148,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_modelarmor_v1_MultiLanguageDetectionMetadata_descriptor = - getDescriptor().getMessageType(23); + getDescriptor().getMessageType(26); internal_static_google_cloud_modelarmor_v1_MultiLanguageDetectionMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_MultiLanguageDetectionMetadata_descriptor, @@ -1063,7 +1156,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SourceLanguage", "EnableMultiLanguageDetection", }); internal_static_google_cloud_modelarmor_v1_FilterResult_descriptor = - getDescriptor().getMessageType(24); + getDescriptor().getMessageType(27); internal_static_google_cloud_modelarmor_v1_FilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_FilterResult_descriptor, @@ -1077,7 +1170,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FilterResult", }); internal_static_google_cloud_modelarmor_v1_RaiFilterResult_descriptor = - getDescriptor().getMessageType(25); + getDescriptor().getMessageType(28); internal_static_google_cloud_modelarmor_v1_RaiFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_RaiFilterResult_descriptor, @@ -1101,7 +1194,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_modelarmor_v1_SdpFilterResult_descriptor = - getDescriptor().getMessageType(26); + getDescriptor().getMessageType(29); internal_static_google_cloud_modelarmor_v1_SdpFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpFilterResult_descriptor, @@ -1109,7 +1202,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InspectResult", "DeidentifyResult", "RedactResult", "Result", }); internal_static_google_cloud_modelarmor_v1_SdpInspectResult_descriptor = - getDescriptor().getMessageType(27); + getDescriptor().getMessageType(30); internal_static_google_cloud_modelarmor_v1_SdpInspectResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpInspectResult_descriptor, @@ -1122,7 +1215,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractedImageText", }); internal_static_google_cloud_modelarmor_v1_DataItem_descriptor = - getDescriptor().getMessageType(28); + getDescriptor().getMessageType(31); internal_static_google_cloud_modelarmor_v1_DataItem_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_DataItem_descriptor, @@ -1130,15 +1223,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Text", "ByteItem", "DataItem", }); internal_static_google_cloud_modelarmor_v1_ByteDataItem_descriptor = - getDescriptor().getMessageType(29); + getDescriptor().getMessageType(32); internal_static_google_cloud_modelarmor_v1_ByteDataItem_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_ByteDataItem_descriptor, new java.lang.String[] { - "ByteDataType", "ByteData", + "ByteDataType", "ByteData", "FileLabel", }); internal_static_google_cloud_modelarmor_v1_SdpDeidentifyResult_descriptor = - getDescriptor().getMessageType(30); + getDescriptor().getMessageType(33); internal_static_google_cloud_modelarmor_v1_SdpDeidentifyResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpDeidentifyResult_descriptor, @@ -1151,7 +1244,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InfoTypes", }); internal_static_google_cloud_modelarmor_v1_SdpImageFindingLocation_descriptor = - getDescriptor().getMessageType(31); + getDescriptor().getMessageType(34); internal_static_google_cloud_modelarmor_v1_SdpImageFindingLocation_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpImageFindingLocation_descriptor, @@ -1168,7 +1261,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Top", "Left", "Width", "Height", }); internal_static_google_cloud_modelarmor_v1_SdpContentLocation_descriptor = - getDescriptor().getMessageType(32); + getDescriptor().getMessageType(35); internal_static_google_cloud_modelarmor_v1_SdpContentLocation_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpContentLocation_descriptor, @@ -1176,7 +1269,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ImageFindingLocation", "ContainerName", "Location", }); internal_static_google_cloud_modelarmor_v1_SdpFinding_descriptor = - getDescriptor().getMessageType(33); + getDescriptor().getMessageType(36); internal_static_google_cloud_modelarmor_v1_SdpFinding_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpFinding_descriptor, @@ -1192,7 +1285,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ByteRange", "CodepointRange", "ContentLocations", }); internal_static_google_cloud_modelarmor_v1_SdpRedactResult_descriptor = - getDescriptor().getMessageType(34); + getDescriptor().getMessageType(37); internal_static_google_cloud_modelarmor_v1_SdpRedactResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_SdpRedactResult_descriptor, @@ -1205,7 +1298,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractedImageText", }); internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterResult_descriptor = - getDescriptor().getMessageType(35); + getDescriptor().getMessageType(38); internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_PiAndJailbreakFilterResult_descriptor, @@ -1213,7 +1306,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExecutionState", "MessageItems", "MatchState", "ConfidenceLevel", }); internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterResult_descriptor = - getDescriptor().getMessageType(36); + getDescriptor().getMessageType(39); internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_MaliciousUriFilterResult_descriptor, @@ -1230,7 +1323,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Uri", "Locations", }); internal_static_google_cloud_modelarmor_v1_VirusScanFilterResult_descriptor = - getDescriptor().getMessageType(37); + getDescriptor().getMessageType(40); internal_static_google_cloud_modelarmor_v1_VirusScanFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_VirusScanFilterResult_descriptor, @@ -1243,7 +1336,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "VirusDetails", }); internal_static_google_cloud_modelarmor_v1_VirusDetail_descriptor = - getDescriptor().getMessageType(38); + getDescriptor().getMessageType(41); internal_static_google_cloud_modelarmor_v1_VirusDetail_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_VirusDetail_descriptor, @@ -1251,7 +1344,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Vendor", "Names", "ThreatType", }); internal_static_google_cloud_modelarmor_v1_CsamFilterResult_descriptor = - getDescriptor().getMessageType(39); + getDescriptor().getMessageType(42); internal_static_google_cloud_modelarmor_v1_CsamFilterResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_CsamFilterResult_descriptor, @@ -1259,7 +1352,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExecutionState", "MessageItems", "MatchState", }); internal_static_google_cloud_modelarmor_v1_MessageItem_descriptor = - getDescriptor().getMessageType(40); + getDescriptor().getMessageType(43); internal_static_google_cloud_modelarmor_v1_MessageItem_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_MessageItem_descriptor, @@ -1267,7 +1360,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MessageType", "Message", }); internal_static_google_cloud_modelarmor_v1_RangeInfo_descriptor = - getDescriptor().getMessageType(41); + getDescriptor().getMessageType(44); internal_static_google_cloud_modelarmor_v1_RangeInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_modelarmor_v1_RangeInfo_descriptor, diff --git a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/proto/google/cloud/modelarmor/v1/service.proto b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/proto/google/cloud/modelarmor/v1/service.proto index 290803b6aae1..d891ac9ac9fa 100644 --- a/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/proto/google/cloud/modelarmor/v1/service.proto +++ b/java-modelarmor/proto-google-cloud-modelarmor-v1/src/main/proto/google/cloud/modelarmor/v1/service.proto @@ -266,6 +266,56 @@ enum Modality { MODALITY_IMAGE = 2; } +// Enum for Filter Version Aliases. +// These aliases provide a way to always point to a specific track +// without needing to update the version in templates. +enum FilterVersionAlias { + // The default value. If used, it will resolve to the `STABLE` alias. + FILTER_VERSION_ALIAS_UNSPECIFIED = 0; + + // The `STABLE` alias points to the most recent stable model version. + // Using this alias means no code changes are required when a new model + // becomes the stable version. + FILTER_VERSION_ALIAS_STABLE = 1; + + // The `LATEST` alias points to the newest model version available. + // This version is subject to frequent revisions and offers SLO guarantees + // but does not assure stability, providing the most current security + // protections. + FILTER_VERSION_ALIAS_LATEST = 2; + + // The `LEGACY` alias could be used for sanitization operations for a + // transition period. New templates cannot be created with this version. + FILTER_VERSION_ALIAS_LEGACY = 3; + + // The `RETIRED` alias could be used for versions that are no longer available + // to be used. While new templates cannot be created with this alias, any + // existing template or request using `RETIRED` version will fall back to + // the current `STABLE` version for sanitization operations. + FILTER_VERSION_ALIAS_RETIRED = 4; +} + +// Represents the configuration for selecting a Filter Version. +// Allows customers to choose to use either a specific version or a predefined +// alias. +message FilterVersionSelector { + // Specifies whether to use a specific version or an alias. + // The 'oneof' ensures that only one of these fields can be set. + oneof version_spec { + // Allows customers to pin to a specific, immutable Filter Version. + // This provides stability, as this will not change after a version upgrade. + // Expected format is a case-sensitive string, e.g., "v1", "v2". + // Requests providing an invalid or non-existent version string will be + // rejected with an `INVALID_ARGUMENT` error. + string version = 1; + + // Allows customers to use a predefined alias that dynamically + // points to a specific version based on internal upgrades. + // This offers flexibility and reduces the need for template updates. + FilterVersionAlias alias = 2; + } +} + // Message describing Template resource message Template { option (google.api.resource) = { @@ -337,9 +387,23 @@ message Template { MultiLanguageDetection multi_language_detection = 9 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Specifies the configuration for the Filter version to be used. + // If this field is populated, it takes precedence over any values set in + // the deprecated `filter_version` fields within `RaiFilterSettings`, + // `PiAndJailbreakFilterSettings`. + optional FilterVersionSelector filter_version_selector = 10 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Specifies the modalities to scan. // If empty, only text modality will be scanned. repeated Modality modalities = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the template is subject to data residency + // compliance. If true (default for new templates), the template is subject + // to data residency compliance. If false, the template bypasses data + // residency compliance checks. + optional bool data_residency_compliant = 12 + [(google.api.field_behavior) = OPTIONAL]; } // Identifier. name of resource @@ -396,6 +460,9 @@ message FloorSetting { // AI Platform. AI_PLATFORM = 1; + + // Google MCP Server (via Shim Service Extension) + GOOGLE_MCP_SERVER = 2; } // Identifier. The resource name. @@ -428,6 +495,27 @@ message FloorSetting { // Optional. Metadata for FloorSetting FloorSettingMetadata floor_setting_metadata = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Google MCP Server floor setting. + optional McpServerFloorSetting google_mcp_server_floor_setting = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing MCP Server Floor Setting. +message McpServerFloorSetting { + // Enforcement type for Model Armor filters. + oneof enforcement_type { + // Optional. If true, Model Armor filters will be run in inspect only mode. + // No action will be taken on the request. + bool inspect_only = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, Model Armor filters will be run in inspect and block + // mode. Requests that trip Model Armor filters will be blocked. + bool inspect_and_block = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. If true, log Model Armor filter results to Cloud Logging. + bool enable_cloud_logging = 3 [(google.api.field_behavior) = OPTIONAL]; } // message describing AiPlatformFloorSetting @@ -833,6 +921,31 @@ message SanitizeModelResponseResponse { [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Message describing a Filter Version Configuration. +message FilterVersionConfig { + // Output only. The identifier for this specific version. + string filter_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The alias associated with this version, if any (e.g., + // "STABLE", "LATEST"). This will be populated if this version is currently + // mapped to an alias. + optional FilterVersionAlias filter_version_alias = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The date when this version was released. + optional google.type.Date release_date = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The estimated date when this version is projected to be + // deprecated. + optional google.type.Date projected_deprecation_date = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information regarding this filter version + repeated MessageItem message_items = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Sanitization result after applying all the filters on input content. message SanitizationResult { // Message describing Sanitization metadata. @@ -850,6 +963,11 @@ message SanitizationResult { // Output only. The stream chunk processed by the Sanitization service. DataItem stream_chunk_processed = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details about the Filter Version configuration used + // to sanitize this request. + FilterVersionConfig filter_version_config = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. Overall filter match state for Sanitization. @@ -864,7 +982,7 @@ message SanitizationResult { [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Results for all filters where the key is the filter name - - // either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp". + // either of "csam", "malicious_uris", "rai", "pi_and_jailbreak", "sdp". map filter_results = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -884,8 +1002,18 @@ message SanitizationResult { message MultiLanguageDetectionMetadata { // Optional. Optional Source language of the user prompt. // - // If multi-language detection is enabled but language is not set in that case - // we would automatically detect the source language. + // If multi-language detection is enabled and this field is not set, the + // source language will be automatically detected. When a source language is + // provided, Model Armor uses it to sanitize the input. In that case the + // system does not perform auto-detection and relies solely on the specified + // language. + // + // This string field accepts a language code from the ISO-639 standard. + // For a list of languages supported by Model Armor, see + // [Model Armor supported languages] + // (https://cloud.google.com/security-command-center/docs/model-armor-overview#languages-supported). + // For a comprehensive list of language codes, see + // [ISO-639](https://cloud.google.com/translate/docs/languages#nmt). string source_language = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Enable detection of multi-language prompts and responses. @@ -1054,6 +1182,10 @@ message ByteDataItem { // Required. Bytes Data bytes byte_data = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Label of the file. This is used to identify the file in the + // response. + string file_label = 3 [(google.api.field_behavior) = OPTIONAL]; } // Sensitive Data Protection Deidentification Result. diff --git a/java-spanner/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json b/java-spanner/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json index 5731e03c18d2..87b1fe2018a4 100644 --- a/java-spanner/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json +++ b/java-spanner/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json @@ -3383,6 +3383,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$AllowedProcessingUnits", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$AllowedProcessingUnits$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.InstanceConfig$Builder", "queryAllDeclaredConstructors": true, diff --git a/java-spanner/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json b/java-spanner/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json index ad4a5621c637..e685e0aaa5cd 100644 --- a/java-spanner/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json +++ b/java-spanner/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json @@ -2168,6 +2168,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$AllowedProcessingUnits", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$AllowedProcessingUnits$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.InstanceConfig$Builder", "queryAllDeclaredConstructors": true, diff --git a/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java b/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java index adb7056c08a9..3c686aaa98e6 100644 --- a/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java +++ b/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java @@ -224,6 +224,7 @@ public void getInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockService.addResponse(expectedResponse); @@ -277,6 +278,7 @@ public void getInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockService.addResponse(expectedResponse); @@ -330,6 +332,7 @@ public void createInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = @@ -393,6 +396,7 @@ public void createInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = @@ -456,6 +460,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = @@ -477,6 +482,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -519,6 +525,7 @@ public void updateInstanceConfigExceptionTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); diff --git a/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java b/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java index 5181dbe256f0..92a0312c4e0d 100644 --- a/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java +++ b/java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java @@ -236,6 +236,7 @@ public void getInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -283,6 +284,7 @@ public void getInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -330,6 +332,7 @@ public void createInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = @@ -393,6 +396,7 @@ public void createInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = @@ -456,6 +460,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .addAllAllowedProcessingUnits(new ArrayList()) .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java index 2f5ddaef19dc..37c46d9ca9ec 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java @@ -63,6 +63,7 @@ private InstanceConfig() { leaderOptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); state_ = 0; freeInstanceAvailability_ = 0; + allowedProcessingUnits_ = java.util.Collections.emptyList(); quorumType_ = 0; } @@ -878,292 +879,1052 @@ private QuorumType(int value) { // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.InstanceConfig.QuorumType) } - public static final int NAME_FIELD_NUMBER = 1; + public interface AllowedProcessingUnitsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) + com.google.protobuf.MessageOrBuilder { - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; + /** + * + * + *
    +     * The minimum value of processing units applicable to this interval,
    +     * inclusive.
    +     * 
    + * + * int32 min_processing_units = 1; + * + * @return The minProcessingUnits. + */ + int getMinProcessingUnits(); - /** - * - * - *
    -   * A unique identifier for the instance configuration.  Values
    -   * are of the form
    -   * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    -   *
    -   * User instance configuration must start with `custom-`.
    -   * 
    - * - * string name = 1; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } + /** + * + * + *
    +     * The maximum value of processing units applicable to this interval,
    +     * inclusive. If unset, there is no predefined limit to the supported
    +     * number of processing units, although project quota limits still apply.
    +     * 
    + * + * int32 max_processing_units = 2; + * + * @return The maxProcessingUnits. + */ + int getMaxProcessingUnits(); + + /** + * + * + *
    +     * Allowed increments of processing units between “min” and “max”.
    +     * 
    + * + * int32 processing_unit_increment = 3; + * + * @return The processingUnitIncrement. + */ + int getProcessingUnitIncrement(); } /** * * *
    -   * A unique identifier for the instance configuration.  Values
    -   * are of the form
    -   * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    -   *
    -   * User instance configuration must start with `custom-`.
    +   * Defines a range of processing units supported by an instance configuration.
        * 
    * - * string name = 1; - * - * @return The bytes for name. + * Protobuf type {@code google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits} */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public static final class AllowedProcessingUnits extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) + AllowedProcessingUnitsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 6, + /* suffix= */ "", + "AllowedProcessingUnits"); } - } - public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + // Use AllowedProcessingUnits.newBuilder() to construct. + private AllowedProcessingUnits(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } - @SuppressWarnings("serial") - private volatile java.lang.Object displayName_ = ""; + private AllowedProcessingUnits() {} - /** - * - * - *
    -   * The name of this instance configuration as it appears in UIs.
    -   * 
    - * - * string display_name = 2; - * - * @return The displayName. - */ - @java.lang.Override - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor; } - } - /** - * - * - *
    -   * The name of this instance configuration as it appears in UIs.
    -   * 
    - * - * string display_name = 2; - * - * @return The bytes for displayName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.class, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + .class); } - } - public static final int CONFIG_TYPE_FIELD_NUMBER = 5; - private int configType_ = 0; + public static final int MIN_PROCESSING_UNITS_FIELD_NUMBER = 1; + private int minProcessingUnits_ = 0; - /** - * - * - *
    -   * Output only. Whether this instance configuration is a Google-managed or
    -   * user-managed configuration.
    -   * 
    - * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for configType. - */ - @java.lang.Override - public int getConfigTypeValue() { - return configType_; - } + /** + * + * + *
    +     * The minimum value of processing units applicable to this interval,
    +     * inclusive.
    +     * 
    + * + * int32 min_processing_units = 1; + * + * @return The minProcessingUnits. + */ + @java.lang.Override + public int getMinProcessingUnits() { + return minProcessingUnits_; + } - /** - * - * - *
    -   * Output only. Whether this instance configuration is a Google-managed or
    -   * user-managed configuration.
    -   * 
    - * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The configType. - */ - @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.Type getConfigType() { - com.google.spanner.admin.instance.v1.InstanceConfig.Type result = - com.google.spanner.admin.instance.v1.InstanceConfig.Type.forNumber(configType_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.Type.UNRECOGNIZED - : result; - } + public static final int MAX_PROCESSING_UNITS_FIELD_NUMBER = 2; + private int maxProcessingUnits_ = 0; - public static final int REPLICAS_FIELD_NUMBER = 3; + /** + * + * + *
    +     * The maximum value of processing units applicable to this interval,
    +     * inclusive. If unset, there is no predefined limit to the supported
    +     * number of processing units, although project quota limits still apply.
    +     * 
    + * + * int32 max_processing_units = 2; + * + * @return The maxProcessingUnits. + */ + @java.lang.Override + public int getMaxProcessingUnits() { + return maxProcessingUnits_; + } - @SuppressWarnings("serial") - private java.util.List replicas_; + public static final int PROCESSING_UNIT_INCREMENT_FIELD_NUMBER = 3; + private int processingUnitIncrement_ = 0; - /** - * - * - *
    -   * The geographic placement of nodes in this instance configuration and their
    -   * replication properties.
    -   *
    -   * To create user-managed configurations, input
    -   * `replicas` must include all replicas in `replicas` of the `base_config`
    -   * and include one or more replicas in the `optional_replicas` of the
    -   * `base_config`.
    -   * 
    - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; - */ - @java.lang.Override - public java.util.List getReplicasList() { - return replicas_; - } + /** + * + * + *
    +     * Allowed increments of processing units between “min” and “max”.
    +     * 
    + * + * int32 processing_unit_increment = 3; + * + * @return The processingUnitIncrement. + */ + @java.lang.Override + public int getProcessingUnitIncrement() { + return processingUnitIncrement_; + } - /** - * - * - *
    -   * The geographic placement of nodes in this instance configuration and their
    -   * replication properties.
    -   *
    -   * To create user-managed configurations, input
    -   * `replicas` must include all replicas in `replicas` of the `base_config`
    -   * and include one or more replicas in the `optional_replicas` of the
    -   * `base_config`.
    -   * 
    - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; - */ - @java.lang.Override - public java.util.List - getReplicasOrBuilderList() { - return replicas_; - } + private byte memoizedIsInitialized = -1; - /** - * - * - *
    -   * The geographic placement of nodes in this instance configuration and their
    -   * replication properties.
    -   *
    -   * To create user-managed configurations, input
    -   * `replicas` must include all replicas in `replicas` of the `base_config`
    -   * and include one or more replicas in the `optional_replicas` of the
    -   * `base_config`.
    -   * 
    - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; - */ - @java.lang.Override - public int getReplicasCount() { - return replicas_.size(); + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minProcessingUnits_ != 0) { + output.writeInt32(1, minProcessingUnits_); + } + if (maxProcessingUnits_ != 0) { + output.writeInt32(2, maxProcessingUnits_); + } + if (processingUnitIncrement_ != 0) { + output.writeInt32(3, processingUnitIncrement_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minProcessingUnits_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, minProcessingUnits_); + } + if (maxProcessingUnits_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxProcessingUnits_); + } + if (processingUnitIncrement_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, processingUnitIncrement_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits)) { + return super.equals(obj); + } + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits other = + (com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) obj; + + if (getMinProcessingUnits() != other.getMinProcessingUnits()) return false; + if (getMaxProcessingUnits() != other.getMaxProcessingUnits()) return false; + if (getProcessingUnitIncrement() != other.getProcessingUnitIncrement()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_PROCESSING_UNITS_FIELD_NUMBER; + hash = (53 * hash) + getMinProcessingUnits(); + hash = (37 * hash) + MAX_PROCESSING_UNITS_FIELD_NUMBER; + hash = (53 * hash) + getMaxProcessingUnits(); + hash = (37 * hash) + PROCESSING_UNIT_INCREMENT_FIELD_NUMBER; + hash = (53 * hash) + getProcessingUnitIncrement(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
    +     * Defines a range of processing units supported by an instance configuration.
    +     * 
    + * + * Protobuf type {@code google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.class, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + .class); + } + + // Construct using + // com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minProcessingUnits_ = 0; + maxProcessingUnits_ = 0; + processingUnitIncrement_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getDefaultInstanceForType() { + return com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits build() { + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + buildPartial() { + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits result = + new com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minProcessingUnits_ = minProcessingUnits_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxProcessingUnits_ = maxProcessingUnits_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.processingUnitIncrement_ = processingUnitIncrement_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) { + return mergeFrom( + (com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits other) { + if (other + == com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + .getDefaultInstance()) return this; + if (other.getMinProcessingUnits() != 0) { + setMinProcessingUnits(other.getMinProcessingUnits()); + } + if (other.getMaxProcessingUnits() != 0) { + setMaxProcessingUnits(other.getMaxProcessingUnits()); + } + if (other.getProcessingUnitIncrement() != 0) { + setProcessingUnitIncrement(other.getProcessingUnitIncrement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + minProcessingUnits_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxProcessingUnits_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + processingUnitIncrement_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int minProcessingUnits_; + + /** + * + * + *
    +       * The minimum value of processing units applicable to this interval,
    +       * inclusive.
    +       * 
    + * + * int32 min_processing_units = 1; + * + * @return The minProcessingUnits. + */ + @java.lang.Override + public int getMinProcessingUnits() { + return minProcessingUnits_; + } + + /** + * + * + *
    +       * The minimum value of processing units applicable to this interval,
    +       * inclusive.
    +       * 
    + * + * int32 min_processing_units = 1; + * + * @param value The minProcessingUnits to set. + * @return This builder for chaining. + */ + public Builder setMinProcessingUnits(int value) { + + minProcessingUnits_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
    +       * The minimum value of processing units applicable to this interval,
    +       * inclusive.
    +       * 
    + * + * int32 min_processing_units = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinProcessingUnits() { + bitField0_ = (bitField0_ & ~0x00000001); + minProcessingUnits_ = 0; + onChanged(); + return this; + } + + private int maxProcessingUnits_; + + /** + * + * + *
    +       * The maximum value of processing units applicable to this interval,
    +       * inclusive. If unset, there is no predefined limit to the supported
    +       * number of processing units, although project quota limits still apply.
    +       * 
    + * + * int32 max_processing_units = 2; + * + * @return The maxProcessingUnits. + */ + @java.lang.Override + public int getMaxProcessingUnits() { + return maxProcessingUnits_; + } + + /** + * + * + *
    +       * The maximum value of processing units applicable to this interval,
    +       * inclusive. If unset, there is no predefined limit to the supported
    +       * number of processing units, although project quota limits still apply.
    +       * 
    + * + * int32 max_processing_units = 2; + * + * @param value The maxProcessingUnits to set. + * @return This builder for chaining. + */ + public Builder setMaxProcessingUnits(int value) { + + maxProcessingUnits_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
    +       * The maximum value of processing units applicable to this interval,
    +       * inclusive. If unset, there is no predefined limit to the supported
    +       * number of processing units, although project quota limits still apply.
    +       * 
    + * + * int32 max_processing_units = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxProcessingUnits() { + bitField0_ = (bitField0_ & ~0x00000002); + maxProcessingUnits_ = 0; + onChanged(); + return this; + } + + private int processingUnitIncrement_; + + /** + * + * + *
    +       * Allowed increments of processing units between “min” and “max”.
    +       * 
    + * + * int32 processing_unit_increment = 3; + * + * @return The processingUnitIncrement. + */ + @java.lang.Override + public int getProcessingUnitIncrement() { + return processingUnitIncrement_; + } + + /** + * + * + *
    +       * Allowed increments of processing units between “min” and “max”.
    +       * 
    + * + * int32 processing_unit_increment = 3; + * + * @param value The processingUnitIncrement to set. + * @return This builder for chaining. + */ + public Builder setProcessingUnitIncrement(int value) { + + processingUnitIncrement_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
    +       * Allowed increments of processing units between “min” and “max”.
    +       * 
    + * + * int32 processing_unit_increment = 3; + * + * @return This builder for chaining. + */ + public Builder clearProcessingUnitIncrement() { + bitField0_ = (bitField0_ & ~0x00000004); + processingUnitIncrement_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits) + private static final com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits(); + } + + public static com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllowedProcessingUnits parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
    -   * The geographic placement of nodes in this instance configuration and their
    -   * replication properties.
    +   * A unique identifier for the instance configuration.  Values
    +   * are of the form
    +   * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
        *
    -   * To create user-managed configurations, input
    -   * `replicas` must include all replicas in `replicas` of the `base_config`
    -   * and include one or more replicas in the `optional_replicas` of the
    -   * `base_config`.
    +   * User instance configuration must start with `custom-`.
        * 
    * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * string name = 1; + * + * @return The name. */ @java.lang.Override - public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { - return replicas_.get(index); + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } } /** * * *
    -   * The geographic placement of nodes in this instance configuration and their
    -   * replication properties.
    +   * A unique identifier for the instance configuration.  Values
    +   * are of the form
    +   * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
        *
    -   * To create user-managed configurations, input
    -   * `replicas` must include all replicas in `replicas` of the `base_config`
    -   * and include one or more replicas in the `optional_replicas` of the
    -   * `base_config`.
    +   * User instance configuration must start with `custom-`.
        * 
    * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * string name = 1; + * + * @return The bytes for name. */ @java.lang.Override - public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBuilder(int index) { - return replicas_.get(index); + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int OPTIONAL_REPLICAS_FIELD_NUMBER = 6; + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; @SuppressWarnings("serial") - private java.util.List optionalReplicas_; + private volatile java.lang.Object displayName_ = ""; /** * * *
    -   * Output only. The available optional replicas to choose from for
    -   * user-managed configurations. Populated for Google-managed configurations.
    +   * The name of this instance configuration as it appears in UIs.
        * 
    * - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * string display_name = 2; + * + * @return The displayName. */ @java.lang.Override - public java.util.List - getOptionalReplicasList() { - return optionalReplicas_; + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
    +   * The name of this instance configuration as it appears in UIs.
    +   * 
    + * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_TYPE_FIELD_NUMBER = 5; + private int configType_ = 0; + + /** + * + * + *
    +   * Output only. Whether this instance configuration is a Google-managed or
    +   * user-managed configuration.
    +   * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for configType. + */ + @java.lang.Override + public int getConfigTypeValue() { + return configType_; + } + + /** + * + * + *
    +   * Output only. Whether this instance configuration is a Google-managed or
    +   * user-managed configuration.
    +   * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The configType. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.Type getConfigType() { + com.google.spanner.admin.instance.v1.InstanceConfig.Type result = + com.google.spanner.admin.instance.v1.InstanceConfig.Type.forNumber(configType_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.Type.UNRECOGNIZED + : result; + } + + public static final int REPLICAS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List replicas_; + + /** + * + * + *
    +   * The geographic placement of nodes in this instance configuration and their
    +   * replication properties.
    +   *
    +   * To create user-managed configurations, input
    +   * `replicas` must include all replicas in `replicas` of the `base_config`
    +   * and include one or more replicas in the `optional_replicas` of the
    +   * `base_config`.
    +   * 
    + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + @java.lang.Override + public java.util.List getReplicasList() { + return replicas_; + } + + /** + * + * + *
    +   * The geographic placement of nodes in this instance configuration and their
    +   * replication properties.
    +   *
    +   * To create user-managed configurations, input
    +   * `replicas` must include all replicas in `replicas` of the `base_config`
    +   * and include one or more replicas in the `optional_replicas` of the
    +   * `base_config`.
    +   * 
    + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + @java.lang.Override + public java.util.List + getReplicasOrBuilderList() { + return replicas_; + } + + /** + * + * + *
    +   * The geographic placement of nodes in this instance configuration and their
    +   * replication properties.
    +   *
    +   * To create user-managed configurations, input
    +   * `replicas` must include all replicas in `replicas` of the `base_config`
    +   * and include one or more replicas in the `optional_replicas` of the
    +   * `base_config`.
    +   * 
    + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + @java.lang.Override + public int getReplicasCount() { + return replicas_.size(); + } + + /** + * + * + *
    +   * The geographic placement of nodes in this instance configuration and their
    +   * replication properties.
    +   *
    +   * To create user-managed configurations, input
    +   * `replicas` must include all replicas in `replicas` of the `base_config`
    +   * and include one or more replicas in the `optional_replicas` of the
    +   * `base_config`.
    +   * 
    + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { + return replicas_.get(index); + } + + /** + * + * + *
    +   * The geographic placement of nodes in this instance configuration and their
    +   * replication properties.
    +   *
    +   * To create user-managed configurations, input
    +   * `replicas` must include all replicas in `replicas` of the `base_config`
    +   * and include one or more replicas in the `optional_replicas` of the
    +   * `base_config`.
    +   * 
    + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBuilder(int index) { + return replicas_.get(index); + } + + public static final int OPTIONAL_REPLICAS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List optionalReplicas_; + + /** + * + * + *
    +   * Output only. The available optional replicas to choose from for
    +   * user-managed configurations. Populated for Google-managed configurations.
    +   * 
    + * + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getOptionalReplicasList() { + return optionalReplicas_; } /** @@ -1740,83 +2501,225 @@ public int getFreeInstanceAvailabilityValue() { : result; } - public static final int QUORUM_TYPE_FIELD_NUMBER = 18; - private int quorumType_ = 0; + public static final int ALLOWED_PROCESSING_UNITS_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private java.util.List + allowedProcessingUnits_; /** * * *
    -   * Output only. The `QuorumType` of the instance configuration.
    +   * Output only. Defines the ranges of allowed processing units supported by
    +   * this instance configuration. If multiple ranges are specified, an instance
    +   * using this configuration may use a valid increment in any of the given
    +   * ranges. For example, an allowed_processing_units specification of
    +   * `[{min_processing_units:100, max_processing_units:900,
    +   * processing_unit_increment:100}, {min_processing_units:1000,
    +   * processing_unit_increment:1000}]` specifies that the instance configuration
    +   * supports instances with quantities of processing units in multiples of 100
    +   * processing units (100, 200, 300 and so on) up to and including 900
    +   * processing units and quantities that are at least 1000 processing units and
    +   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
        * 
    * * - * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The enum numeric value on the wire for quorumType. */ @java.lang.Override - public int getQuorumTypeValue() { - return quorumType_; + public java.util.List + getAllowedProcessingUnitsList() { + return allowedProcessingUnits_; } /** * * *
    -   * Output only. The `QuorumType` of the instance configuration.
    +   * Output only. Defines the ranges of allowed processing units supported by
    +   * this instance configuration. If multiple ranges are specified, an instance
    +   * using this configuration may use a valid increment in any of the given
    +   * ranges. For example, an allowed_processing_units specification of
    +   * `[{min_processing_units:100, max_processing_units:900,
    +   * processing_unit_increment:100}, {min_processing_units:1000,
    +   * processing_unit_increment:1000}]` specifies that the instance configuration
    +   * supports instances with quantities of processing units in multiples of 100
    +   * processing units (100, 200, 300 and so on) up to and including 900
    +   * processing units and quantities that are at least 1000 processing units and
    +   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
        * 
    * * - * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The quorumType. */ @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType getQuorumType() { - com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType result = - com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.forNumber(quorumType_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.UNRECOGNIZED - : result; + public java.util.List< + ? extends + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder> + getAllowedProcessingUnitsOrBuilderList() { + return allowedProcessingUnits_; } - public static final int STORAGE_LIMIT_PER_PROCESSING_UNIT_FIELD_NUMBER = 19; - private long storageLimitPerProcessingUnit_ = 0L; - /** * * *
    -   * Output only. The storage limit in bytes per processing unit.
    +   * Output only. Defines the ranges of allowed processing units supported by
    +   * this instance configuration. If multiple ranges are specified, an instance
    +   * using this configuration may use a valid increment in any of the given
    +   * ranges. For example, an allowed_processing_units specification of
    +   * `[{min_processing_units:100, max_processing_units:900,
    +   * processing_unit_increment:100}, {min_processing_units:1000,
    +   * processing_unit_increment:1000}]` specifies that the instance configuration
    +   * supports instances with quantities of processing units in multiples of 100
    +   * processing units (100, 200, 300 and so on) up to and including 900
    +   * processing units and quantities that are at least 1000 processing units and
    +   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
        * 
    * * - * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The storageLimitPerProcessingUnit. */ @java.lang.Override - public long getStorageLimitPerProcessingUnit() { - return storageLimitPerProcessingUnit_; + public int getAllowedProcessingUnitsCount() { + return allowedProcessingUnits_.size(); } - private byte memoizedIsInitialized = -1; - + /** + * + * + *
    +   * Output only. Defines the ranges of allowed processing units supported by
    +   * this instance configuration. If multiple ranges are specified, an instance
    +   * using this configuration may use a valid increment in any of the given
    +   * ranges. For example, an allowed_processing_units specification of
    +   * `[{min_processing_units:100, max_processing_units:900,
    +   * processing_unit_increment:100}, {min_processing_units:1000,
    +   * processing_unit_increment:1000}]` specifies that the instance configuration
    +   * supports instances with quantities of processing units in multiples of 100
    +   * processing units (100, 200, 300 and so on) up to and including 900
    +   * processing units and quantities that are at least 1000 processing units and
    +   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
    +   * 
    + * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getAllowedProcessingUnits(int index) { + return allowedProcessingUnits_.get(index); } - @java.lang.Override + /** + * + * + *
    +   * Output only. Defines the ranges of allowed processing units supported by
    +   * this instance configuration. If multiple ranges are specified, an instance
    +   * using this configuration may use a valid increment in any of the given
    +   * ranges. For example, an allowed_processing_units specification of
    +   * `[{min_processing_units:100, max_processing_units:900,
    +   * processing_unit_increment:100}, {min_processing_units:1000,
    +   * processing_unit_increment:1000}]` specifies that the instance configuration
    +   * supports instances with quantities of processing units in multiples of 100
    +   * processing units (100, 200, 300 and so on) up to and including 900
    +   * processing units and quantities that are at least 1000 processing units and
    +   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
    +   * 
    + * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder + getAllowedProcessingUnitsOrBuilder(int index) { + return allowedProcessingUnits_.get(index); + } + + public static final int QUORUM_TYPE_FIELD_NUMBER = 18; + private int quorumType_ = 0; + + /** + * + * + *
    +   * Output only. The `QuorumType` of the instance configuration.
    +   * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for quorumType. + */ + @java.lang.Override + public int getQuorumTypeValue() { + return quorumType_; + } + + /** + * + * + *
    +   * Output only. The `QuorumType` of the instance configuration.
    +   * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The quorumType. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType getQuorumType() { + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType result = + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.forNumber(quorumType_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.UNRECOGNIZED + : result; + } + + public static final int STORAGE_LIMIT_PER_PROCESSING_UNIT_FIELD_NUMBER = 19; + private long storageLimitPerProcessingUnit_ = 0L; + + /** + * + * + *
    +   * Output only. The storage limit in bytes per processing unit.
    +   * 
    + * + * + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The storageLimitPerProcessingUnit. + */ + @java.lang.Override + public long getStorageLimitPerProcessingUnit() { + return storageLimitPerProcessingUnit_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); @@ -1859,6 +2762,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(12, freeInstanceAvailability_); } + for (int i = 0; i < allowedProcessingUnits_.size(); i++) { + output.writeMessage(13, allowedProcessingUnits_.get(i)); + } if (quorumType_ != com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.QUORUM_TYPE_UNSPECIFIED .getNumber()) { @@ -1930,6 +2836,11 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, freeInstanceAvailability_); } + for (int i = 0; i < allowedProcessingUnits_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, allowedProcessingUnits_.get(i)); + } if (quorumType_ != com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.QUORUM_TYPE_UNSPECIFIED .getNumber()) { @@ -1968,6 +2879,8 @@ public boolean equals(final java.lang.Object obj) { if (getReconciling() != other.getReconciling()) return false; if (state_ != other.state_) return false; if (freeInstanceAvailability_ != other.freeInstanceAvailability_) return false; + if (!getAllowedProcessingUnitsList().equals(other.getAllowedProcessingUnitsList())) + return false; if (quorumType_ != other.quorumType_) return false; if (getStorageLimitPerProcessingUnit() != other.getStorageLimitPerProcessingUnit()) return false; @@ -2014,6 +2927,10 @@ public int hashCode() { hash = (53 * hash) + state_; hash = (37 * hash) + FREE_INSTANCE_AVAILABILITY_FIELD_NUMBER; hash = (53 * hash) + freeInstanceAvailability_; + if (getAllowedProcessingUnitsCount() > 0) { + hash = (37 * hash) + ALLOWED_PROCESSING_UNITS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedProcessingUnitsList().hashCode(); + } hash = (37 * hash) + QUORUM_TYPE_FIELD_NUMBER; hash = (53 * hash) + quorumType_; hash = (37 * hash) + STORAGE_LIMIT_PER_PROCESSING_UNIT_FIELD_NUMBER; @@ -2205,6 +3122,13 @@ public Builder clear() { reconciling_ = false; state_ = 0; freeInstanceAvailability_ = 0; + if (allowedProcessingUnitsBuilder_ == null) { + allowedProcessingUnits_ = java.util.Collections.emptyList(); + } else { + allowedProcessingUnits_ = null; + allowedProcessingUnitsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); quorumType_ = 0; storageLimitPerProcessingUnit_ = 0L; return this; @@ -2262,6 +3186,15 @@ private void buildPartialRepeatedFields( } else { result.optionalReplicas_ = optionalReplicasBuilder_.build(); } + if (allowedProcessingUnitsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + allowedProcessingUnits_ = java.util.Collections.unmodifiableList(allowedProcessingUnits_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.allowedProcessingUnits_ = allowedProcessingUnits_; + } else { + result.allowedProcessingUnits_ = allowedProcessingUnitsBuilder_.build(); + } } private void buildPartial0(com.google.spanner.admin.instance.v1.InstanceConfig result) { @@ -2298,10 +3231,10 @@ private void buildPartial0(com.google.spanner.admin.instance.v1.InstanceConfig r if (((from_bitField0_ & 0x00000800) != 0)) { result.freeInstanceAvailability_ = freeInstanceAvailability_; } - if (((from_bitField0_ & 0x00001000) != 0)) { + if (((from_bitField0_ & 0x00002000) != 0)) { result.quorumType_ = quorumType_; } - if (((from_bitField0_ & 0x00002000) != 0)) { + if (((from_bitField0_ & 0x00004000) != 0)) { result.storageLimitPerProcessingUnit_ = storageLimitPerProcessingUnit_; } } @@ -2417,6 +3350,33 @@ public Builder mergeFrom(com.google.spanner.admin.instance.v1.InstanceConfig oth if (other.freeInstanceAvailability_ != 0) { setFreeInstanceAvailabilityValue(other.getFreeInstanceAvailabilityValue()); } + if (allowedProcessingUnitsBuilder_ == null) { + if (!other.allowedProcessingUnits_.isEmpty()) { + if (allowedProcessingUnits_.isEmpty()) { + allowedProcessingUnits_ = other.allowedProcessingUnits_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.addAll(other.allowedProcessingUnits_); + } + onChanged(); + } + } else { + if (!other.allowedProcessingUnits_.isEmpty()) { + if (allowedProcessingUnitsBuilder_.isEmpty()) { + allowedProcessingUnitsBuilder_.dispose(); + allowedProcessingUnitsBuilder_ = null; + allowedProcessingUnits_ = other.allowedProcessingUnits_; + bitField0_ = (bitField0_ & ~0x00001000); + allowedProcessingUnitsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAllowedProcessingUnitsFieldBuilder() + : null; + } else { + allowedProcessingUnitsBuilder_.addAllMessages(other.allowedProcessingUnits_); + } + } + } if (other.quorumType_ != 0) { setQuorumTypeValue(other.getQuorumTypeValue()); } @@ -2544,16 +3504,31 @@ public Builder mergeFrom( bitField0_ |= 0x00000800; break; } // case 96 + case 106: + { + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits m = + input.readMessage( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + .parser(), + extensionRegistry); + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.add(m); + } else { + allowedProcessingUnitsBuilder_.addMessage(m); + } + break; + } // case 106 case 144: { quorumType_ = input.readEnum(); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; break; } // case 144 case 152: { storageLimitPerProcessingUnit_ = input.readInt64(); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; break; } // case 152 default: @@ -2573,161 +3548,445 @@ public Builder mergeFrom( return this; } - private int bitField0_; - - private java.lang.Object name_ = ""; - + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
    +     * A unique identifier for the instance configuration.  Values
    +     * are of the form
    +     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     *
    +     * User instance configuration must start with `custom-`.
    +     * 
    + * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
    +     * A unique identifier for the instance configuration.  Values
    +     * are of the form
    +     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     *
    +     * User instance configuration must start with `custom-`.
    +     * 
    + * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
    +     * A unique identifier for the instance configuration.  Values
    +     * are of the form
    +     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     *
    +     * User instance configuration must start with `custom-`.
    +     * 
    + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
    +     * A unique identifier for the instance configuration.  Values
    +     * are of the form
    +     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     *
    +     * User instance configuration must start with `custom-`.
    +     * 
    + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
    +     * A unique identifier for the instance configuration.  Values
    +     * are of the form
    +     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     *
    +     * User instance configuration must start with `custom-`.
    +     * 
    + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
    +     * The name of this instance configuration as it appears in UIs.
    +     * 
    + * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
    +     * The name of this instance configuration as it appears in UIs.
    +     * 
    + * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
    +     * The name of this instance configuration as it appears in UIs.
    +     * 
    + * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
    +     * The name of this instance configuration as it appears in UIs.
    +     * 
    + * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
    +     * The name of this instance configuration as it appears in UIs.
    +     * 
    + * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int configType_ = 0; + + /** + * + * + *
    +     * Output only. Whether this instance configuration is a Google-managed or
    +     * user-managed configuration.
    +     * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for configType. + */ + @java.lang.Override + public int getConfigTypeValue() { + return configType_; + } + + /** + * + * + *
    +     * Output only. Whether this instance configuration is a Google-managed or
    +     * user-managed configuration.
    +     * 
    + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for configType to set. + * @return This builder for chaining. + */ + public Builder setConfigTypeValue(int value) { + configType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** * * *
    -     * A unique identifier for the instance configuration.  Values
    -     * are of the form
    -     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    -     *
    -     * User instance configuration must start with `custom-`.
    +     * Output only. Whether this instance configuration is a Google-managed or
    +     * user-managed configuration.
          * 
    * - * string name = 1; + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The name. + * @return The configType. */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.Type getConfigType() { + com.google.spanner.admin.instance.v1.InstanceConfig.Type result = + com.google.spanner.admin.instance.v1.InstanceConfig.Type.forNumber(configType_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.Type.UNRECOGNIZED + : result; } /** * * *
    -     * A unique identifier for the instance configuration.  Values
    -     * are of the form
    -     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    -     *
    -     * User instance configuration must start with `custom-`.
    +     * Output only. Whether this instance configuration is a Google-managed or
    +     * user-managed configuration.
          * 
    * - * string name = 1; + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The bytes for name. + * @param value The configType to set. + * @return This builder for chaining. */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public Builder setConfigType(com.google.spanner.admin.instance.v1.InstanceConfig.Type value) { + if (value == null) { + throw new NullPointerException(); } + bitField0_ |= 0x00000004; + configType_ = value.getNumber(); + onChanged(); + return this; } /** * * *
    -     * A unique identifier for the instance configuration.  Values
    -     * are of the form
    -     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    -     *
    -     * User instance configuration must start with `custom-`.
    +     * Output only. Whether this instance configuration is a Google-managed or
    +     * user-managed configuration.
          * 
    * - * string name = 1; + * + * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The name to set. * @return This builder for chaining. */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000001; + public Builder clearConfigType() { + bitField0_ = (bitField0_ & ~0x00000004); + configType_ = 0; onChanged(); return this; } + private java.util.List replicas_ = + java.util.Collections.emptyList(); + + private void ensureReplicasIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + replicas_ = + new java.util.ArrayList(replicas_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> + replicasBuilder_; + /** * * *
    -     * A unique identifier for the instance configuration.  Values
    -     * are of the form
    -     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     * The geographic placement of nodes in this instance configuration and their
    +     * replication properties.
          *
    -     * User instance configuration must start with `custom-`.
    +     * To create user-managed configurations, input
    +     * `replicas` must include all replicas in `replicas` of the `base_config`
    +     * and include one or more replicas in the `optional_replicas` of the
    +     * `base_config`.
          * 
    * - * string name = 1; - * - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + public java.util.List getReplicasList() { + if (replicasBuilder_ == null) { + return java.util.Collections.unmodifiableList(replicas_); + } else { + return replicasBuilder_.getMessageList(); + } } /** * * *
    -     * A unique identifier for the instance configuration.  Values
    -     * are of the form
    -     * `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
    +     * The geographic placement of nodes in this instance configuration and their
    +     * replication properties.
          *
    -     * User instance configuration must start with `custom-`.
    +     * To create user-managed configurations, input
    +     * `replicas` must include all replicas in `replicas` of the `base_config`
    +     * and include one or more replicas in the `optional_replicas` of the
    +     * `base_config`.
          * 
    * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public int getReplicasCount() { + if (replicasBuilder_ == null) { + return replicas_.size(); + } else { + return replicasBuilder_.getCount(); } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; } - private java.lang.Object displayName_ = ""; - /** * * *
    -     * The name of this instance configuration as it appears in UIs.
    -     * 
    + * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * string display_name = 2; + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + *
    * - * @return The displayName. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; + public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { + if (replicasBuilder_ == null) { + return replicas_.get(index); } else { - return (java.lang.String) ref; + return replicasBuilder_.getMessage(index); } } @@ -2735,44 +3994,55 @@ public java.lang.String getDisplayName() { * * *
    -     * The name of this instance configuration as it appears in UIs.
    -     * 
    + * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * string display_name = 2; + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + *
    * - * @return The bytes for displayName. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; + public Builder setReplicas(int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.set(index, value); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + replicasBuilder_.setMessage(index, value); } + return this; } /** * * *
    -     * The name of this instance configuration as it appears in UIs.
    -     * 
    + * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * string display_name = 2; + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + *
    * - * @param value The displayName to set. - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setDisplayName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.set(index, builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.setMessage(index, builderForValue.build()); } - displayName_ = value; - bitField0_ |= 0x00000002; - onChanged(); return this; } @@ -2780,17 +4050,28 @@ public Builder setDisplayName(java.lang.String value) { * * *
    -     * The name of this instance configuration as it appears in UIs.
    -     * 
    + * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * string display_name = 2; + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + *
* - * @return This builder for chaining. - */ - public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + */ + public Builder addReplicas(com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.add(value); + onChanged(); + } else { + replicasBuilder_.addMessage(value); + } return this; } @@ -2798,65 +4079,82 @@ public Builder clearDisplayName() { * * *
-     * The name of this instance configuration as it appears in UIs.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * string display_name = 2; + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @param value The bytes for displayName to set. - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder addReplicas(int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.add(index, value); + onChanged(); + } else { + replicasBuilder_.addMessage(index, value); } - checkByteStringIsUtf8(value); - displayName_ = value; - bitField0_ |= 0x00000002; - onChanged(); return this; } - private int configType_ = 0; - /** * * *
-     * Output only. Whether this instance configuration is a Google-managed or
-     * user-managed configuration.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @return The enum numeric value on the wire for configType. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - @java.lang.Override - public int getConfigTypeValue() { - return configType_; + public Builder addReplicas( + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.add(builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.addMessage(builderForValue.build()); + } + return this; } /** * * *
-     * Output only. Whether this instance configuration is a Google-managed or
-     * user-managed configuration.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @param value The enum numeric value on the wire for configType to set. - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setConfigTypeValue(int value) { - configType_ = value; - bitField0_ |= 0x00000004; - onChanged(); + public Builder addReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.add(index, builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.addMessage(index, builderForValue.build()); + } return this; } @@ -2864,47 +4162,52 @@ public Builder setConfigTypeValue(int value) { * * *
-     * Output only. Whether this instance configuration is a Google-managed or
-     * user-managed configuration.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @return The configType. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.Type getConfigType() { - com.google.spanner.admin.instance.v1.InstanceConfig.Type result = - com.google.spanner.admin.instance.v1.InstanceConfig.Type.forNumber(configType_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.Type.UNRECOGNIZED - : result; + public Builder addAllReplicas( + java.lang.Iterable values) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replicas_); + onChanged(); + } else { + replicasBuilder_.addAllMessages(values); + } + return this; } /** * * *
-     * Output only. Whether this instance configuration is a Google-managed or
-     * user-managed configuration.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @param value The configType to set. - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setConfigType(com.google.spanner.admin.instance.v1.InstanceConfig.Type value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearReplicas() { + if (replicasBuilder_ == null) { + replicas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + replicasBuilder_.clear(); } - bitField0_ |= 0x00000004; - configType_ = value.getNumber(); - onChanged(); return this; } @@ -2912,40 +4215,28 @@ public Builder setConfigType(com.google.spanner.admin.instance.v1.InstanceConfig * * *
-     * Output only. Whether this instance configuration is a Google-managed or
-     * user-managed configuration.
-     * 
+ * The geographic placement of nodes in this instance configuration and their + * replication properties. * - * - * .google.spanner.admin.instance.v1.InstanceConfig.Type config_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * To create user-managed configurations, input + * `replicas` must include all replicas in `replicas` of the `base_config` + * and include one or more replicas in the `optional_replicas` of the + * `base_config`. + * * - * @return This builder for chaining. + * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder clearConfigType() { - bitField0_ = (bitField0_ & ~0x00000004); - configType_ = 0; - onChanged(); - return this; - } - - private java.util.List replicas_ = - java.util.Collections.emptyList(); - - private void ensureReplicasIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - replicas_ = - new java.util.ArrayList(replicas_); - bitField0_ |= 0x00000008; + public Builder removeReplicas(int index) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.remove(index); + onChanged(); + } else { + replicasBuilder_.remove(index); } + return this; } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> - replicasBuilder_; - /** * * @@ -2961,12 +4252,8 @@ private void ensureReplicasIsMutable() { * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public java.util.List getReplicasList() { - if (replicasBuilder_ == null) { - return java.util.Collections.unmodifiableList(replicas_); - } else { - return replicasBuilder_.getMessageList(); - } + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getReplicasBuilder(int index) { + return internalGetReplicasFieldBuilder().getBuilder(index); } /** @@ -2984,11 +4271,12 @@ public java.util.List getRepli * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public int getReplicasCount() { + public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBuilder( + int index) { if (replicasBuilder_ == null) { - return replicas_.size(); + return replicas_.get(index); } else { - return replicasBuilder_.getCount(); + return replicasBuilder_.getMessageOrBuilder(index); } } @@ -3007,11 +4295,12 @@ public int getReplicasCount() { * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { - if (replicasBuilder_ == null) { - return replicas_.get(index); + public java.util.List + getReplicasOrBuilderList() { + if (replicasBuilder_ != null) { + return replicasBuilder_.getMessageOrBuilderList(); } else { - return replicasBuilder_.getMessage(index); + return java.util.Collections.unmodifiableList(replicas_); } } @@ -3030,18 +4319,9 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder setReplicas(int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { - if (replicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReplicasIsMutable(); - replicas_.set(index, value); - onChanged(); - } else { - replicasBuilder_.setMessage(index, value); - } - return this; + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuilder() { + return internalGetReplicasFieldBuilder() + .addBuilder(com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); } /** @@ -3058,17 +4338,10 @@ public Builder setReplicas(int index, com.google.spanner.admin.instance.v1.Repli * * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; - */ - public Builder setReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { - if (replicasBuilder_ == null) { - ensureReplicasIsMutable(); - replicas_.set(index, builderForValue.build()); - onChanged(); - } else { - replicasBuilder_.setMessage(index, builderForValue.build()); - } - return this; + */ + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuilder(int index) { + return internalGetReplicasFieldBuilder() + .addBuilder(index, com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); } /** @@ -3086,99 +4359,130 @@ public Builder setReplicas( * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; */ - public Builder addReplicas(com.google.spanner.admin.instance.v1.ReplicaInfo value) { + public java.util.List + getReplicasBuilderList() { + return internalGetReplicasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> + internalGetReplicasFieldBuilder() { if (replicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReplicasIsMutable(); - replicas_.add(value); - onChanged(); - } else { - replicasBuilder_.addMessage(value); + replicasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder>( + replicas_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + replicas_ = null; } - return this; + return replicasBuilder_; } + private java.util.List optionalReplicas_ = + java.util.Collections.emptyList(); + + private void ensureOptionalReplicasIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + optionalReplicas_ = + new java.util.ArrayList( + optionalReplicas_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> + optionalReplicasBuilder_; + /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addReplicas(int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { - if (replicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReplicasIsMutable(); - replicas_.add(index, value); - onChanged(); + public java.util.List + getOptionalReplicasList() { + if (optionalReplicasBuilder_ == null) { + return java.util.Collections.unmodifiableList(optionalReplicas_); } else { - replicasBuilder_.addMessage(index, value); + return optionalReplicasBuilder_.getMessageList(); } - return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addReplicas( - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { - if (replicasBuilder_ == null) { - ensureReplicasIsMutable(); - replicas_.add(builderForValue.build()); - onChanged(); + public int getOptionalReplicasCount() { + if (optionalReplicasBuilder_ == null) { + return optionalReplicas_.size(); } else { - replicasBuilder_.addMessage(builderForValue.build()); + return optionalReplicasBuilder_.getCount(); } - return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
+     * 
* - * To create user-managed configurations, input - * `replicas` must include all replicas in `replicas` of the `base_config` - * and include one or more replicas in the `optional_replicas` of the - * `base_config`. + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.spanner.admin.instance.v1.ReplicaInfo getOptionalReplicas(int index) { + if (optionalReplicasBuilder_ == null) { + return optionalReplicas_.get(index); + } else { + return optionalReplicasBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { - if (replicasBuilder_ == null) { - ensureReplicasIsMutable(); - replicas_.add(index, builderForValue.build()); + public Builder setOptionalReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (optionalReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOptionalReplicasIsMutable(); + optionalReplicas_.set(index, value); onChanged(); } else { - replicasBuilder_.addMessage(index, builderForValue.build()); + optionalReplicasBuilder_.setMessage(index, value); } return this; } @@ -3187,25 +4491,22 @@ public Builder addReplicas( * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addAllReplicas( - java.lang.Iterable values) { - if (replicasBuilder_ == null) { - ensureReplicasIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replicas_); + public Builder setOptionalReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (optionalReplicasBuilder_ == null) { + ensureOptionalReplicasIsMutable(); + optionalReplicas_.set(index, builderForValue.build()); onChanged(); } else { - replicasBuilder_.addAllMessages(values); + optionalReplicasBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -3214,24 +4515,24 @@ public Builder addAllReplicas( * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearReplicas() { - if (replicasBuilder_ == null) { - replicas_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder addOptionalReplicas(com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (optionalReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOptionalReplicasIsMutable(); + optionalReplicas_.add(value); onChanged(); } else { - replicasBuilder_.clear(); + optionalReplicasBuilder_.addMessage(value); } return this; } @@ -3240,24 +4541,25 @@ public Builder clearReplicas() { * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder removeReplicas(int index) { - if (replicasBuilder_ == null) { - ensureReplicasIsMutable(); - replicas_.remove(index); + public Builder addOptionalReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { + if (optionalReplicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOptionalReplicasIsMutable(); + optionalReplicas_.add(index, value); onChanged(); } else { - replicasBuilder_.remove(index); + optionalReplicasBuilder_.addMessage(index, value); } return this; } @@ -3266,164 +4568,137 @@ public Builder removeReplicas(int index) { * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getReplicasBuilder(int index) { - return internalGetReplicasFieldBuilder().getBuilder(index); + public Builder addOptionalReplicas( + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (optionalReplicasBuilder_ == null) { + ensureOptionalReplicasIsMutable(); + optionalReplicas_.add(builderForValue.build()); + onChanged(); + } else { + optionalReplicasBuilder_.addMessage(builderForValue.build()); + } + return this; } /** * * - *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * 
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBuilder( - int index) { - if (replicasBuilder_ == null) { - return replicas_.get(index); + public Builder addOptionalReplicas( + int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + if (optionalReplicasBuilder_ == null) { + ensureOptionalReplicasIsMutable(); + optionalReplicas_.add(index, builderForValue.build()); + onChanged(); } else { - return replicasBuilder_.getMessageOrBuilder(index); + optionalReplicasBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public java.util.List - getReplicasOrBuilderList() { - if (replicasBuilder_ != null) { - return replicasBuilder_.getMessageOrBuilderList(); + public Builder addAllOptionalReplicas( + java.lang.Iterable values) { + if (optionalReplicasBuilder_ == null) { + ensureOptionalReplicasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, optionalReplicas_); + onChanged(); } else { - return java.util.Collections.unmodifiableList(replicas_); + optionalReplicasBuilder_.addAllMessages(values); } + return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuilder() { - return internalGetReplicasFieldBuilder() - .addBuilder(com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); + public Builder clearOptionalReplicas() { + if (optionalReplicasBuilder_ == null) { + optionalReplicas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + optionalReplicasBuilder_.clear(); + } + return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuilder(int index) { - return internalGetReplicasFieldBuilder() - .addBuilder(index, com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); + public Builder removeOptionalReplicas(int index) { + if (optionalReplicasBuilder_ == null) { + ensureOptionalReplicasIsMutable(); + optionalReplicas_.remove(index); + onChanged(); + } else { + optionalReplicasBuilder_.remove(index); + } + return this; } /** * * *
-     * The geographic placement of nodes in this instance configuration and their
-     * replication properties.
-     *
-     * To create user-managed configurations, input
-     * `replicas` must include all replicas in `replicas` of the `base_config`
-     * and include one or more replicas in the `optional_replicas` of the
-     * `base_config`.
+     * Output only. The available optional replicas to choose from for
+     * user-managed configurations. Populated for Google-managed configurations.
      * 
* - * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; + * + * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public java.util.List - getReplicasBuilderList() { - return internalGetReplicasFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> - internalGetReplicasFieldBuilder() { - if (replicasBuilder_ == null) { - replicasBuilder_ = - new com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder>( - replicas_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); - replicas_ = null; - } - return replicasBuilder_; - } - - private java.util.List optionalReplicas_ = - java.util.Collections.emptyList(); - - private void ensureOptionalReplicasIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - optionalReplicas_ = - new java.util.ArrayList( - optionalReplicas_); - bitField0_ |= 0x00000010; - } + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getOptionalReplicasBuilder( + int index) { + return internalGetOptionalReplicasFieldBuilder().getBuilder(index); } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> - optionalReplicasBuilder_; - /** * * @@ -3436,12 +4711,12 @@ private void ensureOptionalReplicasIsMutable() { * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; *
*/ - public java.util.List - getOptionalReplicasList() { + public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getOptionalReplicasOrBuilder( + int index) { if (optionalReplicasBuilder_ == null) { - return java.util.Collections.unmodifiableList(optionalReplicas_); + return optionalReplicas_.get(index); } else { - return optionalReplicasBuilder_.getMessageList(); + return optionalReplicasBuilder_.getMessageOrBuilder(index); } } @@ -3457,11 +4732,12 @@ private void ensureOptionalReplicasIsMutable() { * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; *
*/ - public int getOptionalReplicasCount() { - if (optionalReplicasBuilder_ == null) { - return optionalReplicas_.size(); + public java.util.List + getOptionalReplicasOrBuilderList() { + if (optionalReplicasBuilder_ != null) { + return optionalReplicasBuilder_.getMessageOrBuilderList(); } else { - return optionalReplicasBuilder_.getCount(); + return java.util.Collections.unmodifiableList(optionalReplicas_); } } @@ -3477,12 +4753,9 @@ public int getOptionalReplicasCount() { * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - public com.google.spanner.admin.instance.v1.ReplicaInfo getOptionalReplicas(int index) { - if (optionalReplicasBuilder_ == null) { - return optionalReplicas_.get(index); - } else { - return optionalReplicasBuilder_.getMessage(index); - } + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalReplicasBuilder() { + return internalGetOptionalReplicasFieldBuilder() + .addBuilder(com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); } /** @@ -3497,19 +4770,10 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getOptionalReplicas(int * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - public Builder setOptionalReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { - if (optionalReplicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptionalReplicasIsMutable(); - optionalReplicas_.set(index, value); - onChanged(); - } else { - optionalReplicasBuilder_.setMessage(index, value); - } - return this; + public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalReplicasBuilder( + int index) { + return internalGetOptionalReplicasFieldBuilder() + .addBuilder(index, com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); } /** @@ -3524,68 +4788,107 @@ public Builder setOptionalReplicas( * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - public Builder setOptionalReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { + public java.util.List + getOptionalReplicasBuilderList() { + return internalGetOptionalReplicasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> + internalGetOptionalReplicasFieldBuilder() { if (optionalReplicasBuilder_ == null) { - ensureOptionalReplicasIsMutable(); - optionalReplicas_.set(index, builderForValue.build()); - onChanged(); + optionalReplicasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.ReplicaInfo, + com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, + com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder>( + optionalReplicas_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + optionalReplicas_ = null; + } + return optionalReplicasBuilder_; + } + + private java.lang.Object baseConfig_ = ""; + + /** + * + * + *
+     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
+     * based on which this configuration is created. Only set for user-managed
+     * configurations. `base_config` must refer to a configuration of type
+     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * 
+ * + * string base_config = 7 [(.google.api.resource_reference) = { ... } + * + * @return The baseConfig. + */ + public java.lang.String getBaseConfig() { + java.lang.Object ref = baseConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseConfig_ = s; + return s; } else { - optionalReplicasBuilder_.setMessage(index, builderForValue.build()); + return (java.lang.String) ref; } - return this; } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
+     * based on which this configuration is created. Only set for user-managed
+     * configurations. `base_config` must refer to a configuration of type
+     * `GOOGLE_MANAGED` in the same project as this configuration.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * string base_config = 7 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for baseConfig. */ - public Builder addOptionalReplicas(com.google.spanner.admin.instance.v1.ReplicaInfo value) { - if (optionalReplicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptionalReplicasIsMutable(); - optionalReplicas_.add(value); - onChanged(); + public com.google.protobuf.ByteString getBaseConfigBytes() { + java.lang.Object ref = baseConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + baseConfig_ = b; + return b; } else { - optionalReplicasBuilder_.addMessage(value); + return (com.google.protobuf.ByteString) ref; } - return this; } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
+     * based on which this configuration is created. Only set for user-managed
+     * configurations. `base_config` must refer to a configuration of type
+     * `GOOGLE_MANAGED` in the same project as this configuration.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * string base_config = 7 [(.google.api.resource_reference) = { ... } + * + * @param value The baseConfig to set. + * @return This builder for chaining. */ - public Builder addOptionalReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo value) { - if (optionalReplicasBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptionalReplicasIsMutable(); - optionalReplicas_.add(index, value); - onChanged(); - } else { - optionalReplicasBuilder_.addMessage(index, value); + public Builder setBaseConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + baseConfig_ = value; + bitField0_ |= 0x00000020; + onChanged(); return this; } @@ -3593,23 +4896,20 @@ public Builder addOptionalReplicas( * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
+     * based on which this configuration is created. Only set for user-managed
+     * configurations. `base_config` must refer to a configuration of type
+     * `GOOGLE_MANAGED` in the same project as this configuration.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * string base_config = 7 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. */ - public Builder addOptionalReplicas( - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { - if (optionalReplicasBuilder_ == null) { - ensureOptionalReplicasIsMutable(); - optionalReplicas_.add(builderForValue.build()); - onChanged(); - } else { - optionalReplicasBuilder_.addMessage(builderForValue.build()); - } + public Builder clearBaseConfig() { + baseConfig_ = getDefaultInstance().getBaseConfig(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); return this; } @@ -3617,249 +4917,369 @@ public Builder addOptionalReplicas( * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
+     * based on which this configuration is created. Only set for user-managed
+     * configurations. `base_config` must refer to a configuration of type
+     * `GOOGLE_MANAGED` in the same project as this configuration.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * string base_config = 7 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for baseConfig to set. + * @return This builder for chaining. */ - public Builder addOptionalReplicas( - int index, com.google.spanner.admin.instance.v1.ReplicaInfo.Builder builderForValue) { - if (optionalReplicasBuilder_ == null) { - ensureOptionalReplicasIsMutable(); - optionalReplicas_.add(index, builderForValue.build()); - onChanged(); - } else { - optionalReplicasBuilder_.addMessage(index, builderForValue.build()); + public Builder setBaseConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } + checkByteStringIsUtf8(value); + baseConfig_ = value; + bitField0_ |= 0x00000020; + onChanged(); return this; } + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. Cloud Labels can be used to filter collections of
+     * resources. They can be used to control how resource metrics are aggregated.
+     * And they can be used as arguments to policy management rules (e.g. route,
+     * firewall, load balancing, etc.).
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform
+     * to the regular expression `[a-z0-9_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     *
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     *
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public Builder addAllOptionalReplicas( - java.lang.Iterable values) { - if (optionalReplicasBuilder_ == null) { - ensureOptionalReplicasIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, optionalReplicas_); - onChanged(); - } else { - optionalReplicasBuilder_.addAllMessages(values); + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - return this; + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. Cloud Labels can be used to filter collections of
+     * resources. They can be used to control how resource metrics are aggregated.
+     * And they can be used as arguments to policy management rules (e.g. route,
+     * firewall, load balancing, etc.).
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform
+     * to the regular expression `[a-z0-9_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     *
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     *
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public Builder clearOptionalReplicas() { - if (optionalReplicasBuilder_ == null) { - optionalReplicas_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - optionalReplicasBuilder_.clear(); - } - return this; + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. Cloud Labels can be used to filter collections of
+     * resources. They can be used to control how resource metrics are aggregated.
+     * And they can be used as arguments to policy management rules (e.g. route,
+     * firewall, load balancing, etc.).
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform
+     * to the regular expression `[a-z0-9_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     *
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     *
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public Builder removeOptionalReplicas(int index) { - if (optionalReplicasBuilder_ == null) { - ensureOptionalReplicasIsMutable(); - optionalReplicas_.remove(index); - onChanged(); - } else { - optionalReplicasBuilder_.remove(index); + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } - return this; + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
-     * 
+ * Cloud Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. Cloud Labels can be used to filter collections of + * resources. They can be used to control how resource metrics are aggregated. + * And they can be used as arguments to policy management rules (e.g. route, + * firewall, load balancing, etc.). * - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getOptionalReplicasBuilder( - int index) { - return internalGetOptionalReplicasFieldBuilder().getBuilder(index); - } - - /** + * * Label keys must be between 1 and 63 characters long and must conform to + * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform + * to the regular expression `[a-z0-9_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. * + * See https://goo.gl/xmQnxf for more information on and examples of labels. * - *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getOptionalReplicasOrBuilder( - int index) { - if (optionalReplicasBuilder_ == null) { - return optionalReplicas_.get(index); - } else { - return optionalReplicasBuilder_.getMessageOrBuilder(index); + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. Cloud Labels can be used to filter collections of
+     * resources. They can be used to control how resource metrics are aggregated.
+     * And they can be used as arguments to policy management rules (e.g. route,
+     * firewall, load balancing, etc.).
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform
+     * to the regular expression `[a-z0-9_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     *
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     *
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public java.util.List - getOptionalReplicasOrBuilderList() { - if (optionalReplicasBuilder_ != null) { - return optionalReplicasBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(optionalReplicas_); + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
-     * 
+ * Cloud Labels are a flexible and lightweight mechanism for organizing cloud + * resources into groups that reflect a customer's organizational needs and + * deployment strategies. Cloud Labels can be used to filter collections of + * resources. They can be used to control how resource metrics are aggregated. + * And they can be used as arguments to policy management rules (e.g. route, + * firewall, load balancing, etc.). * - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalReplicasBuilder() { - return internalGetOptionalReplicasFieldBuilder() - .addBuilder(com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); - } - - /** + * * Label keys must be between 1 and 63 characters long and must conform to + * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. + * * Label values must be between 0 and 63 characters long and must conform + * to the regular expression `[a-z0-9_-]{0,63}`. + * * No more than 64 labels can be associated with a given resource. * + * See https://goo.gl/xmQnxf for more information on and examples of labels. * - *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalReplicasBuilder( - int index) { - return internalGetOptionalReplicasFieldBuilder() - .addBuilder(index, com.google.spanner.admin.instance.v1.ReplicaInfo.getDefaultInstance()); + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; } /** * * *
-     * Output only. The available optional replicas to choose from for
-     * user-managed configurations. Populated for Google-managed configurations.
+     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
+     * resources into groups that reflect a customer's organizational needs and
+     * deployment strategies. Cloud Labels can be used to filter collections of
+     * resources. They can be used to control how resource metrics are aggregated.
+     * And they can be used as arguments to policy management rules (e.g. route,
+     * firewall, load balancing, etc.).
+     *
+     * * Label keys must be between 1 and 63 characters long and must conform to
+     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
+     * * Label values must be between 0 and 63 characters long and must conform
+     * to the regular expression `[a-z0-9_-]{0,63}`.
+     * * No more than 64 labels can be associated with a given resource.
+     *
+     * See https://goo.gl/xmQnxf for more information on and examples of labels.
+     *
+     * If you plan to use labels in your own code, please note that additional
+     * characters may be allowed in the future. Therefore, you are advised to use
+     * an internal label representation, such as JSON, which doesn't rely upon
+     * specific characters being disallowed.  For example, representing labels
+     * as the string:  name + "_" + value  would prove problematic if we were to
+     * allow "_" in a future release.
      * 
* - * - * repeated .google.spanner.admin.instance.v1.ReplicaInfo optional_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * map<string, string> labels = 8; */ - public java.util.List - getOptionalReplicasBuilderList() { - return internalGetOptionalReplicasFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder> - internalGetOptionalReplicasFieldBuilder() { - if (optionalReplicasBuilder_ == null) { - optionalReplicasBuilder_ = - new com.google.protobuf.RepeatedFieldBuilder< - com.google.spanner.admin.instance.v1.ReplicaInfo, - com.google.spanner.admin.instance.v1.ReplicaInfo.Builder, - com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder>( - optionalReplicas_, - ((bitField0_ & 0x00000010) != 0), - getParentForChildren(), - isClean()); - optionalReplicas_ = null; - } - return optionalReplicasBuilder_; + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; } - private java.lang.Object baseConfig_ = ""; + private java.lang.Object etag_ = ""; /** * * *
-     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
-     * based on which this configuration is created. Only set for user-managed
-     * configurations. `base_config` must refer to a configuration of type
-     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * etag is used for optimistic concurrency control as a way
+     * to help prevent simultaneous updates of a instance configuration from
+     * overwriting each other. It is strongly suggested that systems make use of
+     * the etag in the read-modify-write cycle to perform instance configuration
+     * updates in order to avoid race conditions: An etag is returned in the
+     * response which contains instance configurations, and systems are expected
+     * to put that etag in the request to update instance configuration to ensure
+     * that their change is applied to the same version of the instance
+     * configuration. If no etag is provided in the call to update the instance
+     * configuration, then the existing instance configuration is overwritten
+     * blindly.
      * 
* - * string base_config = 7 [(.google.api.resource_reference) = { ... } + * string etag = 9; * - * @return The baseConfig. + * @return The etag. */ - public java.lang.String getBaseConfig() { - java.lang.Object ref = baseConfig_; + public java.lang.String getEtag() { + java.lang.Object ref = etag_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - baseConfig_ = s; + etag_ = s; return s; } else { return (java.lang.String) ref; @@ -3870,22 +5290,29 @@ public java.lang.String getBaseConfig() { * * *
-     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
-     * based on which this configuration is created. Only set for user-managed
-     * configurations. `base_config` must refer to a configuration of type
-     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * etag is used for optimistic concurrency control as a way
+     * to help prevent simultaneous updates of a instance configuration from
+     * overwriting each other. It is strongly suggested that systems make use of
+     * the etag in the read-modify-write cycle to perform instance configuration
+     * updates in order to avoid race conditions: An etag is returned in the
+     * response which contains instance configurations, and systems are expected
+     * to put that etag in the request to update instance configuration to ensure
+     * that their change is applied to the same version of the instance
+     * configuration. If no etag is provided in the call to update the instance
+     * configuration, then the existing instance configuration is overwritten
+     * blindly.
      * 
* - * string base_config = 7 [(.google.api.resource_reference) = { ... } + * string etag = 9; * - * @return The bytes for baseConfig. + * @return The bytes for etag. */ - public com.google.protobuf.ByteString getBaseConfigBytes() { - java.lang.Object ref = baseConfig_; + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - baseConfig_ = b; + etag_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -3896,23 +5323,30 @@ public com.google.protobuf.ByteString getBaseConfigBytes() { * * *
-     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
-     * based on which this configuration is created. Only set for user-managed
-     * configurations. `base_config` must refer to a configuration of type
-     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * etag is used for optimistic concurrency control as a way
+     * to help prevent simultaneous updates of a instance configuration from
+     * overwriting each other. It is strongly suggested that systems make use of
+     * the etag in the read-modify-write cycle to perform instance configuration
+     * updates in order to avoid race conditions: An etag is returned in the
+     * response which contains instance configurations, and systems are expected
+     * to put that etag in the request to update instance configuration to ensure
+     * that their change is applied to the same version of the instance
+     * configuration. If no etag is provided in the call to update the instance
+     * configuration, then the existing instance configuration is overwritten
+     * blindly.
      * 
* - * string base_config = 7 [(.google.api.resource_reference) = { ... } + * string etag = 9; * - * @param value The baseConfig to set. + * @param value The etag to set. * @return This builder for chaining. */ - public Builder setBaseConfig(java.lang.String value) { + public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - baseConfig_ = value; - bitField0_ |= 0x00000020; + etag_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -3921,19 +5355,26 @@ public Builder setBaseConfig(java.lang.String value) { * * *
-     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
-     * based on which this configuration is created. Only set for user-managed
-     * configurations. `base_config` must refer to a configuration of type
-     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * etag is used for optimistic concurrency control as a way
+     * to help prevent simultaneous updates of a instance configuration from
+     * overwriting each other. It is strongly suggested that systems make use of
+     * the etag in the read-modify-write cycle to perform instance configuration
+     * updates in order to avoid race conditions: An etag is returned in the
+     * response which contains instance configurations, and systems are expected
+     * to put that etag in the request to update instance configuration to ensure
+     * that their change is applied to the same version of the instance
+     * configuration. If no etag is provided in the call to update the instance
+     * configuration, then the existing instance configuration is overwritten
+     * blindly.
      * 
* - * string base_config = 7 [(.google.api.resource_reference) = { ... } + * string etag = 9; * * @return This builder for chaining. */ - public Builder clearBaseConfig() { - baseConfig_ = getDefaultInstance().getBaseConfig(); - bitField0_ = (bitField0_ & ~0x00000020); + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } @@ -3942,217 +5383,158 @@ public Builder clearBaseConfig() { * * *
-     * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
-     * based on which this configuration is created. Only set for user-managed
-     * configurations. `base_config` must refer to a configuration of type
-     * `GOOGLE_MANAGED` in the same project as this configuration.
+     * etag is used for optimistic concurrency control as a way
+     * to help prevent simultaneous updates of a instance configuration from
+     * overwriting each other. It is strongly suggested that systems make use of
+     * the etag in the read-modify-write cycle to perform instance configuration
+     * updates in order to avoid race conditions: An etag is returned in the
+     * response which contains instance configurations, and systems are expected
+     * to put that etag in the request to update instance configuration to ensure
+     * that their change is applied to the same version of the instance
+     * configuration. If no etag is provided in the call to update the instance
+     * configuration, then the existing instance configuration is overwritten
+     * blindly.
      * 
* - * string base_config = 7 [(.google.api.resource_reference) = { ... } + * string etag = 9; * - * @param value The bytes for baseConfig to set. + * @param value The bytes for etag to set. * @return This builder for chaining. */ - public Builder setBaseConfigBytes(com.google.protobuf.ByteString value) { + public Builder setEtagBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - baseConfig_ = value; - bitField0_ |= 0x00000020; + etag_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } + private com.google.protobuf.LazyStringArrayList leaderOptions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); + private void ensureLeaderOptionsIsMutable() { + if (!leaderOptions_.isModifiable()) { + leaderOptions_ = new com.google.protobuf.LazyStringArrayList(leaderOptions_); } - bitField0_ |= 0x00000040; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); + bitField0_ |= 0x00000100; } /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
-     *
-     * * Label keys must be between 1 and 63 characters long and must conform to
-     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
-     * * Label values must be between 0 and 63 characters long and must conform
-     * to the regular expression `[a-z0-9_-]{0,63}`.
-     * * No more than 64 labels can be associated with a given resource.
-     *
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
-     *
-     * If you plan to use labels in your own code, please note that additional
-     * characters may be allowed in the future. Therefore, you are advised to use
-     * an internal label representation, such as JSON, which doesn't rely upon
-     * specific characters being disallowed.  For example, representing labels
-     * as the string:  name + "_" + value  would prove problematic if we were to
-     * allow "_" in a future release.
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @return A list containing the leaderOptions. */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); + public com.google.protobuf.ProtocolStringList getLeaderOptionsList() { + leaderOptions_.makeImmutable(); + return leaderOptions_; } /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
+     * 
* - * * Label keys must be between 1 and 63 characters long and must conform to - * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform - * to the regular expression `[a-z0-9_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. + * repeated string leader_options = 4; * - * See https://goo.gl/xmQnxf for more information on and examples of labels. + * @return The count of leaderOptions. + */ + public int getLeaderOptionsCount() { + return leaderOptions_.size(); + } + + /** * - * If you plan to use labels in your own code, please note that additional - * characters may be allowed in the future. Therefore, you are advised to use - * an internal label representation, such as JSON, which doesn't rely upon - * specific characters being disallowed. For example, representing labels - * as the string: name + "_" + value would prove problematic if we were to - * allow "_" in a future release. + * + *
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @param index The index of the element to return. + * @return The leaderOptions at the given index. */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); + public java.lang.String getLeaderOptions(int index) { + return leaderOptions_.get(index); } /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
+     * 
* - * * Label keys must be between 1 and 63 characters long and must conform to - * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform - * to the regular expression `[a-z0-9_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. + * repeated string leader_options = 4; * - * See https://goo.gl/xmQnxf for more information on and examples of labels. + * @param index The index of the value to return. + * @return The bytes of the leaderOptions at the given index. + */ + public com.google.protobuf.ByteString getLeaderOptionsBytes(int index) { + return leaderOptions_.getByteString(index); + } + + /** * - * If you plan to use labels in your own code, please note that additional - * characters may be allowed in the future. Therefore, you are advised to use - * an internal label representation, such as JSON, which doesn't rely upon - * specific characters being disallowed. For example, representing labels - * as the string: name + "_" + value would prove problematic if we were to - * allow "_" in a future release. + * + *
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @param index The index to set the value at. + * @param value The leaderOptions to set. + * @return This builder for chaining. */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); + public Builder setLeaderOptions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + ensureLeaderOptionsIsMutable(); + leaderOptions_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; } /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
-     *
-     * * Label keys must be between 1 and 63 characters long and must conform to
-     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
-     * * Label values must be between 0 and 63 characters long and must conform
-     * to the regular expression `[a-z0-9_-]{0,63}`.
-     * * No more than 64 labels can be associated with a given resource.
-     *
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
-     *
-     * If you plan to use labels in your own code, please note that additional
-     * characters may be allowed in the future. Therefore, you are advised to use
-     * an internal label representation, such as JSON, which doesn't rely upon
-     * specific characters being disallowed.  For example, representing labels
-     * as the string:  name + "_" + value  would prove problematic if we were to
-     * allow "_" in a future release.
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @param value The leaderOptions to add. + * @return This builder for chaining. */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public Builder addLeaderOptions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000040); - internalGetMutableLabels().getMutableMap().clear(); + ensureLeaderOptionsIsMutable(); + leaderOptions_.add(value); + bitField0_ |= 0x00000100; + onChanged(); return this; } @@ -4160,218 +5542,169 @@ public Builder clearLabels() { * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
-     *
-     * * Label keys must be between 1 and 63 characters long and must conform to
-     * the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
-     * * Label values must be between 0 and 63 characters long and must conform
-     * to the regular expression `[a-z0-9_-]{0,63}`.
-     * * No more than 64 labels can be associated with a given resource.
-     *
-     * See https://goo.gl/xmQnxf for more information on and examples of labels.
-     *
-     * If you plan to use labels in your own code, please note that additional
-     * characters may be allowed in the future. Therefore, you are advised to use
-     * an internal label representation, such as JSON, which doesn't rely upon
-     * specific characters being disallowed.  For example, representing labels
-     * as the string:  name + "_" + value  would prove problematic if we were to
-     * allow "_" in a future release.
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @param values The leaderOptions to add. + * @return This builder for chaining. */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); + public Builder addAllLeaderOptions(java.lang.Iterable values) { + ensureLeaderOptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, leaderOptions_); + bitField0_ |= 0x00000100; + onChanged(); return this; } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000040; - return internalGetMutableLabels().getMutableMap(); - } - /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
+     * 
* - * * Label keys must be between 1 and 63 characters long and must conform to - * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform - * to the regular expression `[a-z0-9_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. + * repeated string leader_options = 4; * - * See https://goo.gl/xmQnxf for more information on and examples of labels. + * @return This builder for chaining. + */ + public Builder clearLeaderOptions() { + leaderOptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + ; + onChanged(); + return this; + } + + /** * - * If you plan to use labels in your own code, please note that additional - * characters may be allowed in the future. Therefore, you are advised to use - * an internal label representation, such as JSON, which doesn't rely upon - * specific characters being disallowed. For example, representing labels - * as the string: name + "_" + value would prove problematic if we were to - * allow "_" in a future release. + * + *
+     * Allowed values of the "default_leader" schema option for databases in
+     * instances that use this instance configuration.
      * 
* - * map<string, string> labels = 8; + * repeated string leader_options = 4; + * + * @param value The bytes of the leaderOptions to add. + * @return This builder for chaining. */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } + public Builder addLeaderOptionsBytes(com.google.protobuf.ByteString value) { if (value == null) { - throw new NullPointerException("map value"); + throw new NullPointerException(); } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000040; + checkByteStringIsUtf8(value); + ensureLeaderOptionsIsMutable(); + leaderOptions_.add(value); + bitField0_ |= 0x00000100; + onChanged(); return this; } + private boolean reconciling_; + /** * * *
-     * Cloud Labels are a flexible and lightweight mechanism for organizing cloud
-     * resources into groups that reflect a customer's organizational needs and
-     * deployment strategies. Cloud Labels can be used to filter collections of
-     * resources. They can be used to control how resource metrics are aggregated.
-     * And they can be used as arguments to policy management rules (e.g. route,
-     * firewall, load balancing, etc.).
+     * Output only. If true, the instance configuration is being created or
+     * updated. If false, there are no ongoing operations for the instance
+     * configuration.
+     * 
* - * * Label keys must be between 1 and 63 characters long and must conform to - * the following regular expression: `[a-z][a-z0-9_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform - * to the regular expression `[a-z0-9_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * See https://goo.gl/xmQnxf for more information on and examples of labels. + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + /** * - * If you plan to use labels in your own code, please note that additional - * characters may be allowed in the future. Therefore, you are advised to use - * an internal label representation, such as JSON, which doesn't rely upon - * specific characters being disallowed. For example, representing labels - * as the string: name + "_" + value would prove problematic if we were to - * allow "_" in a future release. + * + *
+     * Output only. If true, the instance configuration is being created or
+     * updated. If false, there are no ongoing operations for the instance
+     * configuration.
      * 
* - * map<string, string> labels = 8; + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000040; + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000200; + onChanged(); return this; } - private java.lang.Object etag_ = ""; - /** * * *
-     * etag is used for optimistic concurrency control as a way
-     * to help prevent simultaneous updates of a instance configuration from
-     * overwriting each other. It is strongly suggested that systems make use of
-     * the etag in the read-modify-write cycle to perform instance configuration
-     * updates in order to avoid race conditions: An etag is returned in the
-     * response which contains instance configurations, and systems are expected
-     * to put that etag in the request to update instance configuration to ensure
-     * that their change is applied to the same version of the instance
-     * configuration. If no etag is provided in the call to update the instance
-     * configuration, then the existing instance configuration is overwritten
-     * blindly.
+     * Output only. If true, the instance configuration is being created or
+     * updated. If false, there are no ongoing operations for the instance
+     * configuration.
      * 
* - * string etag = 9; + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * @return The etag. + * @return This builder for chaining. */ - public java.lang.String getEtag() { - java.lang.Object ref = etag_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - etag_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000200); + reconciling_ = false; + onChanged(); + return this; } + private int state_ = 0; + /** * * *
-     * etag is used for optimistic concurrency control as a way
-     * to help prevent simultaneous updates of a instance configuration from
-     * overwriting each other. It is strongly suggested that systems make use of
-     * the etag in the read-modify-write cycle to perform instance configuration
-     * updates in order to avoid race conditions: An etag is returned in the
-     * response which contains instance configurations, and systems are expected
-     * to put that etag in the request to update instance configuration to ensure
-     * that their change is applied to the same version of the instance
-     * configuration. If no etag is provided in the call to update the instance
-     * configuration, then the existing instance configuration is overwritten
-     * blindly.
+     * Output only. The current instance configuration state. Applicable only for
+     * `USER_MANAGED` configurations.
      * 
* - * string etag = 9; + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The bytes for etag. + * @return The enum numeric value on the wire for state. */ - public com.google.protobuf.ByteString getEtagBytes() { - java.lang.Object ref = etag_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - etag_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public int getStateValue() { + return state_; } /** * * *
-     * etag is used for optimistic concurrency control as a way
-     * to help prevent simultaneous updates of a instance configuration from
-     * overwriting each other. It is strongly suggested that systems make use of
-     * the etag in the read-modify-write cycle to perform instance configuration
-     * updates in order to avoid race conditions: An etag is returned in the
-     * response which contains instance configurations, and systems are expected
-     * to put that etag in the request to update instance configuration to ensure
-     * that their change is applied to the same version of the instance
-     * configuration. If no etag is provided in the call to update the instance
-     * configuration, then the existing instance configuration is overwritten
-     * blindly.
+     * Output only. The current instance configuration state. Applicable only for
+     * `USER_MANAGED` configurations.
      * 
* - * string etag = 9; + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The etag to set. + * @param value The enum numeric value on the wire for state to set. * @return This builder for chaining. */ - public Builder setEtag(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - etag_ = value; - bitField0_ |= 0x00000080; + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -4380,161 +5713,162 @@ public Builder setEtag(java.lang.String value) { * * *
-     * etag is used for optimistic concurrency control as a way
-     * to help prevent simultaneous updates of a instance configuration from
-     * overwriting each other. It is strongly suggested that systems make use of
-     * the etag in the read-modify-write cycle to perform instance configuration
-     * updates in order to avoid race conditions: An etag is returned in the
-     * response which contains instance configurations, and systems are expected
-     * to put that etag in the request to update instance configuration to ensure
-     * that their change is applied to the same version of the instance
-     * configuration. If no etag is provided in the call to update the instance
-     * configuration, then the existing instance configuration is overwritten
-     * blindly.
+     * Output only. The current instance configuration state. Applicable only for
+     * `USER_MANAGED` configurations.
      * 
* - * string etag = 9; + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return This builder for chaining. + * @return The state. */ - public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - return this; + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.State getState() { + com.google.spanner.admin.instance.v1.InstanceConfig.State result = + com.google.spanner.admin.instance.v1.InstanceConfig.State.forNumber(state_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.State.UNRECOGNIZED + : result; } /** * * *
-     * etag is used for optimistic concurrency control as a way
-     * to help prevent simultaneous updates of a instance configuration from
-     * overwriting each other. It is strongly suggested that systems make use of
-     * the etag in the read-modify-write cycle to perform instance configuration
-     * updates in order to avoid race conditions: An etag is returned in the
-     * response which contains instance configurations, and systems are expected
-     * to put that etag in the request to update instance configuration to ensure
-     * that their change is applied to the same version of the instance
-     * configuration. If no etag is provided in the call to update the instance
-     * configuration, then the existing instance configuration is overwritten
-     * blindly.
+     * Output only. The current instance configuration state. Applicable only for
+     * `USER_MANAGED` configurations.
      * 
* - * string etag = 9; + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The bytes for etag to set. + * @param value The state to set. * @return This builder for chaining. */ - public Builder setEtagBytes(com.google.protobuf.ByteString value) { + public Builder setState(com.google.spanner.admin.instance.v1.InstanceConfig.State value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - etag_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000400; + state_ = value.getNumber(); onChanged(); return this; } - private com.google.protobuf.LazyStringArrayList leaderOptions_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureLeaderOptionsIsMutable() { - if (!leaderOptions_.isModifiable()) { - leaderOptions_ = new com.google.protobuf.LazyStringArrayList(leaderOptions_); - } - bitField0_ |= 0x00000100; - } - /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. The current instance configuration state. Applicable only for
+     * `USER_MANAGED` configurations.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return A list containing the leaderOptions. + * @return This builder for chaining. */ - public com.google.protobuf.ProtocolStringList getLeaderOptionsList() { - leaderOptions_.makeImmutable(); - return leaderOptions_; + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000400); + state_ = 0; + onChanged(); + return this; } + private int freeInstanceAvailability_ = 0; + /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Describes whether free instances are available to be created
+     * in this instance configuration.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The count of leaderOptions. + * @return The enum numeric value on the wire for freeInstanceAvailability. */ - public int getLeaderOptionsCount() { - return leaderOptions_.size(); + @java.lang.Override + public int getFreeInstanceAvailabilityValue() { + return freeInstanceAvailability_; } /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Describes whether free instances are available to be created
+     * in this instance configuration.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param index The index of the element to return. - * @return The leaderOptions at the given index. + * @param value The enum numeric value on the wire for freeInstanceAvailability to set. + * @return This builder for chaining. */ - public java.lang.String getLeaderOptions(int index) { - return leaderOptions_.get(index); + public Builder setFreeInstanceAvailabilityValue(int value) { + freeInstanceAvailability_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; } /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Describes whether free instances are available to be created
+     * in this instance configuration.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param index The index of the value to return. - * @return The bytes of the leaderOptions at the given index. + * @return The freeInstanceAvailability. */ - public com.google.protobuf.ByteString getLeaderOptionsBytes(int index) { - return leaderOptions_.getByteString(index); + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + getFreeInstanceAvailability() { + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability result = + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability.forNumber( + freeInstanceAvailability_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + .UNRECOGNIZED + : result; } /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Describes whether free instances are available to be created
+     * in this instance configuration.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param index The index to set the value at. - * @param value The leaderOptions to set. + * @param value The freeInstanceAvailability to set. * @return This builder for chaining. */ - public Builder setLeaderOptions(int index, java.lang.String value) { + public Builder setFreeInstanceAvailability( + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability value) { if (value == null) { throw new NullPointerException(); } - ensureLeaderOptionsIsMutable(); - leaderOptions_.set(index, value); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000800; + freeInstanceAvailability_ = value.getNumber(); onChanged(); return this; } @@ -4543,64 +5877,167 @@ public Builder setLeaderOptions(int index, java.lang.String value) { * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Describes whether free instances are available to be created
+     * in this instance configuration.
      * 
* - * repeated string leader_options = 4; + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The leaderOptions to add. * @return This builder for chaining. */ - public Builder addLeaderOptions(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLeaderOptionsIsMutable(); - leaderOptions_.add(value); - bitField0_ |= 0x00000100; + public Builder clearFreeInstanceAvailability() { + bitField0_ = (bitField0_ & ~0x00000800); + freeInstanceAvailability_ = 0; onChanged(); return this; } + private java.util.List< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits> + allowedProcessingUnits_ = java.util.Collections.emptyList(); + + private void ensureAllowedProcessingUnitsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + allowedProcessingUnits_ = + new java.util.ArrayList< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits>( + allowedProcessingUnits_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder> + allowedProcessingUnitsBuilder_; + + /** + * + * + *
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+     * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits> + getAllowedProcessingUnitsList() { + if (allowedProcessingUnitsBuilder_ == null) { + return java.util.Collections.unmodifiableList(allowedProcessingUnits_); + } else { + return allowedProcessingUnitsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+     * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getAllowedProcessingUnitsCount() { + if (allowedProcessingUnitsBuilder_ == null) { + return allowedProcessingUnits_.size(); + } else { + return allowedProcessingUnitsBuilder_.getCount(); + } + } + /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * repeated string leader_options = 4; - * - * @param values The leaderOptions to add. - * @return This builder for chaining. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addAllLeaderOptions(java.lang.Iterable values) { - ensureLeaderOptionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, leaderOptions_); - bitField0_ |= 0x00000100; - onChanged(); - return this; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getAllowedProcessingUnits(int index) { + if (allowedProcessingUnitsBuilder_ == null) { + return allowedProcessingUnits_.get(index); + } else { + return allowedProcessingUnitsBuilder_.getMessage(index); + } } /** * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * repeated string leader_options = 4; - * - * @return This builder for chaining. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearLeaderOptions() { - leaderOptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - ; - onChanged(); + public Builder setAllowedProcessingUnits( + int index, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits value) { + if (allowedProcessingUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.set(index, value); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.setMessage(index, value); + } return this; } @@ -4608,66 +6045,107 @@ public Builder clearLeaderOptions() { * * *
-     * Allowed values of the "default_leader" schema option for databases in
-     * instances that use this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * repeated string leader_options = 4; - * - * @param value The bytes of the leaderOptions to add. - * @return This builder for chaining. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder addLeaderOptionsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder setAllowedProcessingUnits( + int index, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + builderForValue) { + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.set(index, builderForValue.build()); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.setMessage(index, builderForValue.build()); } - checkByteStringIsUtf8(value); - ensureLeaderOptionsIsMutable(); - leaderOptions_.add(value); - bitField0_ |= 0x00000100; - onChanged(); return this; } - private boolean reconciling_; - /** * * *
-     * Output only. If true, the instance configuration is being created or
-     * updated. If false, there are no ongoing operations for the instance
-     * configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The reconciling. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - @java.lang.Override - public boolean getReconciling() { - return reconciling_; + public Builder addAllowedProcessingUnits( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits value) { + if (allowedProcessingUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.add(value); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.addMessage(value); + } + return this; } /** * * *
-     * Output only. If true, the instance configuration is being created or
-     * updated. If false, there are no ongoing operations for the instance
-     * configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The reconciling to set. - * @return This builder for chaining. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setReconciling(boolean value) { - - reconciling_ = value; - bitField0_ |= 0x00000200; - onChanged(); + public Builder addAllowedProcessingUnits( + int index, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits value) { + if (allowedProcessingUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.add(index, value); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.addMessage(index, value); + } return this; } @@ -4675,62 +6153,104 @@ public Builder setReconciling(boolean value) { * * *
-     * Output only. If true, the instance configuration is being created or
-     * updated. If false, there are no ongoing operations for the instance
-     * configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* - * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearReconciling() { - bitField0_ = (bitField0_ & ~0x00000200); - reconciling_ = false; - onChanged(); + public Builder addAllowedProcessingUnits( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + builderForValue) { + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.add(builderForValue.build()); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.addMessage(builderForValue.build()); + } return this; } - private int state_ = 0; - /** * * *
-     * Output only. The current instance configuration state. Applicable only for
-     * `USER_MANAGED` configurations.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The enum numeric value on the wire for state. */ - @java.lang.Override - public int getStateValue() { - return state_; + public Builder addAllowedProcessingUnits( + int index, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + builderForValue) { + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.add(index, builderForValue.build()); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.addMessage(index, builderForValue.build()); + } + return this; } /** * * *
-     * Output only. The current instance configuration state. Applicable only for
-     * `USER_MANAGED` configurations.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @param value The enum numeric value on the wire for state to set. - * @return This builder for chaining. */ - public Builder setStateValue(int value) { - state_ = value; - bitField0_ |= 0x00000400; - onChanged(); + public Builder addAllAllowedProcessingUnits( + java.lang.Iterable< + ? extends + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits> + values) { + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedProcessingUnits_); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.addAllMessages(values); + } return this; } @@ -4738,47 +6258,63 @@ public Builder setStateValue(int value) { * * *
-     * Output only. The current instance configuration state. Applicable only for
-     * `USER_MANAGED` configurations.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The state. */ - @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.State getState() { - com.google.spanner.admin.instance.v1.InstanceConfig.State result = - com.google.spanner.admin.instance.v1.InstanceConfig.State.forNumber(state_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.State.UNRECOGNIZED - : result; + public Builder clearAllowedProcessingUnits() { + if (allowedProcessingUnitsBuilder_ == null) { + allowedProcessingUnits_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.clear(); + } + return this; } /** * * *
-     * Output only. The current instance configuration state. Applicable only for
-     * `USER_MANAGED` configurations.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @param value The state to set. - * @return This builder for chaining. */ - public Builder setState(com.google.spanner.admin.instance.v1.InstanceConfig.State value) { - if (value == null) { - throw new NullPointerException(); + public Builder removeAllowedProcessingUnits(int index) { + if (allowedProcessingUnitsBuilder_ == null) { + ensureAllowedProcessingUnitsIsMutable(); + allowedProcessingUnits_.remove(index); + onChanged(); + } else { + allowedProcessingUnitsBuilder_.remove(index); } - bitField0_ |= 0x00000400; - state_ = value.getNumber(); - onChanged(); return this; } @@ -4786,137 +6322,195 @@ public Builder setState(com.google.spanner.admin.instance.v1.InstanceConfig.Stat * * *
-     * Output only. The current instance configuration state. Applicable only for
-     * `USER_MANAGED` configurations.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return This builder for chaining. */ - public Builder clearState() { - bitField0_ = (bitField0_ & ~0x00000400); - state_ = 0; - onChanged(); - return this; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + getAllowedProcessingUnitsBuilder(int index) { + return internalGetAllowedProcessingUnitsFieldBuilder().getBuilder(index); } - private int freeInstanceAvailability_ = 0; - /** * * *
-     * Output only. Describes whether free instances are available to be created
-     * in this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The enum numeric value on the wire for freeInstanceAvailability. */ - @java.lang.Override - public int getFreeInstanceAvailabilityValue() { - return freeInstanceAvailability_; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder + getAllowedProcessingUnitsOrBuilder(int index) { + if (allowedProcessingUnitsBuilder_ == null) { + return allowedProcessingUnits_.get(index); + } else { + return allowedProcessingUnitsBuilder_.getMessageOrBuilder(index); + } } /** * * *
-     * Output only. Describes whether free instances are available to be created
-     * in this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @param value The enum numeric value on the wire for freeInstanceAvailability to set. - * @return This builder for chaining. */ - public Builder setFreeInstanceAvailabilityValue(int value) { - freeInstanceAvailability_ = value; - bitField0_ |= 0x00000800; - onChanged(); - return this; + public java.util.List< + ? extends + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder> + getAllowedProcessingUnitsOrBuilderList() { + if (allowedProcessingUnitsBuilder_ != null) { + return allowedProcessingUnitsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allowedProcessingUnits_); + } } /** * * *
-     * Output only. Describes whether free instances are available to be created
-     * in this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return The freeInstanceAvailability. */ - @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability - getFreeInstanceAvailability() { - com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability result = - com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability.forNumber( - freeInstanceAvailability_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability - .UNRECOGNIZED - : result; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + addAllowedProcessingUnitsBuilder() { + return internalGetAllowedProcessingUnitsFieldBuilder() + .addBuilder( + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + .getDefaultInstance()); } /** * * *
-     * Output only. Describes whether free instances are available to be created
-     * in this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @param value The freeInstanceAvailability to set. - * @return This builder for chaining. */ - public Builder setFreeInstanceAvailability( - com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000800; - freeInstanceAvailability_ = value.getNumber(); - onChanged(); - return this; + public com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder + addAllowedProcessingUnitsBuilder(int index) { + return internalGetAllowedProcessingUnitsFieldBuilder() + .addBuilder( + index, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + .getDefaultInstance()); } /** * * *
-     * Output only. Describes whether free instances are available to be created
-     * in this instance configuration.
+     * Output only. Defines the ranges of allowed processing units supported by
+     * this instance configuration. If multiple ranges are specified, an instance
+     * using this configuration may use a valid increment in any of the given
+     * ranges. For example, an allowed_processing_units specification of
+     * `[{min_processing_units:100, max_processing_units:900,
+     * processing_unit_increment:100}, {min_processing_units:1000,
+     * processing_unit_increment:1000}]` specifies that the instance configuration
+     * supports instances with quantities of processing units in multiples of 100
+     * processing units (100, 200, 300 and so on) up to and including 900
+     * processing units and quantities that are at least 1000 processing units and
+     * multiples of 1000 processing units (1000, 2000, 3000 and so on).
      * 
* * - * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * - * @return This builder for chaining. */ - public Builder clearFreeInstanceAvailability() { - bitField0_ = (bitField0_ & ~0x00000800); - freeInstanceAvailability_ = 0; - onChanged(); - return this; + public java.util.List< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder> + getAllowedProcessingUnitsBuilderList() { + return internalGetAllowedProcessingUnitsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder> + internalGetAllowedProcessingUnitsFieldBuilder() { + if (allowedProcessingUnitsBuilder_ == null) { + allowedProcessingUnitsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits, + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits.Builder, + com.google.spanner.admin.instance.v1.InstanceConfig + .AllowedProcessingUnitsOrBuilder>( + allowedProcessingUnits_, + ((bitField0_ & 0x00001000) != 0), + getParentForChildren(), + isClean()); + allowedProcessingUnits_ = null; + } + return allowedProcessingUnitsBuilder_; } private int quorumType_ = 0; @@ -4955,7 +6549,7 @@ public int getQuorumTypeValue() { */ public Builder setQuorumTypeValue(int value) { quorumType_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -5001,7 +6595,7 @@ public Builder setQuorumType( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; quorumType_ = value.getNumber(); onChanged(); return this; @@ -5021,7 +6615,7 @@ public Builder setQuorumType( * @return This builder for chaining. */ public Builder clearQuorumType() { - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); quorumType_ = 0; onChanged(); return this; @@ -5064,7 +6658,7 @@ public long getStorageLimitPerProcessingUnit() { public Builder setStorageLimitPerProcessingUnit(long value) { storageLimitPerProcessingUnit_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -5083,7 +6677,7 @@ public Builder setStorageLimitPerProcessingUnit(long value) { * @return This builder for chaining. */ public Builder clearStorageLimitPerProcessingUnit() { - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); storageLimitPerProcessingUnit_ = 0L; onChanged(); return this; diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java index d51e21862f29..6cf166986f64 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java @@ -654,6 +654,127 @@ java.lang.String getLabelsOrDefault( com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability getFreeInstanceAvailability(); + /** + * + * + *
+   * Output only. Defines the ranges of allowed processing units supported by
+   * this instance configuration. If multiple ranges are specified, an instance
+   * using this configuration may use a valid increment in any of the given
+   * ranges. For example, an allowed_processing_units specification of
+   * `[{min_processing_units:100, max_processing_units:900,
+   * processing_unit_increment:100}, {min_processing_units:1000,
+   * processing_unit_increment:1000}]` specifies that the instance configuration
+   * supports instances with quantities of processing units in multiples of 100
+   * processing units (100, 200, 300 and so on) up to and including 900
+   * processing units and quantities that are at least 1000 processing units and
+   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+   * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getAllowedProcessingUnitsList(); + + /** + * + * + *
+   * Output only. Defines the ranges of allowed processing units supported by
+   * this instance configuration. If multiple ranges are specified, an instance
+   * using this configuration may use a valid increment in any of the given
+   * ranges. For example, an allowed_processing_units specification of
+   * `[{min_processing_units:100, max_processing_units:900,
+   * processing_unit_increment:100}, {min_processing_units:1000,
+   * processing_unit_increment:1000}]` specifies that the instance configuration
+   * supports instances with quantities of processing units in multiples of 100
+   * processing units (100, 200, 300 and so on) up to and including 900
+   * processing units and quantities that are at least 1000 processing units and
+   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+   * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits + getAllowedProcessingUnits(int index); + + /** + * + * + *
+   * Output only. Defines the ranges of allowed processing units supported by
+   * this instance configuration. If multiple ranges are specified, an instance
+   * using this configuration may use a valid increment in any of the given
+   * ranges. For example, an allowed_processing_units specification of
+   * `[{min_processing_units:100, max_processing_units:900,
+   * processing_unit_increment:100}, {min_processing_units:1000,
+   * processing_unit_increment:1000}]` specifies that the instance configuration
+   * supports instances with quantities of processing units in multiples of 100
+   * processing units (100, 200, 300 and so on) up to and including 900
+   * processing units and quantities that are at least 1000 processing units and
+   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+   * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getAllowedProcessingUnitsCount(); + + /** + * + * + *
+   * Output only. Defines the ranges of allowed processing units supported by
+   * this instance configuration. If multiple ranges are specified, an instance
+   * using this configuration may use a valid increment in any of the given
+   * ranges. For example, an allowed_processing_units specification of
+   * `[{min_processing_units:100, max_processing_units:900,
+   * processing_unit_increment:100}, {min_processing_units:1000,
+   * processing_unit_increment:1000}]` specifies that the instance configuration
+   * supports instances with quantities of processing units in multiples of 100
+   * processing units (100, 200, 300 and so on) up to and including 900
+   * processing units and quantities that are at least 1000 processing units and
+   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+   * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List< + ? extends + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder> + getAllowedProcessingUnitsOrBuilderList(); + + /** + * + * + *
+   * Output only. Defines the ranges of allowed processing units supported by
+   * this instance configuration. If multiple ranges are specified, an instance
+   * using this configuration may use a valid increment in any of the given
+   * ranges. For example, an allowed_processing_units specification of
+   * `[{min_processing_units:100, max_processing_units:900,
+   * processing_unit_increment:100}, {min_processing_units:1000,
+   * processing_unit_increment:1000}]` specifies that the instance configuration
+   * supports instances with quantities of processing units in multiples of 100
+   * processing units (100, 200, 300 and so on) up to and including 900
+   * processing units and quantities that are at least 1000 processing units and
+   * multiples of 1000 processing units (1000, 2000, 3000 and so on).
+   * 
+ * + * + * repeated .google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnits allowed_processing_units = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsOrBuilder + getAllowedProcessingUnitsOrBuilder(int index); + /** * * diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java index 36cc24cfff99..30bd4cc2b39f 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java @@ -909,7 +909,7 @@ public com.google.protobuf.ByteString getReferencingDatabasesBytes(int index) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return A list containing the referencingBackups. */ @java.lang.Deprecated @@ -933,7 +933,7 @@ public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return The count of referencingBackups. */ @java.lang.Deprecated @@ -957,7 +957,7 @@ public int getReferencingBackupsCount() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ @@ -982,7 +982,7 @@ public java.lang.String getReferencingBackups(int index) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ @@ -3373,7 +3373,7 @@ private void ensureReferencingBackupsIsMutable() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return A list containing the referencingBackups. */ @java.lang.Deprecated @@ -3398,7 +3398,7 @@ public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return The count of referencingBackups. */ @java.lang.Deprecated @@ -3422,7 +3422,7 @@ public int getReferencingBackupsCount() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ @@ -3447,7 +3447,7 @@ public java.lang.String getReferencingBackups(int index) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ @@ -3472,7 +3472,7 @@ public com.google.protobuf.ByteString getReferencingBackupsBytes(int index) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index to set the value at. * @param value The referencingBackups to set. * @return This builder for chaining. @@ -3505,7 +3505,7 @@ public Builder setReferencingBackups(int index, java.lang.String value) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param value The referencingBackups to add. * @return This builder for chaining. */ @@ -3537,7 +3537,7 @@ public Builder addReferencingBackups(java.lang.String value) { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param values The referencingBackups to add. * @return This builder for chaining. */ @@ -3566,7 +3566,7 @@ public Builder addAllReferencingBackups(java.lang.Iterable val * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return This builder for chaining. */ @java.lang.Deprecated @@ -3594,7 +3594,7 @@ public Builder clearReferencingBackups() { * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param value The bytes of the referencingBackups to add. * @return This builder for chaining. */ diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java index 19d279f5cc2f..752c6c749229 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java @@ -453,7 +453,7 @@ public interface InstancePartitionOrBuilder * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return A list containing the referencingBackups. */ @java.lang.Deprecated @@ -475,7 +475,7 @@ public interface InstancePartitionOrBuilder * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @return The count of referencingBackups. */ @java.lang.Deprecated @@ -497,7 +497,7 @@ public interface InstancePartitionOrBuilder * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ @@ -520,7 +520,7 @@ public interface InstancePartitionOrBuilder * * * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is - * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1855 + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1884 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java index 98e308eacb48..36b54654e06a 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java @@ -48,6 +48,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_admin_instance_v1_InstanceConfig_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_spanner_admin_instance_v1_InstanceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -244,7 +248,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\020TYPE_UNSPECIFIED\020\000\022\016\n\n" + "READ_WRITE\020\001\022\r\n" + "\tREAD_ONLY\020\002\022\013\n" - + "\007WITNESS\020\003\"\307\n\n" + + "\007WITNESS\020\003\"\261\014\n" + "\016InstanceConfig\022\014\n" + "\004name\030\001 \001(\t\022\024\n" + "\014display_name\030\002 \001(\t\022P\n" @@ -264,10 +268,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005state\030\013 \001(\01626.google.spanner.admi" + "n.instance.v1.InstanceConfig.StateB\004\342A\001\003\022s\n" + "\032free_instance_availability\030\014 \001(\0162I.g" - + "oogle.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\004\342A\001\003\022V\n" - + "\013quorum_type\030\022 \001(\0162;.google.spanner.admi" - + "n.instance.v1.InstanceConfig.QuorumTypeB\004\342A\001\003\022/\n" - + "!storage_limit_per_processing_unit\030\023 \001(\003B\004\342A\001\003\032-\n" + + "oogle.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailabilityB\004\342A\001\003\022o\n" + + "\030allowed_processing_units\030\r" + + " \003(\0132G.google" + + ".spanner.admin.instance.v1.InstanceConfig.AllowedProcessingUnitsB\004\342A\001\003\022V\n" + + "\013quorum_type\030\022 \001(\0162;.google.spanner.admin.insta" + + "nce.v1.InstanceConfig.QuorumTypeB\004\342A\001\003\022/\n" + + "!storage_limit_per_processing_unit\030\023 \001(\003B\004\342A\001\003\032w\n" + + "\026AllowedProcessingUnits\022\034\n" + + "\024min_processing_units\030\001 \001(\005\022\034\n" + + "\024max_processing_units\030\002 \001(\005\022!\n" + + "\031processing_unit_increment\030\003 \001(\005\032-\n" + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001\"B\n" @@ -290,22 +301,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\006REGION\020\001\022\017\n" + "\013DUAL_REGION\020\002\022\020\n" + "\014MULTI_REGION\020\003:\201\001\352A~\n" - + "%spanner.googleapis.com/InstanceConfig\0224projects/{project}" - + "/instanceConfigs/{instance_config}*\017instanceConfigs2\016instanceConfig\"\263\001\n" + + "%spanner.googleapis.com/InstanceConfig\0224projects/{project}/insta" + + "nceConfigs/{instance_config}*\017instanceConfigs2\016instanceConfig\"\263\001\n" + "\026ReplicaComputeCapacity\022S\n" - + "\021replica_selection\030\001 \001(" - + "\01322.google.spanner.admin.instance.v1.ReplicaSelectionB\004\342A\001\002\022\024\n\n" + + "\021replica_selection\030\001 \001(\01322.go" + + "ogle.spanner.admin.instance.v1.ReplicaSelectionB\004\342A\001\002\022\024\n\n" + "node_count\030\002 \001(\005H\000\022\032\n" + "\020processing_units\030\003 \001(\005H\000B\022\n" + "\020compute_capacity\"\221\n\n" + "\021AutoscalingConfig\022g\n" - + "\022autoscaling_limits\030\001 \001(\0132E.google.spanner.adm" - + "in.instance.v1.AutoscalingConfig.AutoscalingLimitsB\004\342A\001\002\022i\n" - + "\023autoscaling_targets\030\002 \001(\0132F.google.spanner.admin.instance.v1" - + ".AutoscalingConfig.AutoscalingTargetsB\004\342A\001\002\022}\n" - + "\036asymmetric_autoscaling_options\030\003 " - + "\003(\0132O.google.spanner.admin.instance.v1.A" - + "utoscalingConfig.AsymmetricAutoscalingOptionB\004\342A\001\001\032\227\001\n" + + "\022autoscaling_limits\030\001 \001(\0132E.google.spanner.admin.ins" + + "tance.v1.AutoscalingConfig.AutoscalingLimitsB\004\342A\001\002\022i\n" + + "\023autoscaling_targets\030\002 \001(\0132" + + "F.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargetsB\004\342A\001\002\022}\n" + + "\036asymmetric_autoscaling_options\030\003 \003(\0132O." + + "google.spanner.admin.instance.v1.Autosca" + + "lingConfig.AsymmetricAutoscalingOptionB\004\342A\001\001\032\227\001\n" + "\021AutoscalingLimits\022\023\n" + "\tmin_nodes\030\001 \001(\005H\000\022\036\n" + "\024min_processing_units\030\002 \001(\005H\000\022\023\n" @@ -318,13 +329,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\035total_cpu_utilization_percent\030\004 \001(\005B\004\342A\001\001\022)\n" + "\033storage_utilization_percent\030\002 \001(\005B\004\342A\001\002\032\352\004\n" + "\033AsymmetricAutoscalingOption\022S\n" - + "\021replica_selection\030\001 \001(\01322.google.spa" - + "nner.admin.instance.v1.ReplicaSelectionB\004\342A\001\002\022\203\001\n" - + "\toverrides\030\002 \001(\0132j.google.spanner.admin.instance.v1.AutoscalingConfig.A" - + "symmetricAutoscalingOption.AutoscalingConfigOverridesB\004\342A\001\001\032\357\002\n" + + "\021replica_selection\030\001 \001(\01322.google.spanner.a" + + "dmin.instance.v1.ReplicaSelectionB\004\342A\001\002\022\203\001\n" + + "\toverrides\030\002 \001(\0132j.google.spanner.adm" + + "in.instance.v1.AutoscalingConfig.Asymmet" + + "ricAutoscalingOption.AutoscalingConfigOverridesB\004\342A\001\001\032\357\002\n" + "\032AutoscalingConfigOverrides\022g\n" - + "\022autoscaling_limits\030\001 \001(\0132E" - + ".google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\004\342A\001\001\022F\n" + + "\022autoscaling_limits\030\001 \001(\0132E.googl" + + "e.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimitsB\004\342A\001\001\022F\n" + "8autoscaling_target_high_priority_cpu_utilization_percent\030\002" + " \001(\005B\004\342A\001\001\022>\n" + "0autoscaling_target_total_cpu_utilization_percent\030\004" @@ -338,14 +350,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\014display_name\030\003 \001(\tB\004\342A\001\002\022\022\n\n" + "node_count\030\005 \001(\005\022\030\n" + "\020processing_units\030\t \001(\005\022`\n" - + "\030replica_compute_capacity\030\023 \003(\01328.goo" - + "gle.spanner.admin.instance.v1.ReplicaComputeCapacityB\004\342A\001\003\022U\n" - + "\022autoscaling_config\030\021" - + " \001(\01323.google.spanner.admin.instance.v1.AutoscalingConfigB\004\342A\001\001\022E\n" - + "\005state\030\006 \001(\016" - + "20.google.spanner.admin.instance.v1.Instance.StateB\004\342A\001\003\022F\n" - + "\006labels\030\007 \003(\01326.googl" - + "e.spanner.admin.instance.v1.Instance.LabelsEntry\022N\n\r" + + "\030replica_compute_capacity\030\023 \003(\01328.google.sp" + + "anner.admin.instance.v1.ReplicaComputeCapacityB\004\342A\001\003\022U\n" + + "\022autoscaling_config\030\021 \001(\013" + + "23.google.spanner.admin.instance.v1.AutoscalingConfigB\004\342A\001\001\022E\n" + + "\005state\030\006 \001(\01620.goo" + + "gle.spanner.admin.instance.v1.Instance.StateB\004\342A\001\003\022F\n" + + "\006labels\030\007 \003(\01326.google.span" + + "ner.admin.instance.v1.Instance.LabelsEntry\022N\n\r" + "instance_type\030\n" + " \001(\01627.google.spanner.admin.instance.v1.Instance.InstanceType\022\025\n\r" + "endpoint_uris\030\010 \003(\t\0225\n" @@ -355,10 +367,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022V\n" + "\026free_instance_metadata\030\r" + " \001(\01326.google.spanner.admin.instance.v1.FreeInstanceMetadata\022I\n" - + "\007edition\030\024" - + " \001(\01622.google.spanner.admin.instance.v1.Instance.EditionB\004\342A\001\001\022p\n" - + "\034default_backup_schedule_type\030\027 \001(\0162D.google.spanner." - + "admin.instance.v1.Instance.DefaultBackupScheduleTypeB\004\342A\001\001\032-\n" + + "\007edition\030\024 \001(\016" + + "22.google.spanner.admin.instance.v1.Instance.EditionB\004\342A\001\001\022p\n" + + "\034default_backup_schedule_type\030\027 \001(\0162D.google.spanner.admin." + + "instance.v1.Instance.DefaultBackupScheduleTypeB\004\342A\001\001\032-\n" + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001\"7\n" @@ -401,8 +413,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\01320.google.spanner.admin.instance.v1.InstanceConfigB\004\342A\001\002\022\025\n\r" + "validate_only\030\004 \001(\010\"\274\001\n" + "\033UpdateInstanceConfigRequest\022O\n" - + "\017instance_config\030\001 \001(\01320.googl" - + "e.spanner.admin.instance.v1.InstanceConfigB\004\342A\001\002\0225\n" + + "\017instance_config\030\001 \001(\01320.google.span" + + "ner.admin.instance.v1.InstanceConfigB\004\342A\001\002\0225\n" + "\013update_mask\030\002" + " \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\002\022\025\n\r" + "validate_only\030\003 \001(\010\"\200\001\n" @@ -428,8 +440,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\006parent\030\001 \001(\tB4\342A\001\002\372A-\n" + "+cloudresourcemanager.googleapis.com/Project\022\031\n" + "\013instance_id\030\002 \001(\tB\004\342A\001\002\022B\n" - + "\010instance\030\003" - + " \001(\0132*.google.spanner.admin.instance.v1.InstanceB\004\342A\001\002\"\312\001\n" + + "\010instance\030\003 \001(\0132" + + "*.google.spanner.admin.instance.v1.InstanceB\004\342A\001\002\"\312\001\n" + "\024ListInstancesRequest\022D\n" + "\006parent\030\001 \001(\tB4\342A\001\002\372A-\n" + "+cloudresourcemanager.googleapis.com/Project\022\021\n" @@ -442,8 +454,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017next_page_token\030\002 \001(\t\022\023\n" + "\013unreachable\030\003 \003(\t\"\221\001\n" + "\025UpdateInstanceRequest\022B\n" - + "\010instance\030\001 \001(\0132" - + "*.google.spanner.admin.instance.v1.InstanceB\004\342A\001\002\0224\n\n" + + "\010instance\030\001 \001(\0132*.goog" + + "le.spanner.admin.instance.v1.InstanceB\004\342A\001\002\0224\n\n" + "field_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\002\"O\n" + "\025DeleteInstanceRequest\0226\n" + "\004name\030\001 \001(\tB(\342A\001\002\372A!\n" @@ -467,8 +479,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0226\n" + "\014upgrade_time\030\002" + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022^\n" - + "\017expire_behavior\030\003 \001(\0162E.google.s" - + "panner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n" + + "\017expire_behavior\030\003 \001(\0162E.google.spanner" + + ".admin.instance.v1.FreeInstanceMetadata.ExpireBehavior\"i\n" + "\016ExpireBehavior\022\037\n" + "\033EXPIRE_BEHAVIOR_UNSPECIFIED\020\000\022\027\n" + "\023FREE_TO_PROVISIONED\020\001\022\035\n" @@ -482,22 +494,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\034UpdateInstanceConfigMetadata\022I\n" + "\017instance_config\030\001" + " \001(\01320.google.spanner.admin.instance.v1.InstanceConfig\022E\n" - + "\010progress\030\002 \001(" - + "\01323.google.spanner.admin.instance.v1.OperationProgress\022/\n" + + "\010progress\030\002 \001(\01323.go" + + "ogle.spanner.admin.instance.v1.OperationProgress\022/\n" + "\013cancel_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"\230\006\n" + "\021InstancePartition\022\022\n" + "\004name\030\001 \001(\tB\004\342A\001\002\022>\n" + "\006config\030\002 \001(\tB.\342A\001\002\372A\'\n" + "%spanner.googleapis.com/InstanceConfig\022\032\n" - + "\014display_name\030\003 \001(\tB\004\342A\001\002\022\024\n" - + "\n" + + "\014display_name\030\003 \001(\tB\004\342A\001\002\022\024\n\n" + "node_count\030\005 \001(\005H\000\022\032\n" + "\020processing_units\030\006 \001(\005H\000\022U\n" + "\022autoscaling_config\030\r" - + " \001(\01323.go" - + "ogle.spanner.admin.instance.v1.AutoscalingConfigB\004\342A\001\001\022N\n" - + "\005state\030\007 \001(\01629.google.s" - + "panner.admin.instance.v1.InstancePartition.StateB\004\342A\001\003\0225\n" + + " \001(\01323.google.s" + + "panner.admin.instance.v1.AutoscalingConfigB\004\342A\001\001\022N\n" + + "\005state\030\007 \001(\01629.google.spanner" + + ".admin.instance.v1.InstancePartition.StateB\004\342A\001\003\0225\n" + "\013create_time\030\010" + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n" + "\013update_time\030\t" @@ -510,13 +521,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\021STATE_UNSPECIFIED\020\000\022\014\n" + "\010CREATING\020\001\022\t\n" + "\005READY\020\002:\246\001\352A\242\001\n" - + "(spanner.googleapis.com/InstancePartition\022Oprojects/{project}/instances/{instance}/" - + "instancePartitions/{instance_partition}*" - + "\022instancePartitions2\021instancePartitionB\022\n" + + "(spanner.googleapis.com/InstancePartition\022Oprojec" + + "ts/{project}/instances/{instance}/instan" + + "cePartitions/{instance_partition}*\022instancePartitions2\021instancePartitionB\022\n" + "\020compute_capacity\"\201\002\n" + "\037CreateInstancePartitionMetadata\022O\n" - + "\022instance_partition\030\001 \001" - + "(\01323.google.spanner.admin.instance.v1.InstancePartition\022.\n\n" + + "\022instance_partition\030\001 \001(\01323.g" + + "oogle.spanner.admin.instance.v1.InstancePartition\022.\n\n" + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + "\013cancel_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022,\n" + "\010end_time\030\004 \001(\0132\032.google.protobuf.Timestamp\"\326\001\n" @@ -524,8 +535,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\006parent\030\001 \001(\tB(\342A\001\002\372A!\n" + "\037spanner.googleapis.com/Instance\022#\n" + "\025instance_partition_id\030\002 \001(\tB\004\342A\001\002\022U\n" - + "\022instance_partition\030\003 \001(\01323.g" - + "oogle.spanner.admin.instance.v1.InstancePartitionB\004\342A\001\002\"o\n" + + "\022instance_partition\030\003 \001(\01323.google." + + "spanner.admin.instance.v1.InstancePartitionB\004\342A\001\002\"o\n" + "\036DeleteInstancePartitionRequest\022?\n" + "\004name\030\001 \001(\tB1\342A\001\002\372A*\n" + "(spanner.googleapis.com/InstancePartition\022\014\n" @@ -534,14 +545,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB1\342A\001\002\372A*\n" + "(spanner.googleapis.com/InstancePartition\"\255\001\n" + "\036UpdateInstancePartitionRequest\022U\n" - + "\022instance_partition\030\001" - + " \001(\01323.google.spanner.admin.instance.v1.InstancePartitionB\004\342A\001\002\0224\n\n" + + "\022instance_partition\030\001 \001(" + + "\01323.google.spanner.admin.instance.v1.InstancePartitionB\004\342A\001\002\0224\n\n" + "field_mask\030\002" + " \001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\002\"\201\002\n" + "\037UpdateInstancePartitionMetadata\022O\n" + "\022instance_partition\030\001" - + " \001(\01323.google.spanner.admin.instance.v1.InstancePartition\022.\n" - + "\n" + + " \001(\01323.google.spanner.admin.instance.v1.InstancePartition\022.\n\n" + "start_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n" + "\013cancel_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022,\n" + "\010end_time\030\004 \001(\0132\032.google.protobuf.Timestamp\"\307\001\n" @@ -553,8 +563,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\033instance_partition_deadline\030\004" + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\001\"\240\001\n" + "\036ListInstancePartitionsResponse\022P\n" - + "\023instance_partitions\030\001" - + " \003(\01323.google.spanner.admin.instance.v1.InstancePartition\022\027\n" + + "\023instance_partitions\030\001 \003(\013" + + "23.google.spanner.admin.instance.v1.InstancePartition\022\027\n" + "\017next_page_token\030\002 \001(\t\022\023\n" + "\013unreachable\030\003 \003(\t\"\362\001\n" + "&ListInstancePartitionOperationsRequest\0228\n" @@ -577,115 +587,116 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\024MoveInstanceResponse\"\245\001\n" + "\024MoveInstanceMetadata\022\025\n\r" + "target_config\030\001 \001(\t\022E\n" - + "\010progress\030\002 \001(\01323.googl" - + "e.spanner.admin.instance.v1.OperationProgress\022/\n" + + "\010progress\030\002 \001(\01323.google.span" + + "ner.admin.instance.v1.OperationProgress\022/\n" + "\013cancel_time\030\003 \001(\0132\032.google.protobuf.Timestamp2\332\'\n\r" + "InstanceAdmin\022\314\001\n" - + "\023ListInstanceConfigs\022<.google.spanner.admin." - + "instance.v1.ListInstanceConfigsRequest\032=.google.spanner.admin.instance.v1.ListIn" - + "stanceConfigsResponse\"8\332A\006parent\202\323\344\223\002)\022\'" - + "/v1/{parent=projects/*}/instanceConfigs\022\271\001\n" - + "\021GetInstanceConfig\022:.google.spanner.admin.instance.v1.GetInstanceConfigReques" - + "t\0320.google.spanner.admin.instance.v1.Ins" - + "tanceConfig\"6\332A\004name\202\323\344\223\002)\022\'/v1/{name=projects/*/instanceConfigs/*}\022\310\002\n" - + "\024CreateInstanceConfig\022=.google.spanner.admin.inst" - + "ance.v1.CreateInstanceConfigRequest\032\035.google.longrunning.Operation\"\321\001\312Ap\n" - + "/google.spanner.admin.instance.v1.InstanceConfi" - + "g\022=google.spanner.admin.instance.v1.CreateInstanceConfigMetadata\332A)parent,instan" - + "ce_config,instance_config_id\202\323\344\223\002,\"\'/v1/" - + "{parent=projects/*}/instanceConfigs:\001*\022\312\002\n" - + "\024UpdateInstanceConfig\022=.google.spanner.admin.instance.v1.UpdateInstanceConfigR" - + "equest\032\035.google.longrunning.Operation\"\323\001\312Ap\n" - + "/google.spanner.admin.instance.v1.InstanceConfig\022=google.spanner.admin.insta" - + "nce.v1.UpdateInstanceConfigMetadata\332A\033in" - + "stance_config,update_mask\202\323\344\223\002<27/v1/{in" - + "stance_config.name=projects/*/instanceConfigs/*}:\001*\022\245\001\n" - + "\024DeleteInstanceConfig\022=.google.spanner.admin.instance.v1.DeleteIn" - + "stanceConfigRequest\032\026.google.protobuf.Em" - + "pty\"6\332A\004name\202\323\344\223\002)*\'/v1/{name=projects/*/instanceConfigs/*}\022\360\001\n" - + "\034ListInstanceConfigOperations\022E.google.spanner.admin.inst" - + "ance.v1.ListInstanceConfigOperationsRequest\032F.google.spanner.admin.instance.v1.L" - + "istInstanceConfigOperationsResponse\"A\332A\006" - + "parent\202\323\344\223\0022\0220/v1/{parent=projects/*}/instanceConfigOperations\022\264\001\n\r" - + "ListInstances\0226.google.spanner.admin.instance.v1.List" - + "InstancesRequest\0327.google.spanner.admin." - + "instance.v1.ListInstancesResponse\"2\332A\006pa" - + "rent\202\323\344\223\002#\022!/v1/{parent=projects/*}/instances\022\344\001\n" - + "\026ListInstancePartitions\022?.google.spanner.admin.instance.v1.ListInstance" - + "PartitionsRequest\032@.google.spanner.admin.instance.v1.ListInstancePartitionsRespo" - + "nse\"G\332A\006parent\202\323\344\223\0028\0226/v1/{parent=projects/*/instances/*}/instancePartitions\022\241\001\n" - + "\013GetInstance\0224.google.spanner.admin.inst" - + "ance.v1.GetInstanceRequest\032*.google.span" - + "ner.admin.instance.v1.Instance\"0\332A\004name\202" - + "\323\344\223\002#\022!/v1/{name=projects/*/instances/*}\022\234\002\n" - + "\016CreateInstance\0227.google.spanner.adm" - + "in.instance.v1.CreateInstanceRequest\032\035.google.longrunning.Operation\"\261\001\312Ad\n" - + ")google.spanner.admin.instance.v1.Instance\0227go" - + "ogle.spanner.admin.instance.v1.CreateInstanceMetadata\332A\033parent,instance_id,insta" - + "nce\202\323\344\223\002&\"!/v1/{parent=projects/*}/instances:\001*\022\235\002\n" - + "\016UpdateInstance\0227.google.spanner.admin.instance.v1.UpdateInstanceRequ" - + "est\032\035.google.longrunning.Operation\"\262\001\312Ad\n" - + ")google.spanner.admin.instance.v1.Instance\0227google.spanner.admin.instance.v1.Up" - + "dateInstanceMetadata\332A\023instance,field_ma" - + "sk\202\323\344\223\002/2*/v1/{instance.name=projects/*/instances/*}:\001*\022\223\001\n" - + "\016DeleteInstance\0227.google.spanner.admin.instance.v1.DeleteInst" - + "anceRequest\032\026.google.protobuf.Empty\"0\332A\004" - + "name\202\323\344\223\002#*!/v1/{name=projects/*/instances/*}\022\232\001\n" - + "\014SetIamPolicy\022\".google.iam.v1.SetIamPolicyRequest\032\025.google.iam.v1.Polic" - + "y\"O\332A\017resource,policy\202\323\344\223\0027\"2/v1/{resour" - + "ce=projects/*/instances/*}:setIamPolicy:\001*\022\223\001\n" - + "\014GetIamPolicy\022\".google.iam.v1.GetI" - + "amPolicyRequest\032\025.google.iam.v1.Policy\"H" - + "\332A\010resource\202\323\344\223\0027\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\001*\022\305\001\n" - + "\022TestIamPermissions\022(.google.iam.v1.TestIamP" - + "ermissionsRequest\032).google.iam.v1.TestIa" - + "mPermissionsResponse\"Z\332A\024resource,permis" - + "sions\202\323\344\223\002=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\001*\022\321\001\n" - + "\024GetInstancePartition\022=.google.spanner.admin" - + ".instance.v1.GetInstancePartitionRequest\0323.google.spanner.admin.instance.v1.Inst" - + "ancePartition\"E\332A\004name\202\323\344\223\0028\0226/v1/{name=" - + "projects/*/instances/*/instancePartitions/*}\022\351\002\n" - + "\027CreateInstancePartition\022@.google.spanner.admin.instance.v1.CreateInstan" - + "cePartitionRequest\032\035.google.longrunning.Operation\"\354\001\312Av\n" - + "2google.spanner.admin.instance.v1.InstancePartition\022@google.span" - + "ner.admin.instance.v1.CreateInstancePartitionMetadata\332A/parent,instance_partitio" - + "n,instance_partition_id\202\323\344\223\002;\"6/v1/{pare" - + "nt=projects/*/instances/*}/instancePartitions:\001*\022\272\001\n" - + "\027DeleteInstancePartition\022@.google.spanner.admin.instance.v1.DeleteIn" - + "stancePartitionRequest\032\026.google.protobuf" - + ".Empty\"E\332A\004name\202\323\344\223\0028*6/v1/{name=project" - + "s/*/instances/*/instancePartitions/*}\022\352\002\n" - + "\027UpdateInstancePartition\022@.google.spanner.admin.instance.v1.UpdateInstanceParti" - + "tionRequest\032\035.google.longrunning.Operation\"\355\001\312Av\n" - + "2google.spanner.admin.instance.v1.InstancePartition\022@google.spanner.adm" - + "in.instance.v1.UpdateInstancePartitionMe" - + "tadata\332A\035instance_partition,field_mask\202\323" - + "\344\223\002N2I/v1/{instance_partition.name=proje" - + "cts/*/instances/*/instancePartitions/*}:\001*\022\210\002\n" - + "\037ListInstancePartitionOperations\022H", - ".google.spanner.admin.instance.v1.ListIn" - + "stancePartitionOperationsRequest\032I.googl" + + "\023ListInstanceConfigs\022<.google.spanner.admin.instan" + + "ce.v1.ListInstanceConfigsRequest\032=.google.spanner.admin.instance.v1.ListInstance" + + "ConfigsResponse\"8\332A\006parent\202\323\344\223\002)\022\'/v1/{parent=projects/*}/instanceConfigs\022\271\001\n" + + "\021GetInstanceConfig\022:.google.spanner.admin.i" + + "nstance.v1.GetInstanceConfigRequest\0320.google.spanner.admin.instance.v1.InstanceC" + + "onfig\"6\332A\004name\202\323\344\223\002)\022\'/v1/{name=projects/*/instanceConfigs/*}\022\310\002\n" + + "\024CreateInstanceConfig\022=.google.spanner.admin.instance.v" + + "1.CreateInstanceConfigRequest\032\035.google.longrunning.Operation\"\321\001\312Ap\n" + + "/google.spanner.admin.instance.v1.InstanceConfig\022=goo" + + "gle.spanner.admin.instance.v1.CreateInstanceConfigMetadata\332A)parent,instance_con" + + "fig,instance_config_id\202\323\344\223\002,\"\'/v1/{parent=projects/*}/instanceConfigs:\001*\022\312\002\n" + + "\024UpdateInstanceConfig\022=.google.spanner.admin" + + ".instance.v1.UpdateInstanceConfigRequest\032\035.google.longrunning.Operation\"\323\001\312Ap\n" + + "/google.spanner.admin.instance.v1.InstanceConfig\022=google.spanner.admin.instance.v1" + + ".UpdateInstanceConfigMetadata\332A\033instance" + + "_config,update_mask\202\323\344\223\002<27/v1/{instance" + + "_config.name=projects/*/instanceConfigs/*}:\001*\022\245\001\n" + + "\024DeleteInstanceConfig\022=.google.spanner.admin.instance.v1.DeleteInstance" + + "ConfigRequest\032\026.google.protobuf.Empty\"6\332" + + "A\004name\202\323\344\223\002)*\'/v1/{name=projects/*/instanceConfigs/*}\022\360\001\n" + + "\034ListInstanceConfigOperations\022E.google.spanner.admin.instance.v" + + "1.ListInstanceConfigOperationsRequest\032F.google.spanner.admin.instance.v1.ListIns" + + "tanceConfigOperationsResponse\"A\332A\006parent" + + "\202\323\344\223\0022\0220/v1/{parent=projects/*}/instanceConfigOperations\022\264\001\n\r" + + "ListInstances\0226.google.spanner.admin.instance.v1.ListInstan" + + "cesRequest\0327.google.spanner.admin.instan" + + "ce.v1.ListInstancesResponse\"2\332A\006parent\202\323" + + "\344\223\002#\022!/v1/{parent=projects/*}/instances\022\344\001\n" + + "\026ListInstancePartitions\022?.google.spanner.admin.instance.v1.ListInstancePartit" + + "ionsRequest\032@.google.spanner.admin.insta" + + "nce.v1.ListInstancePartitionsResponse\"G\332" + + "A\006parent\202\323\344\223\0028\0226/v1/{parent=projects/*/instances/*}/instancePartitions\022\241\001\n" + + "\013GetInstance\0224.google.spanner.admin.instance.v" + + "1.GetInstanceRequest\032*.google.spanner.ad" + + "min.instance.v1.Instance\"0\332A\004name\202\323\344\223\002#\022!/v1/{name=projects/*/instances/*}\022\234\002\n" + + "\016CreateInstance\0227.google.spanner.admin.ins" + + "tance.v1.CreateInstanceRequest\032\035.google.longrunning.Operation\"\261\001\312Ad\n" + + ")google.spanner.admin.instance.v1.Instance\0227google.s" + + "panner.admin.instance.v1.CreateInstanceM" + + "etadata\332A\033parent,instance_id,instance\202\323\344" + + "\223\002&\"!/v1/{parent=projects/*}/instances:\001*\022\235\002\n" + + "\016UpdateInstance\0227.google.spanner.ad" + + "min.instance.v1.UpdateInstanceRequest\032\035.google.longrunning.Operation\"\262\001\312Ad\n" + + ")google.spanner.admin.instance.v1.Instance\0227g" + + "oogle.spanner.admin.instance.v1.UpdateIn" + + "stanceMetadata\332A\023instance,field_mask\202\323\344\223" + + "\002/2*/v1/{instance.name=projects/*/instances/*}:\001*\022\223\001\n" + + "\016DeleteInstance\0227.google.spanner.admin.instance.v1.DeleteInstanceRe" + + "quest\032\026.google.protobuf.Empty\"0\332A\004name\202\323" + + "\344\223\002#*!/v1/{name=projects/*/instances/*}\022\232\001\n" + + "\014SetIamPolicy\022\".google.iam.v1.SetIamP" + + "olicyRequest\032\025.google.iam.v1.Policy\"O\332A\017" + + "resource,policy\202\323\344\223\0027\"2/v1/{resource=projects/*/instances/*}:setIamPolicy:\001*\022\223\001\n" + + "\014GetIamPolicy\022\".google.iam.v1.GetIamPoli" + + "cyRequest\032\025.google.iam.v1.Policy\"H\332A\010res" + + "ource\202\323\344\223\0027\"2/v1/{resource=projects/*/instances/*}:getIamPolicy:\001*\022\305\001\n" + + "\022TestIamPermissions\022(.google.iam.v1.TestIamPermiss" + + "ionsRequest\032).google.iam.v1.TestIamPermi" + + "ssionsResponse\"Z\332A\024resource,permissions\202" + + "\323\344\223\002=\"8/v1/{resource=projects/*/instances/*}:testIamPermissions:\001*\022\321\001\n" + + "\024GetInstancePartition\022=.google.spanner.admin.insta" + + "nce.v1.GetInstancePartitionRequest\0323.google.spanner.admin.instance.v1.InstancePa" + + "rtition\"E\332A\004name\202\323\344\223\0028\0226/v1/{name=projec" + + "ts/*/instances/*/instancePartitions/*}\022\351\002\n" + + "\027CreateInstancePartition\022@.google.spanner.admin.instance.v1.CreateInstancePart" + + "itionRequest\032\035.google.longrunning.Operation\"\354\001\312Av\n" + + "2google.spanner.admin.instance.v1.InstancePartition\022@google.spanner.ad" + + "min.instance.v1.CreateInstancePartitionMetadata\332A/parent,instance_partition,inst" + + "ance_partition_id\202\323\344\223\002;\"6/v1/{parent=pro" + + "jects/*/instances/*}/instancePartitions:\001*\022\272\001\n" + + "\027DeleteInstancePartition\022@.google.spanner.admin.instance.v1.DeleteInstance" + + "PartitionRequest\032\026.google.protobuf.Empty" + + "\"E\332A\004name\202\323\344\223\0028*6/v1/{name=projects/*/instances/*/instancePartitions/*}\022\352\002\n" + + "\027UpdateInstancePartition\022@.google.spanner.adm" + + "in.instance.v1.UpdateInstancePartitionRe" + + "quest\032\035.google.longrunning.Operation\"\355\001\312Av\n" + + "2google.spanner.admin.instance.v1.Ins", + "tancePartition\022@google.spanner.admin.ins" + + "tance.v1.UpdateInstancePartitionMetadata" + + "\332A\035instance_partition,field_mask\202\323\344\223\002N2I" + + "/v1/{instance_partition.name=projects/*/" + + "instances/*/instancePartitions/*}:\001*\022\210\002\n" + + "\037ListInstancePartitionOperations\022H.googl" + "e.spanner.admin.instance.v1.ListInstance" - + "PartitionOperationsResponse\"P\332A\006parent\202\323" - + "\344\223\002A\022?/v1/{parent=projects/*/instances/*" - + "}/instancePartitionOperations\022\211\002\n\014MoveIn" - + "stance\0225.google.spanner.admin.instance.v" - + "1.MoveInstanceRequest\032\035.google.longrunni" - + "ng.Operation\"\242\001\312An\n5google.spanner.admin" - + ".instance.v1.MoveInstanceResponse\0225googl" - + "e.spanner.admin.instance.v1.MoveInstance" - + "Metadata\202\323\344\223\002+\"&/v1/{name=projects/*/ins" - + "tances/*}:move:\001*\032x\312A\026spanner.googleapis" - + ".com\322A\\https://www.googleapis.com/auth/c" - + "loud-platform,https://www.googleapis.com" - + "/auth/spanner.adminB\213\002\n$com.google.spann" - + "er.admin.instance.v1B\031SpannerInstanceAdm" - + "inProtoP\001ZFcloud.google.com/go/spanner/a" - + "dmin/instance/apiv1/instancepb;instancep" - + "b\252\002&Google.Cloud.Spanner.Admin.Instance." - + "V1\312\002&Google\\Cloud\\Spanner\\Admin\\Instance" - + "\\V1\352\002+Google::Cloud::Spanner::Admin::Ins" - + "tance::V1b\006proto3" + + "PartitionOperationsRequest\032I.google.span" + + "ner.admin.instance.v1.ListInstancePartit" + + "ionOperationsResponse\"P\332A\006parent\202\323\344\223\002A\022?" + + "/v1/{parent=projects/*/instances/*}/inst" + + "ancePartitionOperations\022\211\002\n\014MoveInstance" + + "\0225.google.spanner.admin.instance.v1.Move" + + "InstanceRequest\032\035.google.longrunning.Ope" + + "ration\"\242\001\312An\n5google.spanner.admin.insta" + + "nce.v1.MoveInstanceResponse\0225google.span" + + "ner.admin.instance.v1.MoveInstanceMetada" + + "ta\202\323\344\223\002+\"&/v1/{name=projects/*/instances" + + "/*}:move:\001*\032x\312A\026spanner.googleapis.com\322A" + + "\\https://www.googleapis.com/auth/cloud-p" + + "latform,https://www.googleapis.com/auth/" + + "spanner.adminB\213\002\n$com.google.spanner.adm" + + "in.instance.v1B\031SpannerInstanceAdminProt" + + "oP\001ZFcloud.google.com/go/spanner/admin/i" + + "nstance/apiv1/instancepb;instancepb\252\002&Go" + + "ogle.Cloud.Spanner.Admin.Instance.V1\312\002&G" + + "oogle\\Cloud\\Spanner\\Admin\\Instance\\V1\352\002+" + + "Google::Cloud::Spanner::Admin::Instance:" + + ":V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -729,11 +740,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Reconciling", "State", "FreeInstanceAvailability", + "AllowedProcessingUnits", "QuorumType", "StorageLimitPerProcessingUnit", }); - internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_descriptor = + internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor = internal_static_google_spanner_admin_instance_v1_InstanceConfig_descriptor.getNestedType(0); + internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_spanner_admin_instance_v1_InstanceConfig_AllowedProcessingUnits_descriptor, + new java.lang.String[] { + "MinProcessingUnits", "MaxProcessingUnits", "ProcessingUnitIncrement", + }); + internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_descriptor = + internal_static_google_spanner_admin_instance_v1_InstanceConfig_descriptor.getNestedType(1); internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_descriptor, diff --git a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto index d16ab2ca5835..1d57e2b0dc3c 100644 --- a/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ b/java-spanner/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -748,6 +748,21 @@ message InstanceConfig { QUOTA_EXCEEDED = 4; } + // Defines a range of processing units supported by an instance configuration. + message AllowedProcessingUnits { + // The minimum value of processing units applicable to this interval, + // inclusive. + int32 min_processing_units = 1; + + // The maximum value of processing units applicable to this interval, + // inclusive. If unset, there is no predefined limit to the supported + // number of processing units, although project quota limits still apply. + int32 max_processing_units = 2; + + // Allowed increments of processing units between “min” and “max”. + int32 processing_unit_increment = 3; + } + // Indicates the quorum type of this instance configuration. enum QuorumType { // Quorum type not specified. @@ -861,6 +876,20 @@ message InstanceConfig { FreeInstanceAvailability free_instance_availability = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Defines the ranges of allowed processing units supported by + // this instance configuration. If multiple ranges are specified, an instance + // using this configuration may use a valid increment in any of the given + // ranges. For example, an allowed_processing_units specification of + // `[{min_processing_units:100, max_processing_units:900, + // processing_unit_increment:100}, {min_processing_units:1000, + // processing_unit_increment:1000}]` specifies that the instance configuration + // supports instances with quantities of processing units in multiples of 100 + // processing units (100, 200, 300 and so on) up to and including 900 + // processing units and quantities that are at least 1000 processing units and + // multiples of 1000 processing units (1000, 2000, 3000 and so on). + repeated AllowedProcessingUnits allowed_processing_units = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The `QuorumType` of the instance configuration. QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/librarian.yaml b/librarian.yaml index 0102e1667e6d..e28da4e4ce6f 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -16,8 +16,8 @@ version: v0.49.0 repo: googleapis/google-cloud-java sources: googleapis: - commit: e7513c828b8db536fa12fc5493d541f323aedf90 - sha256: 2ef69787d1b7c2a60fdc8dae745435d115b95e45cc3262c050f4eccfd1889c27 + commit: 14a161a98ef045be80c12ab69d924504a756f109 + sha256: ce3cee2da77fbdff0e269bc520dc61e8b32efcdec7628b39b9e474a02bc951f6 showcase: commit: 5158967e8a41c751b15776142d190428ddb7e99f sha256: a31271ff2cdeb7cce91e93a4d58a66dcaaac574c51cc14bd74577ab1eafd3ccd From ffa8063dcdf5ea25d56cdbb07aa8788423399fc1 Mon Sep 17 00:00:00 2001 From: Siddharth Agrawal Date: Wed, 21 Oct 2026 11:09:13 -0700 Subject: [PATCH 09/35] feat: include writerId as part of trace id (#13488) --- .../bigquery/storage/v1/ConnectionWorker.java | 32 ++++++-- .../storage/v1/ConnectionWorkerPool.java | 12 ++- .../bigquery/storage/v1/StreamWriter.java | 34 ++++---- .../storage/v1/ConnectionWorkerTest.java | 81 ++++++++++++++++++- 4 files changed, 127 insertions(+), 32 deletions(-) diff --git a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java index cfa4a906f6bf..707d359ccaab 100644 --- a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java +++ b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -19,6 +19,7 @@ import com.google.api.core.NanoClock; import com.google.api.core.SettableApiFuture; import com.google.api.gax.batching.FlowController; +import com.google.api.gax.core.GaxProperties; import com.google.api.gax.retrying.ExponentialRetryAlgorithm; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.TimedAttemptSettings; @@ -127,11 +128,6 @@ class ConnectionWorker implements AutoCloseable { */ private final FlowController.LimitExceededBehavior limitExceededBehavior; - /* - * TraceId for debugging purpose. - */ - private final String traceId; - /* * Enables compression on the wire. */ @@ -577,6 +573,7 @@ public ConnectionWorker( long maxInflightBytes, Duration maxRetryDuration, FlowController.LimitExceededBehavior limitExceededBehavior, + String clientlibId, String traceId, @Nullable String compressorName, BigQueryWriteSettings clientSettings, @@ -593,6 +590,7 @@ public ConnectionWorker( maxInflightBytes, maxRetryDuration, limitExceededBehavior, + clientlibId, traceId, compressorName, clientSettings, @@ -610,6 +608,7 @@ public ConnectionWorker( long maxInflightBytes, Duration maxRetryDuration, FlowController.LimitExceededBehavior limitExceededBehavior, + String clientlibId, String traceId, @Nullable String compressorName, BigQueryWriteSettings clientSettings, @@ -626,6 +625,7 @@ public ConnectionWorker( maxInflightBytes, maxRetryDuration, limitExceededBehavior, + clientlibId, traceId, compressorName, clientSettings, @@ -643,6 +643,7 @@ public ConnectionWorker( long maxInflightBytes, Duration maxRetryDuration, FlowController.LimitExceededBehavior limitExceededBehavior, + String clientlibId, String traceId, @Nullable String compressorName, BigQueryWriteSettings clientSettings, @@ -667,14 +668,14 @@ public ConnectionWorker( this.maxInflightRequests = maxInflightRequests; this.maxInflightBytes = maxInflightBytes; this.limitExceededBehavior = limitExceededBehavior; - this.traceId = traceId; + String fullTraceId = getFullTraceId(clientlibId, this.writerId, traceId); this.waitingRequestQueue = new LinkedList(); this.inflightRequestQueue = new LinkedList(); this.compressorName = compressorName; this.retrySettings = retrySettings; this.requestProfilerHook = new RequestProfiler.RequestProfilerHook(enableRequestProfiler); this.telemetryMetrics = - new TelemetryMetrics(this, enableOpenTelemetry, getTableName(), writerId, traceId); + new TelemetryMetrics(this, enableOpenTelemetry, getTableName(), writerId, fullTraceId); this.healthCheckMetrics = new HealthCheckMetrics(); this.isMultiplexing = isMultiplexing; @@ -1004,6 +1005,17 @@ static long calculateSleepTimeMilli(long retryCount) { return (long) Math.min(Math.pow(2, retryCount) * 50, 60000); } + @VisibleForTesting + static String getFullTraceId(String clientlibId, String writerId, String traceId) { + String clientWithVersion = + clientlibId + ":" + GaxProperties.getLibraryVersion(StreamWriter.class) + ":" + writerId; + if (traceId == null || traceId.isEmpty()) { + return clientWithVersion; + } else { + return clientWithVersion + " " + traceId; + } + } + @VisibleForTesting void setTestOnlyAppendLoopSleepTime(long testOnlyAppendLoopSleepTime) { this.testOnlyAppendLoopSleepTime = testOnlyAppendLoopSleepTime; @@ -1291,7 +1303,11 @@ private void appendLoop() { // If we are at the first request for every table switch, including the first request in // the connection, we will attach both stream name and table schema to the request. destinationSet.add(streamName); - originalRequestBuilder.setTraceId(wrapper.streamWriter.getFullTraceId()); + originalRequestBuilder.setTraceId( + getFullTraceId( + wrapper.streamWriter.getClientId(), + this.writerId, + wrapper.streamWriter.getTraceId())); } else if (!isMultiplexing) { // If we are not in multiplexing and not in the first request, clear the stream name. originalRequestBuilder.clearWriteStream(); diff --git a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java index f9c722c270fb..edffe603ee9e 100644 --- a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java +++ b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerPool.java @@ -317,7 +317,8 @@ private ConnectionWorker createOrReuseConnectionWorker( streamWriter.getStreamName(), streamWriter.getLocation(), streamWriter.getWriterSchema(), - streamWriter.getFullTraceId()); + streamWriter.getClientId(), + streamWriter.getTraceId()); } else { ConnectionWorker existingBestConnection = pickBestLoadConnection( @@ -337,7 +338,8 @@ private ConnectionWorker createOrReuseConnectionWorker( streamWriter.getStreamName(), streamWriter.getLocation(), streamWriter.getWriterSchema(), - streamWriter.getFullTraceId()); + streamWriter.getClientId(), + streamWriter.getTraceId()); } else { // Stick to the original connection if all the connections are overwhelmed. if (existingConnectionWorker != null) { @@ -396,7 +398,8 @@ private ConnectionWorker createConnectionWorker( String streamName, String location, AppendFormats.AppendRowsSchema writeSchema, - String fullTraceId) + String clientId, + String traceId) throws IOException { if (enableTesting) { // Though atomic integer is super lightweight, add extra if check in case adding future logic. @@ -411,7 +414,8 @@ private ConnectionWorker createConnectionWorker( maxInflightBytes, maxRetryDuration, limitExceededBehavior, - fullTraceId, + clientId, + traceId, compressorName, clientSettings, retrySettings, diff --git a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java index 2da1b0f61791..6bf659eb173c 100644 --- a/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java +++ b/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java @@ -19,7 +19,6 @@ import com.google.api.gax.batching.FlowController; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; -import com.google.api.gax.core.GaxProperties; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.auth.Credentials; @@ -93,8 +92,11 @@ private static Cache allocateProjectLocationCache() { */ private final String streamName; - /** This is the library version may or may not include library version id. */ - private final String fullTraceId; + /** Client id of the writer. */ + private final String clientId; + + /** User provided trace id. */ + private final String traceId; /** Every writer has a fixed proto schema or arrow schema. */ private final AppendRowsSchema writerSchema; @@ -256,7 +258,8 @@ private StreamWriter(Builder builder) throws IOException { BigQueryWriteSettings clientSettings = getBigQueryWriteSettings(builder); this.requestProfilerHook = new RequestProfiler.RequestProfilerHook(builder.enableRequestProfiler); - this.fullTraceId = builder.getFullTraceId(); + this.clientId = builder.clientId; + this.traceId = builder.traceId; if (builder.enableRequestProfiler) { // Request profiler is enabled on singleton level, from now on a periodical flush will be // started @@ -275,7 +278,8 @@ private StreamWriter(Builder builder) throws IOException { builder.maxInflightBytes, builder.maxRetryDuration, builder.limitExceededBehavior, - builder.getFullTraceId(), + builder.clientId, + builder.traceId, builder.compressorName, clientSettings, builder.retrySettings, @@ -395,8 +399,12 @@ static void recreateProjectLocationCache(long durationExpireMillis) { projectAndDatasetToLocation = allocateProjectLocationCache(); } - String getFullTraceId() { - return fullTraceId; + String getClientId() { + return clientId; + } + + String getTraceId() { + return traceId; } AppendRowsRequest.MissingValueInterpretation getDefaultValueInterpretation() { @@ -1119,18 +1127,6 @@ public Builder setRetrySettings(RetrySettings retrySettings) { public StreamWriter build() throws IOException { return new StreamWriter(this); } - - String getFullTraceId() { - String clientWithVersion = - GaxProperties.getLibraryVersion(StreamWriter.class).isEmpty() - ? clientId - : clientId + ":" + GaxProperties.getLibraryVersion(StreamWriter.class); - if (traceId == null || traceId.isEmpty()) { - return clientWithVersion; - } else { - return clientWithVersion + " " + traceId; - } - } } private String generateRequestUniqueId() { diff --git a/java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java b/java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java index fee2cd142047..177751412b8c 100644 --- a/java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java +++ b/java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/ConnectionWorkerTest.java @@ -24,6 +24,7 @@ import com.google.api.core.ApiFuture; import com.google.api.gax.batching.FlowController; +import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.testing.MockGrpcService; import com.google.api.gax.grpc.testing.MockServiceHelper; @@ -518,6 +519,7 @@ void testAppendButInflightQueueFull() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -578,6 +580,7 @@ void testThrowExceptionWhileWithinAppendLoop() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -650,6 +653,7 @@ void testLocationMismatch() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -686,6 +690,7 @@ void testStreamNameMismatch() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -750,7 +755,8 @@ private ConnectionWorker createMultiplexedConnectionWorker( maxBytes, maxRetryDuration, FlowController.LimitExceededBehavior.Block, - TEST_TRACE_ID, + "java-streamwriter", + traceId, null, client.getSettings(), retrySettings, @@ -927,6 +933,7 @@ void testGetLoad_timeSinceLastCallback() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -996,6 +1003,7 @@ void testThrowExceptionWhileWithinAppendLoop_MaxWaitTimeExceed() throws Exceptio 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1074,6 +1082,7 @@ void testLongTimeIdleWontFail() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1121,6 +1130,7 @@ private void exerciseOpenTelemetryAttributesWithStreamNames(String streamName, S 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", null, null, client.getSettings(), @@ -1163,6 +1173,7 @@ void exerciseOpenTelemetryAttributesWithTraceId( 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", traceId, null, client.getSettings(), @@ -1234,6 +1245,7 @@ void testDoubleDisconnectWithShorterRetryDuration() throws Exception { 100000, Duration.ofMillis(1), // very small maxRetryDuration FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1267,6 +1279,7 @@ void testHealthCheck() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1342,6 +1355,7 @@ void testHealthCheckThresholds() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1446,6 +1460,7 @@ void testInflightRetryCountHealthMetric() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1533,6 +1548,7 @@ private ConnectionWorker createConnectionWorker() throws IOException { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1559,6 +1575,7 @@ void testInflightRetryCountHealthMetricExactlyOnce() throws Exception { 100000, Duration.ofSeconds(100), FlowController.LimitExceededBehavior.Block, + "java-streamwriter", TEST_TRACE_ID, null, client.getSettings(), @@ -1843,4 +1860,66 @@ void testWindowStats() throws Exception { assertThat(thirdWindowStats.getWindowMillis()).isAtLeast(0L); } } + + @Test + void testTraceIdContainsWriterId() throws Exception { + ProtoSchema schema1 = createProtoSchema("foo"); + StreamWriter sw1 = + StreamWriter.newBuilder(TEST_STREAM_1, client) + .setLocation("us") + .setWriterSchema(schema1) + .setTraceId(TEST_TRACE_ID) + .build(); + testBigQueryWrite.addResponse(createAppendResponse(0)); + + try (ConnectionWorker connectionWorker = + new ConnectionWorker( + TEST_STREAM_1, + "us", + createProtoSchema("foo"), + 6, + 100000, + Duration.ofSeconds(100), + FlowController.LimitExceededBehavior.Block, + "java-streamwriter", + TEST_TRACE_ID, + null, + client.getSettings(), + retrySettings, + /* enableRequestProfiler= */ false, + /* enableOpenTelemetry= */ false, + /* isMultiplexing= */ false)) { + + ApiFuture future = + sendTestMessage( + connectionWorker, sw1, createFooProtoRows(new String[] {String.valueOf(0)}), 0); + future.get(); + + String writerId = connectionWorker.getWriterId(); + assertThat(testBigQueryWrite.getAppendRequests()).hasSize(1); + AppendRowsRequest serverRequest = testBigQueryWrite.getAppendRequests().get(0); + + String expectedTraceId = + "java-streamwriter:" + + GaxProperties.getLibraryVersion(StreamWriter.class) + + ":" + + writerId + + " " + + TEST_TRACE_ID; + assertThat(serverRequest.getTraceId()).isEqualTo(expectedTraceId); + } + } + + @Test + void testGetFullTraceId() { + String version = GaxProperties.getLibraryVersion(StreamWriter.class); + assertThat(ConnectionWorker.getFullTraceId("java-streamwriter", "writer-123", TEST_TRACE_ID)) + .isEqualTo("java-streamwriter:" + version + ":writer-123 " + TEST_TRACE_ID); + assertThat(ConnectionWorker.getFullTraceId("java-streamwriter", "writer-123", "")) + .isEqualTo("java-streamwriter:" + version + ":writer-123"); + assertThat(ConnectionWorker.getFullTraceId("java-streamwriter", "writer-123", null)) + .isEqualTo("java-streamwriter:" + version + ":writer-123"); + assertThat(ConnectionWorker.getFullTraceId("java-streamwriter", "", null)) + .isEqualTo("java-streamwriter:" + version + ":"); + } } From ff6991212e07c5098bf237344ebbbed1f8e37fb5 Mon Sep 17 00:00:00 2001 From: Dhriti07 <56169283+Dhriti07@users.noreply.github.com> Date: Thu, 22 Oct 2026 00:08:42 +0530 Subject: [PATCH 10/35] test(storage): run ITAppendableUploadTest with RAPID bucket in us-central1-a (#14714) This PR moves the RAPID test bucket to us-central1-a and temporarily ignores takeoverAndAppendWithIncorrectChecksumFails, the only test that hit the quota there in a trial run. --------- Co-authored-by: Dhriti Chopra --- .../java/com/google/cloud/storage/ITAppendableUploadTest.java | 1 + .../cloud/storage/it/runner/registry/BackendResources.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java index e83cbccefdcf..d278a24ee77f 100644 --- a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java +++ b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java @@ -399,6 +399,7 @@ public void takeoverAndAppendWithCorrectChecksumWorks() throws Exception { assertThat(done2.getCrc32c()).isEqualTo(Utils.crc32cCodec.encode(fullContent.getCrc32c())); } + @Ignore("Temporarily disabled: hits the Rapid storage quota in CI.") @Test @CrossRun.Ignore(backends = {Backend.TEST_BENCH}) public void takeoverAndAppendWithIncorrectChecksumFails() throws Exception { diff --git a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java index bfe9a5768754..86ddcaccc72e 100644 --- a/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java +++ b/java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java @@ -262,7 +262,7 @@ static BackendResources of( .setLocation("us-central1") .setCustomPlacementConfig( CustomPlacementConfig.newBuilder() - .setDataLocations(ImmutableList.of("us-central1-c")) + .setDataLocations(ImmutableList.of("us-central1-a")) .build()) .setStorageClass(StorageClass.valueOf("RAPID")) .setHierarchicalNamespace( From 6b99452a5f9a987add9708b74fe35f23a4f13fc3 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Wed, 21 Oct 2026 15:20:15 -0700 Subject: [PATCH 11/35] fix(bigquery-jdbc): stop producer and release resources on ResultSet.close (#14712) --- .../bigquery/jdbc/BigQueryArrowResultSet.java | 33 ++- .../bigquery/jdbc/BigQueryJsonResultSet.java | 23 +- .../bigquery/jdbc/BigQueryStatement.java | 147 +++++++----- .../jdbc/BigQueryArrowResultSetTest.java | 32 +++ .../bigquery/jdbc/BigQueryStatementTest.java | 213 ++++++++++++++++++ 5 files changed, 386 insertions(+), 62 deletions(-) diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java index b6cdc393173f..607b76bec92e 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java @@ -246,8 +246,12 @@ private void deserializeArrowBatch(ArrowRecordBatch batch) throws SQLException { @Override public void close() { LOG.fineTrace("close", () -> String.format("Closing BigQueryArrowResultSet %s.", this)); - vectorSchemaRoot.close(); - allocator.close(); + if (vectorSchemaRoot != null) { + vectorSchemaRoot.close(); + } + if (allocator != null) { + allocator.close(); + } } } @@ -279,6 +283,7 @@ public boolean next() throws SQLException { // Advance the cursor. Potentially blocking operation. try (Scope scope = makeOriginalContextCurrent()) { BigQueryArrowBatchWrapper batchWrapper = this.buffer.take(); + checkClosed(); if (batchWrapper.getException() != null) { throw backgroundFetchError(batchWrapper.getException()); } @@ -542,13 +547,29 @@ private String formatRangeElement(Object element, StandardSQLTypeName elementTyp @Override public void close() { + if (this.isClosed) { + return; + } LOG.fineTrace("close", () -> String.format("Closing BigqueryArrowResultSet %s.", this)); this.isClosed = true; - if (ownedTask != null) { - // cancel the producer task when result set is closed - ownedTask.cancel(true); + try { + if (ownedTask != null) { + // cancel the producer task when result set is closed + ownedTask.cancel(true); + } + if (this.buffer != null) { + this.buffer.clear(); + // Unblock any consumer thread currently waiting on buffer.take() in next() + this.buffer.offer(BigQueryArrowBatchWrapper.of(null, true)); + } + if (this.arrowDeserializer != null) { + this.arrowDeserializer.close(); + } else if (this.allocator != null) { + this.allocator.close(); + } + } finally { + super.close(); } - super.close(); } @Override diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java index c8a2451aeeaa..46b6c06e8fc1 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java @@ -227,6 +227,7 @@ public boolean next() throws SQLException { try { // Advance the cursor,Potentially blocking operation this.cursor = this.buffer.take(); + checkClosed(); if (this.cursor.getException() != null) { throw backgroundFetchError(this.cursor.getException()); } @@ -382,16 +383,28 @@ private FieldValue getObjectInternal(int columnIndex) throws SQLException { @Override public void close() { + if (this.isClosed) { + return; + } LOG.fineTrace("close", () -> String.format("Closing BigqueryJsonResultSet %s.", this)); this.isClosed = true; - if (ownedTasks != null) { - for (Future ownedTask : ownedTasks) { - if (ownedTask != null) { - ownedTask.cancel(true); + try { + if (ownedTasks != null) { + for (Future ownedTask : ownedTasks) { + if (ownedTask != null) { + ownedTask.cancel(true); + } } } + if (this.buffer != null) { + this.buffer.clear(); + // Unblock any consumer thread currently waiting on buffer.take() in next() + this.buffer.offer(BigQueryFieldValueListWrapper.ofEndOfStream(null)); + } + this.cursor = null; + } finally { + super.close(); } - super.close(); } @Override diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index 0654d6036f0f..060c60c607b2 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -19,6 +19,7 @@ import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ServerStream; import com.google.api.gax.rpc.StatusCode; import com.google.cloud.Tuple; import com.google.cloud.bigquery.BigQuery; @@ -62,7 +63,6 @@ import com.google.cloud.bigquery.storage.v1.ReadSession; import com.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; import com.google.common.annotations.VisibleForTesting; -import com.google.common.util.concurrent.Uninterruptibles; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.opentelemetry.api.common.AttributeKey; @@ -104,6 +104,8 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); public static final int DEFAULT_BUFFER_SIZE = BigQuerySettings.DEFAULT_NUM_BUFFERED_ROWS * 2; + // Bounds in-memory ArrowRecordBatch buffering per ResultSet (~15-20 MB of in-flight batches), + // keeping the gRPC ReadRows stream saturated while preventing unbounded heap accumulation. static final int DEFAULT_ARROW_BUFFER_SIZE = 32; private static final String DEFAULT_DATASET_NAME = "_google_jdbc"; private static final String DEFAULT_TABLE_NAME = "temp_table_"; @@ -535,6 +537,8 @@ private void closeStatementResources() throws SQLException { tmp.close(); } this.batchQueries.clear(); + this.arrowBatchWrapperBlockingQueue = null; + this.bigQueryFieldValueListWrapperBlockingQueue = null; this.currentUpdateCount = -1; this.currentJobIdIndex = -1; if (this.connection != null) { @@ -1005,6 +1009,8 @@ Future populateArrowBufferedQueue( String streamName = readSession.getStreams(0).getName(); while (true) { + ServerStream stream = null; + boolean streamCompleted = false; try { ReadRowsRequest readRowsRequest = ReadRowsRequest.newBuilder() @@ -1014,19 +1020,23 @@ Future populateArrowBufferedQueue( // Process each block of rows as they arrive and decode using our simple row // reader. - com.google.api.gax.rpc.ServerStream stream = - bqReadClient.readRowsCallable().call(readRowsRequest); + stream = bqReadClient.readRowsCallable().call(readRowsRequest); for (ReadRowsResponse response : stream) { - if (Thread.currentThread().isInterrupted() || executor.isShutdown()) { - break; + if (isWorkerShuttingDown()) { + throw new InterruptedException( + "Arrow stream reading was interrupted or shut down before completion."); } ArrowRecordBatch currentBatch = response.getArrowRecordBatch(); - Uninterruptibles.putUninterruptibly( - arrowBatchWrapperBlockingQueue, + arrowBatchWrapperBlockingQueue.put( BigQueryArrowBatchWrapper.of(currentBatch)); rowsRead += response.getRowCount(); } + if (isWorkerShuttingDown()) { + throw new InterruptedException( + "Arrow stream reading was interrupted or shut down before completion."); + } + streamCompleted = true; break; } catch (ApiException e) { if (e.getStatusCode().getCode() == StatusCode.Code.NOT_FOUND) { @@ -1049,10 +1059,16 @@ Future populateArrowBufferedQueue( "Connection interrupted during arrow stream read, retrying. attempt: %d", retryCount); Thread.sleep(RETRY_DELAY_MS); + } finally { + if (stream != null && !streamCompleted) { + stream.cancel(); + } } } } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + arrowBatchWrapperBlockingQueue.clear(); LOG.log( Level.WARNING, "\n" @@ -1060,10 +1076,11 @@ Future populateArrowBufferedQueue( + " Interrupted @ arrowStreamProcessor", e); enqueueError(arrowBatchWrapperBlockingQueue, e); - Thread.currentThread().interrupt(); } catch (Exception e) { if (e.getCause() instanceof InterruptedException || Thread.currentThread().isInterrupted()) { + Thread.currentThread().interrupt(); + arrowBatchWrapperBlockingQueue.clear(); LOG.log( Level.WARNING, "\n" @@ -1071,7 +1088,6 @@ Future populateArrowBufferedQueue( + " Interrupted @ arrowStreamProcessor", e); enqueueError(arrowBatchWrapperBlockingQueue, e); - Thread.currentThread().interrupt(); } else { LOG.log( Level.WARNING, @@ -1312,11 +1328,9 @@ Future runNextPageTaskAsync( try { while (currentPageToken != null) { // do not process further pages and shutdown - if (Thread.currentThread().isInterrupted() || executor.isShutdown()) { - LOG.warning( - "%s Interrupted @ runNextPageTaskAsync", - Thread.currentThread().getName()); - break; + if (isWorkerShuttingDown()) { + throw new InterruptedException( + "Pagination was interrupted or shut down before completion."); } SpanBuilder spanBuilder = @@ -1338,8 +1352,7 @@ Future runNextPageTaskAsync( currentPageToken = currentResults.getNextPageToken(); // this will be parsed asynchronously without blocking the current // thread - Uninterruptibles.putUninterruptibly( - rpcResponseQueue, Tuple.of(currentResults, true)); + rpcResponseQueue.put(Tuple.of(currentResults, true)); LOG.fine( "Fetched %d results from the server in %d ms.", querySettings.getMaxResultPerPage(), @@ -1348,14 +1361,22 @@ Future runNextPageTaskAsync( paginationSpan.end(); } } + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + LOG.warning( + "%s Interrupted @ runNextPageTaskAsync: %s", + Thread.currentThread().getName(), ex.getMessage()); + enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex); } catch (Exception ex) { - Uninterruptibles.putUninterruptibly( - bigQueryFieldValueListWrapperBlockingQueue, - BigQueryFieldValueListWrapper.ofError(ex)); + if (ex.getCause() instanceof InterruptedException + || Thread.currentThread().isInterrupted()) { + Thread.currentThread().interrupt(); + } + enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex); } finally { // this will stop the parseDataTask as well when the pagination // completes - Uninterruptibles.putUninterruptibly(rpcResponseQueue, Tuple.of(null, false)); + enqueueMarker(rpcResponseQueue, Tuple.of(null, false)); } // We cannot do queryTaskExecutor.shutdownNow() here as populate buffer method may // not @@ -1390,29 +1411,19 @@ Future parseAndPopulateRpcDataAsync( // as we have to process the first page boolean hasRows = true; while (hasRows) { - try { - Tuple nextPageTuple = rpcResponseQueue.take(); - if (nextPageTuple.x() != null) { - fieldValueLists = nextPageTuple.x().getValues(); - } else { - fieldValueLists = null; - } - hasRows = nextPageTuple.y(); - - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - LOG.log( - Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted", - e); - // Thread might get interrupted while calling the Cancel method, which is - // expected, so logging this instead of throwing the exception back - break; + Tuple nextPageTuple = rpcResponseQueue.take(); + if (nextPageTuple.x() != null) { + fieldValueLists = nextPageTuple.x().getValues(); + } else { + fieldValueLists = null; } + hasRows = nextPageTuple.y(); - if (Thread.currentThread().isInterrupted() - || executor.isShutdown() - || fieldValueLists == null) { + if (isWorkerShuttingDown()) { + throw new InterruptedException( + "Buffer population was interrupted or shut down before completion."); + } + if (fieldValueLists == null) { // do not process further pages and shutdown (outerloop) break; } @@ -1421,12 +1432,11 @@ Future parseAndPopulateRpcDataAsync( long results = 0; for (FieldValueList fieldValueList : fieldValueLists) { - if (Thread.currentThread().isInterrupted() || executor.isShutdown()) { - // do not process further pages and shutdown (inner loop) - break; + if (isWorkerShuttingDown()) { + throw new InterruptedException( + "Buffer population was interrupted or shut down before completion."); } - Uninterruptibles.putUninterruptibly( - bigQueryFieldValueListWrapperBlockingQueue, + bigQueryFieldValueListWrapperBlockingQueue.put( BigQueryFieldValueListWrapper.of( schema.getFields(), fieldValueList, isComplexColumn)); results += 1; @@ -1436,9 +1446,21 @@ Future parseAndPopulateRpcDataAsync( results, (int) ((System.nanoTime() - startTime) / 1000000)); } + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + bigQueryFieldValueListWrapperBlockingQueue.clear(); + LOG.log( + Level.WARNING, + "\n" + + Thread.currentThread().getName() + + " Interrupted @ populateBufferAsync", + ex); + enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex); } catch (Exception ex) { if (ex.getCause() instanceof InterruptedException || Thread.currentThread().isInterrupted()) { + Thread.currentThread().interrupt(); + bigQueryFieldValueListWrapperBlockingQueue.clear(); LOG.log( Level.WARNING, "\n" @@ -1446,7 +1468,6 @@ Future parseAndPopulateRpcDataAsync( + " Interrupted @ populateBufferAsync", ex); enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex); - Thread.currentThread().interrupt(); } else { LOG.log( Level.WARNING, @@ -1933,20 +1954,44 @@ enum QueryDialectType { BIG_QUERY } + private boolean isWorkerShuttingDown() { + if (Thread.currentThread().isInterrupted()) { + return true; + } + BigQueryConnection conn = this.connection; + if (conn == null) { + return true; + } + ExecutorService executor = conn.getExecutorService(); + return executor != null && executor.isShutdown(); + } + + private void enqueueMarker(BlockingQueue queue, T marker) { + if (isWorkerShuttingDown()) { + queue.offer(marker); + return; + } + try { + queue.put(marker); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + } + private void enqueueError(BlockingQueue queue, Exception e) { - Uninterruptibles.putUninterruptibly(queue, BigQueryArrowBatchWrapper.ofError(e)); + enqueueMarker(queue, BigQueryArrowBatchWrapper.ofError(e)); } private void enqueueEndOfStream(BlockingQueue queue) { - Uninterruptibles.putUninterruptibly(queue, BigQueryArrowBatchWrapper.of(null, true)); + enqueueMarker(queue, BigQueryArrowBatchWrapper.of(null, true)); } private void enqueueBufferError(BlockingQueue queue, Exception e) { - Uninterruptibles.putUninterruptibly(queue, BigQueryFieldValueListWrapper.ofError(e)); + enqueueMarker(queue, BigQueryFieldValueListWrapper.ofError(e)); } private void enqueueBufferEndOfStream(BlockingQueue queue) { - Uninterruptibles.putUninterruptibly(queue, BigQueryFieldValueListWrapper.ofEndOfStream(null)); + enqueueMarker(queue, BigQueryFieldValueListWrapper.ofEndOfStream(null)); } QueryStatistics describePositionalParameterQuery(String query) diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java index 8681fd9559a5..6f8a249513b1 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java @@ -24,6 +24,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import com.google.cloud.bigquery.Field; import com.google.cloud.bigquery.Field.Mode; @@ -339,6 +341,36 @@ public void testIsClosed() { assertThat(bigQueryArrowResultSet.isClosed()).isFalse(); } + @Test + public void testCloseCancelsProducerClearsBufferAndIsIdempotent() + throws SQLException, IOException { + ArrowSchema arrowSchema = + ArrowSchema.newBuilder() + .setSerializedSchema(serializeSchema(vectorSchemaRoot.getSchema())) + .build(); + Future workerTask = mock(Future.class); + BlockingQueue queue = new LinkedBlockingDeque<>(4); + queue.add(arrowBatchWrapper); + queue.add(arrowBatchWrapperLast); + + BigQueryArrowResultSet rs = + BigQueryArrowResultSet.of(QUERY_SCHEMA, arrowSchema, 1, statement, queue, workerTask, null); + + assertThat(rs.isClosed()).isFalse(); + assertThat(queue).hasSize(2); + + rs.close(); + assertThat(rs.isClosed()).isTrue(); + assertThat(queue).hasSize(1); + assertThat(queue.peek().getCurrentArrowBatch()).isNull(); + assertThat(queue.peek().isLast()).isTrue(); + verify(workerTask, times(1)).cancel(true); + + // Second close() call should be a no-op + rs.close(); + verify(workerTask, times(1)).cancel(true); + } + @Test public void testResultSetHoldability() throws SQLException { assertThat(bigQueryArrowResultSet.getHoldability()) diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java index a442efd61ed4..41f3731c2806 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java @@ -33,6 +33,8 @@ import static org.mockito.Mockito.withSettings; import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.StatusCode; import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; @@ -62,11 +64,15 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.jdbc.BigQueryStatement.JobIdWrapper; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; import com.google.cloud.bigquery.storage.v1.ArrowSchema; import com.google.cloud.bigquery.storage.v1.ArrowSerializationOptions; import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.cloud.bigquery.storage.v1.ReadStream; import com.google.common.collect.ImmutableList; import com.google.common.collect.Maps; import io.opentelemetry.api.baggage.Baggage; @@ -83,14 +89,19 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Stream; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.BitVector; @@ -1347,4 +1358,206 @@ public void testProcessArrowResultSetUsesBoundedQueueCapacity() throws SQLExcept BigQueryStatement.DEFAULT_ARROW_BUFFER_SIZE, defaultQueueCaptor.getValue().remainingCapacity()); } + + @Test + public void testPopulateArrowBufferedQueueStopsAndCancelsStreamWhenResultSetClosedWhileQueueFull() + throws Exception { + BlockingQueue boundedQueue = new LinkedBlockingDeque<>(1); + ReadSession readSession = + ReadSession.newBuilder() + .addStreams( + ReadStream.newBuilder().setName("projects/p/locations/l/sessions/s/streams/0")) + .build(); + + ReadRowsResponse batchResponse = + ReadRowsResponse.newBuilder() + .setArrowRecordBatch(ArrowRecordBatch.getDefaultInstance()) + .build(); + + CountDownLatch secondBatchReturnedLatch = new CountDownLatch(1); + AtomicBoolean streamCancelled = new AtomicBoolean(false); + + @SuppressWarnings("unchecked") + ServerStream serverStream = mock(ServerStream.class); + Mockito.doAnswer( + invocation -> { + streamCancelled.set(true); + return null; + }) + .when(serverStream) + .cancel(); + + Iterator responseIterator = + new Iterator() { + private int count = 0; + + @Override + public boolean hasNext() { + return true; + } + + @Override + public ReadRowsResponse next() { + count++; + if (count == 2) { + secondBatchReturnedLatch.countDown(); + } + return batchResponse; + } + }; + doReturn(responseIterator).when(serverStream).iterator(); + + @SuppressWarnings("unchecked") + ServerStreamingCallable callable = + mock(ServerStreamingCallable.class); + doReturn(serverStream).when(callable).call(any(ReadRowsRequest.class)); + + BigQueryReadClient readClient = mock(BigQueryReadClient.class); + doReturn(callable).when(readClient).readRowsCallable(); + + Future producerFuture = + bigQueryStatement.populateArrowBufferedQueue(readSession, boundedQueue, readClient); + + // Wait until the first batch is in the queue and the second batch has been yielded by the + // stream iterator (so the producer thread is blocked or about to block on boundedQueue.put()). + assertTrue(secondBatchReturnedLatch.await(5, TimeUnit.SECONDS)); + assertEquals(1, boundedQueue.size()); + + BigQueryArrowResultSet rs = + BigQueryArrowResultSet.of( + Schema.of(fieldList), + arrowSchema, + 100L, + bigQueryStatement, + boundedQueue, + producerFuture, + bigquery); + + // Closing the ResultSet while the queue is full must cancel the producer task, + // unblock the producer thread, cancel the underlying ServerStream, and clear the buffer. + rs.close(); + + assertTrue(producerFuture.isCancelled()); + testExecutorService.shutdown(); + assertTrue( + testExecutorService.awaitTermination(5, TimeUnit.SECONDS), + "Producer thread should terminate promptly after ResultSet.close()"); + assertTrue(streamCancelled.get(), "ServerStream.cancel() should be called on early close"); + assertTrue( + boundedQueue.stream().allMatch(w -> w.getCurrentArrowBatch() == null), + "No ArrowRecordBatch should remain buffered after ResultSet.close()"); + } + + @Test + public void testCancelStatementUnblocksConcurrentArrowResultSetNext() throws Exception { + BlockingQueue emptyQueue = new LinkedBlockingDeque<>(4); + Future producerFuture = mock(Future.class); + BigQueryArrowResultSet rs = + BigQueryArrowResultSet.of( + Schema.of(fieldList), + arrowSchema, + 100L, + bigQueryStatement, + emptyQueue, + producerFuture, + bigquery); + bigQueryStatement.currentResultSet = rs; + + CountDownLatch readerEnteredNext = new CountDownLatch(1); + Future readerFuture = + testExecutorService.submit( + () -> { + readerEnteredNext.countDown(); + rs.next(); + return null; + }); + + assertTrue(readerEnteredNext.await(5, TimeUnit.SECONDS)); + // Give the reader thread a brief moment to block inside emptyQueue.take() + Thread.sleep(50); + + bigQueryStatement.cancel(); + + ExecutionException ex = + assertThrows(ExecutionException.class, () -> readerFuture.get(5, TimeUnit.SECONDS)); + assertTrue(ex.getCause() instanceof SQLException); + } + + @Test + public void testCancelStatementUnblocksConcurrentJsonResultSetNext() throws Exception { + BlockingQueue emptyQueue = new LinkedBlockingDeque<>(4); + BigQueryJsonResultSet rs = + BigQueryJsonResultSet.of( + Schema.of(fieldList), 100L, emptyQueue, bigQueryStatement, null, bigquery); + bigQueryStatement.currentResultSet = rs; + + CountDownLatch readerEnteredNext = new CountDownLatch(1); + Future readerFuture = + testExecutorService.submit( + () -> { + readerEnteredNext.countDown(); + rs.next(); + return null; + }); + + assertTrue(readerEnteredNext.await(5, TimeUnit.SECONDS)); + Thread.sleep(50); + + bigQueryStatement.cancel(); + + ExecutionException ex = + assertThrows(ExecutionException.class, () -> readerFuture.get(5, TimeUnit.SECONDS)); + assertTrue(ex.getCause() instanceof SQLException); + } + + @Test + public void testPopulateArrowBufferedQueueEnqueuesErrorWhenWorkerShuttingDown() throws Exception { + BlockingQueue boundedQueue = new LinkedBlockingDeque<>(4); + ReadSession readSession = + ReadSession.newBuilder() + .addStreams( + ReadStream.newBuilder().setName("projects/p/locations/l/sessions/s/streams/0")) + .build(); + + ReadRowsResponse batchResponse = + ReadRowsResponse.newBuilder() + .setArrowRecordBatch(ArrowRecordBatch.getDefaultInstance()) + .build(); + + @SuppressWarnings("unchecked") + ServerStream serverStream = mock(ServerStream.class); + Iterator responseIterator = + new Iterator() { + @Override + public boolean hasNext() { + // Simulate executor shutdown mid-stream before the next batch is processed + testExecutorService.shutdownNow(); + return true; + } + + @Override + public ReadRowsResponse next() { + return batchResponse; + } + }; + doReturn(responseIterator).when(serverStream).iterator(); + + @SuppressWarnings("unchecked") + ServerStreamingCallable callable = + mock(ServerStreamingCallable.class); + doReturn(serverStream).when(callable).call(any(ReadRowsRequest.class)); + + BigQueryReadClient readClient = mock(BigQueryReadClient.class); + doReturn(callable).when(readClient).readRowsCallable(); + + Future producerFuture = + bigQueryStatement.populateArrowBufferedQueue(readSession, boundedQueue, readClient); + producerFuture.get(5, TimeUnit.SECONDS); + + BigQueryArrowBatchWrapper marker = boundedQueue.poll(5, TimeUnit.SECONDS); + assertNotNull(marker); + assertNotNull( + marker.getException(), + "Stopping early due to worker shutdown must enqueue an error marker rather than normal end-of-stream"); + } } From b27385e3a01c6e94fe964d4e7decd90893f9caad Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 21 Oct 2026 20:35:46 -0400 Subject: [PATCH 12/35] fix(bigquery-jdbc): use one logger per class to stop child-logger registration leak (#14716) b/576218509 - Replace the per-instance `LOG = new BigQueryJdbcCustomLogger(this.toString())` field with one `static final` logger per class in `BigQueryStatement`, `BigQueryConnection`, `BigQueryDatabaseMetaData`, `BigQueryCallableStatement`, `BigQueryPooledConnection` (+ `BigQueryPooledConnectionWrapper`), `PooledConnectionListener`, and `DataSource`. Each logger is named after its own class so the `CLASS` column fallback in the formatter stays correct. - Remove the duplicate `setParent(...)` call in the 1-arg `BigQueryJdbcCustomLogger` constructor; the 2-arg constructor it delegates to already sets the parent. The second call forced a full scan of the parent's child list under the global `treeLock` on every construction. - Add regression tests to `BigQueryJdbcCustomLoggerTest`: - `testLoggerIsParentedToDriverRootLogger` locks in that every logger is still parented to the driver root logger (handlers/levels keep flowing). - `testCreatingStatementsDoesNotRegisterChildLoggers` and `testCreatingDatabaseMetaDataDoesNotRegisterChildLoggers` construct 1,000 objects and assert the root logger's child count does not grow. Both fail on `main` and pass with this change. - Add `--add-opens=java.logging/java.util.logging=ALL-UNNAMED` to the surefire `argLine` (test-only) so the regression tests can read the JDK-internal child-logger list on JDK 17+. No behavior change to per-connection log files or formatting: routing and the `[CONNECTION_ID]` column come from the MDC / record parameters, not from the logger name. --- java-bigquery-jdbc/pom.xml | 7 +- .../jdbc/BigQueryCallableStatement.java | 3 +- .../bigquery/jdbc/BigQueryConnection.java | 3 +- .../jdbc/BigQueryDatabaseMetaData.java | 3 +- .../jdbc/BigQueryJdbcCustomLogger.java | 1 - .../jdbc/BigQueryPooledConnection.java | 6 +- .../bigquery/jdbc/BigQueryStatement.java | 3 +- .../cloud/bigquery/jdbc/DataSource.java | 3 +- .../jdbc/PooledConnectionListener.java | 3 +- .../jdbc/BigQueryJdbcCustomLoggerTest.java | 70 +++++++++++++++++++ 10 files changed, 92 insertions(+), 10 deletions(-) diff --git a/java-bigquery-jdbc/pom.xml b/java-bigquery-jdbc/pom.xml index 2f344bd29c0a..844a9876605f 100644 --- a/java-bigquery-jdbc/pom.xml +++ b/java-bigquery-jdbc/pom.xml @@ -506,7 +506,12 @@ org.apache.maven.plugins maven-surefire-plugin - --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java index e9ad6fa1292d..e1ad8925eb0a 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java @@ -43,7 +43,8 @@ import java.util.Map; class BigQueryCallableStatement extends BigQueryPreparedStatement implements CallableStatement { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryCallableStatement.class.getName()); private boolean lastReadWasNull = false; private Object getParameterAndTrackNull(int parameterIndex) throws SQLException { diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 1e1c84c8e88c..6189f7ea75be 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -92,7 +92,8 @@ */ public class BigQueryConnection extends BigQueryNoOpsConnection { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryConnection.class.getName()); String connectionClassName = this.toString(); private final String connectionId; private static final String DEFAULT_JDBC_TOKEN_VALUE = "Google-BigQuery-JDBC-Driver"; diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java index a24522482d6e..01ca547234ae 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java @@ -91,7 +91,8 @@ * @see BigQueryStatement */ class BigQueryDatabaseMetaData implements DatabaseMetaData { - final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryDatabaseMetaData.class.getName()); private static final String DATABASE_PRODUCT_NAME = "Google BigQuery"; private static final String DATABASE_PRODUCT_VERSION = "2.0"; private static final String DRIVER_NAME = "GoogleJDBCDriverForGoogleBigQuery"; diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java index c4bc39f7ee2a..0acea77e5bf6 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java @@ -30,7 +30,6 @@ protected BigQueryJdbcCustomLogger(String name, String resourceBundleName) { public BigQueryJdbcCustomLogger(String name) { this(name, null); - this.setParent(BigQueryJdbcRootLogger.getRootLogger()); } private void logWithCaller(Level level, Supplier msgSupplier) { diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java index ad62ee76bcdb..6b90421d5d3d 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java @@ -31,7 +31,8 @@ import javax.sql.StatementEventListener; class BigQueryPooledConnection implements PooledConnection { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryPooledConnection.class.getName()); private String id; // Mainly for internal use private Connection bqConnection; @@ -165,7 +166,8 @@ public void removeStatementEventListener(StatementEventListener arg0) { // This class notifies the listeners or calls the listner notification methods // provided by the pooled connection. static class BigQueryPooledConnectionWrapper implements Connection { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryPooledConnectionWrapper.class.getName()); private Connection bqConnectionDelegate; private BigQueryPooledConnection pooledConnection; private boolean closed = false; diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index 060c60c607b2..d3e312d79feb 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -102,7 +102,8 @@ */ public class BigQueryStatement extends BigQueryNoOpsStatement { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryStatement.class.getName()); public static final int DEFAULT_BUFFER_SIZE = BigQuerySettings.DEFAULT_NUM_BUFFERED_ROWS * 2; // Bounds in-memory ArrowRecordBatch buffering per ResultSet (~15-20 MB of in-flight batches), // keeping the gRPC ReadRows stream saturated while preventing unbounded heap accumulation. diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java index d0485584e15d..66034dc1a35d 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java @@ -43,7 +43,8 @@ * registered with a naming service based on the Java™ Naming and Directory (JNDI) API. */ public class DataSource implements javax.sql.DataSource { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(DataSource.class.getName()); private String URL; static final ImmutableSet VALID_JOB_CREATION_MODES = ImmutableSet.of(1, 2); diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java index 1534a6a0b798..86bc9626a08b 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java @@ -23,7 +23,8 @@ import javax.sql.PooledConnection; public class PooledConnectionListener implements ConnectionEventListener { - private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(PooledConnectionListener.class.getName()); private String id; // Mainly for internal use private LinkedBlockingDeque connectionPool; private Long connectionPoolSize = 0L; diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java index 38a5df969406..ab6fa432b770 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java @@ -20,6 +20,8 @@ import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; import com.google.cloud.bigquery.Field; import com.google.cloud.bigquery.FieldList; @@ -37,6 +39,7 @@ import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; +import java.util.logging.Logger; import org.apache.arrow.vector.util.JsonStringArrayList; import org.apache.arrow.vector.util.JsonStringHashMap; import org.junit.jupiter.api.AfterEach; @@ -49,6 +52,8 @@ public class BigQueryJdbcCustomLoggerTest extends BigQueryJdbcLoggingBaseTest { private BigQueryJdbcCustomLogger logger; private TestHandler testHandler; + private static final int OBJECT_COUNT = 1_000; + private static class TestHandler extends Handler { private final List records = new ArrayList<>(); @@ -579,4 +584,69 @@ public void testNestedArrayInJsonStructConnectionIdPropagation() throws Exceptio "Log from Nested JSON Array", () -> nestedArray.LOG.fine("Log from Nested JSON Array")); } + + @Test + public void testLoggerIsParentedToDriverRootLogger() { + assertSame( + BigQueryJdbcRootLogger.getRootLogger(), + new BigQueryJdbcCustomLogger("ParentCheck").getParent()); + } + + @Test + public void testCreatingStatementsDoesNotRegisterChildLoggers() throws Exception { + BigQueryConnection connection = mock(BigQueryConnection.class); + doReturn("leak-test-connection").when(connection).getConnectionId(); + doReturn(BigQueryConnection.SessionState.empty()).when(connection).getSessionStateSnapshot(); + + Logger rootLogger = BigQueryJdbcRootLogger.getRootLogger(); + // Warm up so that any one-time, class-level logger is registered before we measure. + new BigQueryStatement(connection); + int childrenBefore = childLoggerCount(rootLogger); + + for (int i = 0; i < OBJECT_COUNT; i++) { + new BigQueryStatement(connection); + } + + assertEquals( + childrenBefore, + childLoggerCount(rootLogger), + "Creating " + + OBJECT_COUNT + + " statements must not register additional child loggers on the driver root logger"); + } + + @Test + public void testCreatingDatabaseMetaDataDoesNotRegisterChildLoggers() + throws ReflectiveOperationException { + BigQueryConnection connection = mock(BigQueryConnection.class); + doReturn("leak-test-connection").when(connection).getConnectionId(); + + Logger rootLogger = BigQueryJdbcRootLogger.getRootLogger(); + new BigQueryDatabaseMetaData(connection); + int childrenBefore = childLoggerCount(rootLogger); + + for (int i = 0; i < OBJECT_COUNT; i++) { + new BigQueryDatabaseMetaData(connection); + } + + assertEquals( + childrenBefore, + childLoggerCount(rootLogger), + "Creating " + + OBJECT_COUNT + + " DatabaseMetaData objects must not register additional child loggers on the driver" + + " root logger"); + } + + /** + * Reads the JDK-internal {@code Logger.kids} list. This field is private to {@code java.logging}, + * so the surefire {@code argLine} opens {@code java.util.logging} to the test classpath. + */ + private static int childLoggerCount(Logger logger) throws ReflectiveOperationException { + // Qualified because this file already imports com.google.cloud.bigquery.Field. + java.lang.reflect.Field kids = Logger.class.getDeclaredField("kids"); + kids.setAccessible(true); + List children = (List) kids.get(logger); + return children == null ? 0 : children.size(); + } } From 1b7d00d4580b2a32be061fab3a6e3f0819348c86 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 22 Oct 2026 09:36:30 -0400 Subject: [PATCH 13/35] fix(bigquery-jdbc): poll the JSON reference queue and release processed finalizers (#14719) b/524270586 --- .../jdbc/BigQueryDaemonPollingTask.java | 95 ++++++++----------- .../jdbc/BigQueryResultSetFinalizers.java | 11 ++- .../bigquery/jdbc/BigQueryStatement.java | 4 +- .../jdbc/BigQueryDaemonPollingTaskTest.java | 89 ++++++++++++++++- 4 files changed, 139 insertions(+), 60 deletions(-) diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java index d3e21f79ad17..d1782e5fa747 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java @@ -17,14 +17,15 @@ package com.google.cloud.bigquery.jdbc; import com.google.api.core.InternalApi; -import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.jdbc.BigQueryResultSetFinalizers.ResultSetFinalizer; +import com.google.common.annotations.VisibleForTesting; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.util.List; /** - * This class is used to add polling threads required for polling the reference queues associated - * with the two ResultSets + * Polls a {@link ReferenceQueue} of result-set phantom references and releases the resources they + * own. One instance (thread) is started per result-set type. */ @InternalApi class BigQueryDaemonPollingTask extends Thread { @@ -32,43 +33,32 @@ class BigQueryDaemonPollingTask extends Thread { private static final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(BigQueryDaemonPollingTask.class.getName()); - static ReferenceQueue referenceQueueArrowRs; - static ReferenceQueue referenceQueueJsonRs; - static List arrowRsFinalizers; - static List jsonRsFinalizers; + // Per-thread state. Each daemon owns exactly one queue and the list that keeps its + // references strongly reachable until they have been processed. + private final ReferenceQueue referenceQueue; + private final List> finalizers; + // Singleton guard: the two daemons are started at most once per JVM. private static BigQueryDaemonPollingTask arrowDaemon; private static BigQueryDaemonPollingTask jsonDaemon; - private static final Object LOCK = new Object(); - private BigQueryDaemonPollingTask( - List arrowRsFinalizers, - ReferenceQueue referenceQueueArrowRs) { - super("BigQuery-GC-Daemon-Arrow"); - BigQueryDaemonPollingTask.referenceQueueArrowRs = referenceQueueArrowRs; - BigQueryDaemonPollingTask.arrowRsFinalizers = arrowRsFinalizers; - setDaemon(true); - } - - private BigQueryDaemonPollingTask( - ReferenceQueue referenceQueueJsonRs, - List jsonRsFinalizers) { - super("BigQuery-GC-Daemon-Json"); - BigQueryDaemonPollingTask.referenceQueueJsonRs = referenceQueueJsonRs; - BigQueryDaemonPollingTask.jsonRsFinalizers = jsonRsFinalizers; + @VisibleForTesting + BigQueryDaemonPollingTask( + String threadName, + ReferenceQueue referenceQueue, + List> finalizers) { + super(threadName); + this.referenceQueue = referenceQueue; + this.finalizers = finalizers; setDaemon(true); } /** - * ThreadSafe method which creates two instances of polling task, one each for each type of - * ResultSet + * Thread-safe. Starts one polling thread per result-set type. Subsequent calls are no-ops, even + * if different queues are passed. * - * @param referenceQueueArrowRs ReferenceQueue for ArrowResultSet - * @param referenceQueueJsonRs ReferenceQueue for JsonResultSet - * @param arrowRsFinalizers Finalizer for ArrowResultSet - * @param jsonRsFinalizers Finalizer for JsonResultSet - * @return true if the tasks were created + * @return true if the daemons were started by this call */ public static boolean startGcDaemonTask( ReferenceQueue referenceQueueArrowRs, @@ -77,45 +67,42 @@ public static boolean startGcDaemonTask( List jsonRsFinalizers) { LOG.finest("++enter++"); synchronized (LOCK) { - // 2 Background threads will be required to monitor the respective queues if (arrowDaemon == null && jsonDaemon == null) { - arrowDaemon = new BigQueryDaemonPollingTask(arrowRsFinalizers, referenceQueueArrowRs); + arrowDaemon = + new BigQueryDaemonPollingTask( + "BigQuery-GC-Daemon-Arrow", referenceQueueArrowRs, arrowRsFinalizers); arrowDaemon.start(); - jsonDaemon = new BigQueryDaemonPollingTask(referenceQueueJsonRs, jsonRsFinalizers); + jsonDaemon = + new BigQueryDaemonPollingTask( + "BigQuery-GC-Daemon-Json", referenceQueueJsonRs, jsonRsFinalizers); jsonDaemon.start(); - return true; } } - // Task(s) are already initialised return false; } @Override public void run() { - - Reference reference; + LOG.finest("++enter++"); try { - LOG.finest("++enter++"); - // poll for Arrow ResultSets - if (referenceQueueArrowRs != null) { - - while ((reference = referenceQueueArrowRs.remove()) != null) { - LOG.fine("Clearing Arrow ResultSet reference " + referenceQueueArrowRs); - ((BigQueryResultSetFinalizers.ArrowResultSetFinalizer) reference).finalizeResources(); - reference.clear(); - } - } - // poll for JSON ResultSets - else if (referenceQueueJsonRs != null) { - while ((reference = referenceQueueJsonRs.remove()) != null) { - LOG.fine("Clearing Json ResultSet reference " + referenceQueueJsonRs); - ((BigQueryResultSetFinalizers.JsonResultSetFinalizer) reference).finalizeResources(); + while (true) { + Reference reference = + referenceQueue.remove(); // InterruptedException escapes to outer catch + try { + LOG.fine("Clearing ResultSet reference " + reference); + if (reference instanceof ResultSetFinalizer) { + ((ResultSetFinalizer) reference).finalizeResources(); + } else { + LOG.warning("Unexpected reference type in GC queue: " + reference.getClass()); + } + } catch (RuntimeException ex) { + LOG.warning(ex, "Failed to finalize ResultSet resources; continuing"); + } finally { reference.clear(); + finalizers.remove(reference); } - } else { - throw new BigQueryJdbcRuntimeException("Null Reference Queue"); } } catch (InterruptedException ex) { LOG.warning(ex, "Interrupted in GC daemon task"); diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java index 57f764979f53..6749f4a6c9b2 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java @@ -26,8 +26,14 @@ class BigQueryResultSetFinalizers { private static final BigQueryJdbcResultSetLogger LOG = BigQueryJdbcResultSetLogger.getLogger(BigQueryResultSetFinalizers.class); + /** Implemented by every PhantomReference the GC daemon knows how to clean up. */ + interface ResultSetFinalizer { + void finalizeResources(); + } + @InternalApi - static class ArrowResultSetFinalizer extends PhantomReference { + static class ArrowResultSetFinalizer extends PhantomReference + implements ResultSetFinalizer { Future ownedTask; public ArrowResultSetFinalizer( @@ -48,7 +54,8 @@ public void finalizeResources() { } @InternalApi - static class JsonResultSetFinalizer extends PhantomReference { + static class JsonResultSetFinalizer extends PhantomReference + implements ResultSetFinalizer { Future[] ownedTasks; public JsonResultSetFinalizer( diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index d3e312d79feb..b070356cb221 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -152,9 +152,9 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { static ReferenceQueue referenceQueueArrowRs = new ReferenceQueue<>(); static ReferenceQueue referenceQueueJsonRs = new ReferenceQueue<>(); static List arrowResultSetFinalizers = - new ArrayList<>(); + Collections.synchronizedList(new ArrayList<>()); static List jsonResultSetFinalizers = - new ArrayList<>(); + Collections.synchronizedList(new ArrayList<>()); private static final ThreadFactory JDBC_THREAD_FACTORY = new BigQueryThreadFactory("BigQuery-Thread-"); diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java index 29941152e7c5..66c1c0b50c7e 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java @@ -17,11 +17,17 @@ package com.google.cloud.bigquery.jdbc; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; import com.google.cloud.bigquery.jdbc.BigQueryResultSetFinalizers.ArrowResultSetFinalizer; +import com.google.cloud.bigquery.jdbc.BigQueryResultSetFinalizers.JsonResultSetFinalizer; import java.lang.ref.ReferenceQueue; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.concurrent.Future; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,8 +42,8 @@ public class BigQueryDaemonPollingTaskTest { public void setUp() { referenceQueueArrowRs = new ReferenceQueue<>(); referenceQueueJsonRs = new ReferenceQueue<>(); - arrowResultSetFinalizers = new ArrayList<>(); - jsonResultSetFinalizers = new ArrayList<>(); + arrowResultSetFinalizers = Collections.synchronizedList(new ArrayList<>()); + jsonResultSetFinalizers = Collections.synchronizedList(new ArrayList<>()); } @Test @@ -60,4 +66,83 @@ public void testStartGcDaemonTask() { jsonResultSetFinalizers)) .isFalse(); } + + @Test + public void testJsonDaemonFinalizesAndReleasesReference() throws Exception { + Future worker1 = mock(Future.class); + Future worker2 = mock(Future.class); + JsonResultSetFinalizer finalizer = + new JsonResultSetFinalizer(null, referenceQueueJsonRs, new Future[] {worker1, worker2}); + jsonResultSetFinalizers.add(finalizer); + BigQueryDaemonPollingTask daemon = + new BigQueryDaemonPollingTask( + "test-json-daemon", referenceQueueJsonRs, jsonResultSetFinalizers); + daemon.start(); + try { + finalizer.enqueue(); // simulate the GC enqueuing the phantom reference + verify(worker1, timeout(5000)).cancel(true); + verify(worker2, timeout(5000)).cancel(true); + awaitEmpty(jsonResultSetFinalizers); + } finally { + daemon.interrupt(); + } + } + + @Test + public void testArrowDaemonFinalizesAndReleasesReference() throws Exception { + Future worker = mock(Future.class); + ArrowResultSetFinalizer finalizer = + new ArrowResultSetFinalizer(null, referenceQueueArrowRs, worker); + arrowResultSetFinalizers.add(finalizer); + BigQueryDaemonPollingTask daemon = + new BigQueryDaemonPollingTask( + "test-arrow-daemon", referenceQueueArrowRs, arrowResultSetFinalizers); + daemon.start(); + try { + finalizer.enqueue(); + verify(worker, timeout(5000)).cancel(true); + awaitEmpty(arrowResultSetFinalizers); + } finally { + daemon.interrupt(); + } + } + + @Test + public void testEachDaemonPollsOnlyItsOwnQueue() throws Exception { + Future jsonWorker = mock(Future.class); + Future arrowWorker = mock(Future.class); + JsonResultSetFinalizer jsonFinalizer = + new JsonResultSetFinalizer(null, referenceQueueJsonRs, new Future[] {jsonWorker}); + ArrowResultSetFinalizer arrowFinalizer = + new ArrowResultSetFinalizer(null, referenceQueueArrowRs, arrowWorker); + jsonResultSetFinalizers.add(jsonFinalizer); + arrowResultSetFinalizers.add(arrowFinalizer); + BigQueryDaemonPollingTask jsonDaemon = + new BigQueryDaemonPollingTask("test-json", referenceQueueJsonRs, jsonResultSetFinalizers); + BigQueryDaemonPollingTask arrowDaemon = + new BigQueryDaemonPollingTask( + "test-arrow", referenceQueueArrowRs, arrowResultSetFinalizers); + jsonDaemon.start(); + arrowDaemon.start(); + try { + jsonFinalizer.enqueue(); + arrowFinalizer.enqueue(); + verify(jsonWorker, timeout(5000)).cancel(true); + verify(arrowWorker, timeout(5000)).cancel(true); + awaitEmpty(jsonResultSetFinalizers); + awaitEmpty(arrowResultSetFinalizers); + } finally { + jsonDaemon.interrupt(); + arrowDaemon.interrupt(); + } + } + + /** Small poll loop; the list is drained by the daemon thread shortly after cancel() runs. */ + private static void awaitEmpty(List list) throws InterruptedException { + long deadline = System.currentTimeMillis() + 5000; + while (!list.isEmpty() && System.currentTimeMillis() < deadline) { + Thread.sleep(20); + } + assertThat(list).isEmpty(); + } } From e83c768171a7f7aceaf35cd7c7192e232d9d89a8 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 22 Oct 2026 10:05:11 -0400 Subject: [PATCH 14/35] fix(bigquery-jdbc): stop per-ResultSet logger registration leak (#14718) b/576218509 One registered BigQueryJdbcCustomLogger per class, shared; the facade holds that delegate plus the connection ID and stamps the ID into LogRecord params[0] exactly as before, so per-connection file routing for un-proxied ResultSet calls is unchanged. Hot-path trace methods still set the source class/method explicitly and allocate nothing when the level is disabled. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../jdbc/BigQueryJdbcResultSetLogger.java | 145 ++++++++----- .../jdbc/BigQueryJdbcCustomLoggerTest.java | 204 +++++++++++------- 2 files changed, 216 insertions(+), 133 deletions(-) diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcResultSetLogger.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcResultSetLogger.java index 9d5531719f5d..2e5753fa2c46 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcResultSetLogger.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcResultSetLogger.java @@ -22,36 +22,73 @@ import java.util.logging.LogRecord; /** - * Specialized high-performance logger for ResultSet and its related classes. Avoids expensive stack - * trace walking (caller inference) on hot-path logging calls. + * High-performance logging facade for ResultSet and its related classes. + * + *

This is deliberately not a {@link java.util.logging.Logger}. Every {@code Logger} + * instance registers itself as a child of its parent under a JVM-wide lock and that registration is + * never released, so a logger-per-ResultSet leaks. Instead, one real {@link + * BigQueryJdbcCustomLogger} is created per class and shared; this facade holds a reference to it + * plus the connection ID of the ResultSet it serves. + * + *

Hot-path methods ({@code finestTrace} etc.) set the source class and method explicitly, so no + * stack-trace walking (caller inference) happens for them. The connection ID is stamped into {@code + * LogRecord.getParameters()[0]} on every record so {@code PerConnectionFileHandler} can route the + * record even when the thread-local MDC (mapped diagnostic context — the per-thread connection ID + * set by the JDBC proxy) is empty, which is the normal case for un-proxied ResultSet calls. */ -public class BigQueryJdbcResultSetLogger extends BigQueryJdbcCustomLogger { - private static final ConcurrentHashMap cache = +public final class BigQueryJdbcResultSetLogger { + + /** One registered logger per class. Bounded by the number of result-set classes. */ + private static final ConcurrentHashMap DELEGATES = + new ConcurrentHashMap<>(); + + /** Facades with no connection ID are immutable and shared, matching the old caching behaviour. */ + private static final ConcurrentHashMap GLOBAL_FACADES = new ConcurrentHashMap<>(); + private final BigQueryJdbcCustomLogger delegate; private final String targetClassName; private final String connectionId; + private volatile BigQueryJdbcResultSetLogger arrowStructLogger; + private volatile BigQueryJdbcResultSetLogger jsonStructLogger; + private volatile BigQueryJdbcResultSetLogger arrowArrayLogger; + private volatile BigQueryJdbcResultSetLogger jsonArrayLogger; + + private BigQueryJdbcResultSetLogger( + BigQueryJdbcCustomLogger delegate, String targetClassName, String connectionId) { + this.delegate = delegate; + this.targetClassName = targetClassName; + this.connectionId = connectionId; + } + public static BigQueryJdbcResultSetLogger getLogger(Class clazz) { return getLogger(clazz, null); } public static BigQueryJdbcResultSetLogger getLogger(Class clazz, String connectionId) { + String className = clazz.getName(); + BigQueryJdbcCustomLogger delegate = + DELEGATES.computeIfAbsent(className, BigQueryJdbcCustomLogger::new); if (connectionId == null) { - return cache.computeIfAbsent( - clazz.getName(), k -> new BigQueryJdbcResultSetLogger(clazz, null)); + return GLOBAL_FACADES.computeIfAbsent( + className, k -> new BigQueryJdbcResultSetLogger(delegate, k, null)); } - return new BigQueryJdbcResultSetLogger(clazz, connectionId); + return new BigQueryJdbcResultSetLogger(delegate, className, connectionId); } public String getConnectionId() { return connectionId; } - private BigQueryJdbcResultSetLogger arrowStructLogger; - private BigQueryJdbcResultSetLogger jsonStructLogger; - private BigQueryJdbcResultSetLogger arrowArrayLogger; - private BigQueryJdbcResultSetLogger jsonArrayLogger; + /** The shared, registered logger this facade forwards to. Exposed for tests only. */ + BigQueryJdbcCustomLogger delegate() { + return delegate; + } + + public boolean isLoggable(Level level) { + return delegate.isLoggable(level); + } public BigQueryJdbcResultSetLogger getArrowStructLogger() { if (arrowStructLogger == null) { @@ -81,20 +118,13 @@ public BigQueryJdbcResultSetLogger getJsonArrayLogger() { return jsonArrayLogger; } - public BigQueryJdbcResultSetLogger(Class clazz) { - this(clazz, null); - } - - public BigQueryJdbcResultSetLogger(Class clazz, String connectionId) { - super(clazz.getName()); - this.targetClassName = clazz.getName(); - this.connectionId = connectionId; - } - - @Override + /** + * Stamps the connection ID into {@code params[0]} and forwards to the shared logger. Does not + * touch the record's source class/method: hot-path callers set them explicitly, and cold-path + * callers ({@code severe}, {@code warning}) rely on {@link + * BigQueryJdbcCustomLogger.BigQueryJdbcLogRecord} to infer them lazily. + */ public void log(LogRecord record) { - record.setSourceClassName(targetClassName); - record.setThreadID((int) Thread.currentThread().getId()); if (connectionId != null) { Object[] existingParams = record.getParameters(); if (existingParams == null || existingParams.length == 0) { @@ -106,93 +136,104 @@ public void log(LogRecord record) { record.setParameters(newParams); } } - super.log(record); + delegate.log(record); } private void logTrace(Level level, String methodName, String msg) { - if (isLoggable(level)) { - LogRecord record = new LogRecord(level, msg); - record.setSourceMethodName(methodName); - this.log(record); + if (!delegate.isLoggable(level)) { + return; } + LogRecord record = new LogRecord(level, msg); + record.setSourceClassName(targetClassName); + record.setSourceMethodName(methodName); + log(record); } private void logTrace(Level level, String methodName, Supplier msgSupplier) { - if (isLoggable(level)) { - LogRecord record = new LogRecord(level, msgSupplier.get()); - record.setSourceMethodName(methodName); - this.log(record); + if (!delegate.isLoggable(level)) { + return; } + logTrace(level, methodName, msgSupplier.get()); } - /** - * Log a message at Level.FINEST with predefined class name, method name and messageto avoid stack - * trace parsing on the hot-path. - */ + /** Cold path: builds a record whose caller is inferred lazily by the formatter. */ + private void logWithCaller(Level level, Throwable thrown, String msg) { + if (!delegate.isLoggable(level)) { + return; + } + LogRecord record = new BigQueryJdbcCustomLogger.BigQueryJdbcLogRecord(level, msg); + record.setThrown(thrown); + log(record); + } + + /** Log at FINEST with the class name, method name and "++enter++" preset (no stack walk). */ public void finestTrace(String methodName) { logTrace(Level.FINEST, methodName, "++enter++"); } - /** - * Log a message at Level.FINEST with predefined class name and method name to avoid stack trace - * parsing on the hot-path. - */ + /** Log at FINEST with the class name and method name preset (no stack walk). */ public void finestTrace(String methodName, String msg) { logTrace(Level.FINEST, methodName, msg); } - /** Log a lazy message at Level.FINEST with predefined class name and method name. */ + /** Log a lazy message at FINEST with the class name and method name preset. */ public void finestTrace(String methodName, Supplier msgSupplier) { logTrace(Level.FINEST, methodName, msgSupplier); } - /** Log a message at Level.FINER with predefined class name and method name. */ + /** Log at FINER with the class name and method name preset. */ public void finerTrace(String methodName, String msg) { logTrace(Level.FINER, methodName, msg); } - /** Log a lazy message at Level.FINER with predefined class name and method name. */ + /** Log a lazy message at FINER with the class name and method name preset. */ public void finerTrace(String methodName, Supplier msgSupplier) { logTrace(Level.FINER, methodName, msgSupplier); } - /** Log a message at Level.FINE with predefined class name and method name. */ + /** Log at FINE with the class name and method name preset. */ public void fineTrace(String methodName, String msg) { logTrace(Level.FINE, methodName, msg); } - /** Log a lazy message at Level.FINE with predefined class name and method name. */ + /** Log a lazy message at FINE with the class name and method name preset. */ public void fineTrace(String methodName, Supplier msgSupplier) { logTrace(Level.FINE, methodName, msgSupplier); } - @Override public void finest(String msg) { logTrace(Level.FINEST, "unknown", msg); } - @Override public void finest(Supplier msgSupplier) { logTrace(Level.FINEST, "unknown", msgSupplier); } - @Override public void finer(String msg) { logTrace(Level.FINER, "unknown", msg); } - @Override public void finer(Supplier msgSupplier) { logTrace(Level.FINER, "unknown", msgSupplier); } - @Override public void fine(String msg) { logTrace(Level.FINE, "unknown", msg); } - @Override public void fine(Supplier msgSupplier) { logTrace(Level.FINE, "unknown", msgSupplier); } + + public void warning(String format, Object... args) { + if (!delegate.isLoggable(Level.WARNING)) { + return; + } + String message = (args == null || args.length == 0) ? format : String.format(format, args); + logWithCaller(Level.WARNING, null, message); + } + + public void severe(String msg, Throwable thrown) { + logWithCaller(Level.SEVERE, thrown, msg); + } } diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java index ab6fa432b770..d07052c07235 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLoggerTest.java @@ -197,53 +197,60 @@ public void testLogWithException() { @Test public void testResultSetLoggerTrace() { BigQueryJdbcResultSetLogger rsLogger = - new BigQueryJdbcResultSetLogger(BigQueryBaseResultSet.class); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); TestHandler rsHandler = new TestHandler(); - rsLogger.addHandler(rsHandler); - rsLogger.setLevel(Level.ALL); + rsLogger.delegate().addHandler(rsHandler); + rsLogger.delegate().setLevel(Level.ALL); + try { - rsLogger.finestTrace("customMethod", "Hello finest trace message"); + rsLogger.finestTrace("customMethod", "Hello finest trace message"); - List records = rsHandler.getRecords(); - assertEquals(1, records.size()); - LogRecord record = records.get(0); + List records = rsHandler.getRecords(); + assertEquals(1, records.size()); + LogRecord record = records.get(0); - assertEquals(Level.FINEST, record.getLevel()); - assertEquals("customMethod", record.getSourceMethodName()); - assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); - assertEquals("Hello finest trace message", record.getMessage()); + assertEquals(Level.FINEST, record.getLevel()); + assertEquals("customMethod", record.getSourceMethodName()); + assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); + assertEquals("Hello finest trace message", record.getMessage()); + } finally { + rsLogger.delegate().removeHandler(rsHandler); + } } @Test public void testResultSetLoggerStandardMethods() { BigQueryJdbcResultSetLogger rsLogger = - new BigQueryJdbcResultSetLogger(BigQueryBaseResultSet.class); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); TestHandler rsHandler = new TestHandler(); - rsLogger.addHandler(rsHandler); - rsLogger.setLevel(Level.ALL); - - rsLogger.finest("Finest msg"); - rsLogger.finer("Finer msg"); - rsLogger.fine("Fine msg"); - - List records = rsHandler.getRecords(); - assertEquals(3, records.size()); - - LogRecord r1 = records.get(0); - assertEquals(Level.FINEST, r1.getLevel()); - assertEquals("unknown", r1.getSourceMethodName()); - assertEquals(BigQueryBaseResultSet.class.getName(), r1.getSourceClassName()); - assertEquals("Finest msg", r1.getMessage()); - - LogRecord r2 = records.get(1); - assertEquals(Level.FINER, r2.getLevel()); - assertEquals("unknown", r2.getSourceMethodName()); - assertEquals("Finer msg", r2.getMessage()); - - LogRecord r3 = records.get(2); - assertEquals(Level.FINE, r3.getLevel()); - assertEquals("unknown", r3.getSourceMethodName()); - assertEquals("Fine msg", r3.getMessage()); + rsLogger.delegate().addHandler(rsHandler); + rsLogger.delegate().setLevel(Level.ALL); + try { + rsLogger.finest("Finest msg"); + rsLogger.finer("Finer msg"); + rsLogger.fine("Fine msg"); + + List records = rsHandler.getRecords(); + assertEquals(3, records.size()); + + LogRecord r1 = records.get(0); + assertEquals(Level.FINEST, r1.getLevel()); + assertEquals("unknown", r1.getSourceMethodName()); + assertEquals(BigQueryBaseResultSet.class.getName(), r1.getSourceClassName()); + assertEquals("Finest msg", r1.getMessage()); + + LogRecord r2 = records.get(1); + assertEquals(Level.FINER, r2.getLevel()); + assertEquals("unknown", r2.getSourceMethodName()); + assertEquals("Finer msg", r2.getMessage()); + + LogRecord r3 = records.get(2); + assertEquals(Level.FINE, r3.getLevel()); + assertEquals("unknown", r3.getSourceMethodName()); + assertEquals("Fine msg", r3.getMessage()); + } finally { + rsLogger.delegate().removeHandler(rsHandler); + } } @Test @@ -263,21 +270,24 @@ public void testCustomLoggerSupplierMethods() { @Test public void testResultSetLoggerSupplierMethods() { BigQueryJdbcResultSetLogger rsLogger = - new BigQueryJdbcResultSetLogger(BigQueryBaseResultSet.class); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); TestHandler rsHandler = new TestHandler(); - rsLogger.addHandler(rsHandler); - rsLogger.setLevel(Level.ALL); - - rsLogger.finest(() -> "Lazy finest RS message"); + rsLogger.delegate().addHandler(rsHandler); + rsLogger.delegate().setLevel(Level.ALL); + try { + rsLogger.finest(() -> "Lazy finest RS message"); - List records = rsHandler.getRecords(); - assertEquals(1, records.size()); - LogRecord record = records.get(0); + List records = rsHandler.getRecords(); + assertEquals(1, records.size()); + LogRecord record = records.get(0); - assertEquals(Level.FINEST, record.getLevel()); - assertEquals("unknown", record.getSourceMethodName()); - assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); - assertEquals("Lazy finest RS message", record.getMessage()); + assertEquals(Level.FINEST, record.getLevel()); + assertEquals("unknown", record.getSourceMethodName()); + assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); + assertEquals("Lazy finest RS message", record.getMessage()); + } finally { + rsLogger.delegate().removeHandler(rsHandler); + } } @Test @@ -298,60 +308,70 @@ public void testSupplierNotEvaluatedWhenDisabled() { @Test public void testResultSetLoggerSupplierTraceMethods() { BigQueryJdbcResultSetLogger rsLogger = - new BigQueryJdbcResultSetLogger(BigQueryBaseResultSet.class); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); TestHandler rsHandler = new TestHandler(); - rsLogger.addHandler(rsHandler); - rsLogger.setLevel(Level.ALL); - - rsLogger.finestTrace("customTraceMethod", () -> "Lazy finest RS trace message"); + rsLogger.delegate().addHandler(rsHandler); + rsLogger.delegate().setLevel(Level.ALL); + try { + rsLogger.finestTrace("customTraceMethod", () -> "Lazy finest RS trace message"); - List records = rsHandler.getRecords(); - assertEquals(1, records.size()); - LogRecord record = records.get(0); + List records = rsHandler.getRecords(); + assertEquals(1, records.size()); + LogRecord record = records.get(0); - assertEquals(Level.FINEST, record.getLevel()); - assertEquals("customTraceMethod", record.getSourceMethodName()); - assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); - assertEquals("Lazy finest RS trace message", record.getMessage()); + assertEquals(Level.FINEST, record.getLevel()); + assertEquals("customTraceMethod", record.getSourceMethodName()); + assertEquals(BigQueryBaseResultSet.class.getName(), record.getSourceClassName()); + assertEquals("Lazy finest RS trace message", record.getMessage()); + } finally { + rsLogger.delegate().removeHandler(rsHandler); + } } @Test public void testResultSetLoggerCachingBehavior() { - // Global logger (connectionId is null) should be cached + // Global facades (no connection ID) are shared. BigQueryJdbcResultSetLogger globalLogger1 = BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); BigQueryJdbcResultSetLogger globalLogger2 = BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class); assertSame(globalLogger1, globalLogger2); - - // Connection-specific loggers should not be cached globally + // Connection-scoped facades are distinct lightweight objects, but they all forward to the + // single registered logger for the class — that is what prevents the registration leak. BigQueryJdbcResultSetLogger connLogger1 = BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class, "conn-123"); BigQueryJdbcResultSetLogger connLogger2 = - BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class, "conn-123"); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class, "conn-456"); assertNotSame(connLogger1, connLogger2); + assertSame(connLogger1.delegate(), connLogger2.delegate()); + assertSame(globalLogger1.delegate(), connLogger1.delegate()); } @Test public void testResultSetLoggerParameterPreservation() { BigQueryJdbcResultSetLogger rsLogger = - new BigQueryJdbcResultSetLogger(BigQueryBaseResultSet.class, "conn-123"); + BigQueryJdbcResultSetLogger.getLogger(BigQueryBaseResultSet.class, "conn-123"); TestHandler rsHandler = new TestHandler(); - rsLogger.addHandler(rsHandler); - rsLogger.setLevel(Level.ALL); + rsLogger.delegate().addHandler(rsHandler); + rsLogger.delegate().setLevel(Level.ALL); - LogRecord record = new LogRecord(Level.INFO, "Processing job {0}"); - record.setParameters(new Object[] {"job-999"}); - rsLogger.log(record); + try { - List records = rsHandler.getRecords(); - assertEquals(1, records.size()); - LogRecord loggedRecord = records.get(0); + LogRecord record = new LogRecord(Level.INFO, "Processing job {0}"); + record.setParameters(new Object[] {"job-999"}); + rsLogger.log(record); + + List records = rsHandler.getRecords(); + assertEquals(1, records.size()); + LogRecord loggedRecord = records.get(0); - Object[] params = loggedRecord.getParameters(); - assertEquals(2, params.length); - assertEquals("conn-123", params[0]); - assertEquals("job-999", params[1]); + Object[] params = loggedRecord.getParameters(); + assertEquals(2, params.length); + assertEquals("conn-123", params[0]); + assertEquals("job-999", params[1]); + } finally { + rsLogger.delegate().removeHandler(rsHandler); + } } private void assertConnectionIdPropagated( @@ -360,7 +380,7 @@ private void assertConnectionIdPropagated( String expectedMessage, Runnable action) { Level originalRootLevel = BigQueryJdbcRootLogger.getRootLogger().getLevel(); - Level originalLoggerLevel = logger.getLevel(); + Level originalLoggerLevel = logger.delegate().getLevel(); Map originalHandlerLevels = new HashMap<>(); for (Handler h : BigQueryJdbcRootLogger.getRootLogger().getHandlers()) { originalHandlerLevels.put(h, h.getLevel()); @@ -368,7 +388,7 @@ private void assertConnectionIdPropagated( } BigQueryJdbcRootLogger.getRootLogger().setLevel(Level.ALL); - logger.setLevel(Level.ALL); + logger.delegate().setLevel(Level.ALL); try { capturedLogs.clear(); @@ -378,7 +398,7 @@ private void assertConnectionIdPropagated( assertTrue(assertLogContains(expectedMessage)); } finally { BigQueryJdbcRootLogger.getRootLogger().setLevel(originalRootLevel); - logger.setLevel(originalLoggerLevel); + logger.delegate().setLevel(originalLoggerLevel); for (Entry entry : originalHandlerLevels.entrySet()) { entry.getKey().setLevel(entry.getValue()); } @@ -638,6 +658,28 @@ public void testCreatingDatabaseMetaDataDoesNotRegisterChildLoggers() + " root logger"); } + @Test + public void testConnectionScopedResultSetLoggersDoNotRegisterChildLoggers() + throws ReflectiveOperationException { + Logger rootLogger = BigQueryJdbcRootLogger.getRootLogger(); + // Warm up so the per-class delegates (and their one-time registration) exist before measuring. + BigQueryJdbcResultSetLogger.getLogger(BigQueryArrowResultSet.class, "warm-up") + .getArrowStructLogger() + .getArrowArrayLogger(); + int childrenBefore = childLoggerCount(rootLogger); + + for (int i = 0; i < OBJECT_COUNT; i++) { + BigQueryJdbcResultSetLogger.getLogger(BigQueryArrowResultSet.class, "conn-" + i) + .getArrowStructLogger() + .getArrowArrayLogger(); + } + + assertEquals( + childrenBefore, + childLoggerCount(rootLogger), + "Connection-scoped result-set loggers must not register child loggers on the driver root"); + } + /** * Reads the JDK-internal {@code Logger.kids} list. This field is private to {@code java.logging}, * so the surefire {@code argLine} opens {@code java.util.logging} to the test classpath. From 11bc0716fcbd8549a7b4e9677d520ee0be8b91b0 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 22 Oct 2026 13:07:47 -0400 Subject: [PATCH 15/35] feat(firestore): DML (#14703) Co-authored-by: Hui Wu --- .../com/google/cloud/firestore/Pipeline.java | 149 +++++- .../cloud/firestore/PipelineSource.java | 7 + .../firestore/pipeline/stages/Delete.java | 2 - .../firestore/pipeline/stages/Insert.java | 126 +++++ .../firestore/pipeline/stages/Literals.java | 58 ++- .../stages/PipelineExecuteOptions.java | 34 +- .../firestore/pipeline/stages/Update.java | 14 +- .../firestore/pipeline/stages/Upsert.java | 190 +++++++ .../cloud/firestore/PipelineProtoTest.java | 378 ++++++++++++++ .../cloud/firestore/it/ITPipelineTest.java | 469 ++++++++++++++++++ 10 files changed, 1397 insertions(+), 30 deletions(-) create mode 100644 java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Insert.java create mode 100644 java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Upsert.java diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java index c49ee0ad2f9a..e01360a4ffa0 100644 --- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java @@ -47,6 +47,7 @@ import com.google.cloud.firestore.pipeline.stages.Distinct; import com.google.cloud.firestore.pipeline.stages.FindNearest; import com.google.cloud.firestore.pipeline.stages.FindNearestOptions; +import com.google.cloud.firestore.pipeline.stages.Insert; import com.google.cloud.firestore.pipeline.stages.Limit; import com.google.cloud.firestore.pipeline.stages.Offset; import com.google.cloud.firestore.pipeline.stages.PipelineExecuteOptions; @@ -63,6 +64,7 @@ import com.google.cloud.firestore.pipeline.stages.Unnest; import com.google.cloud.firestore.pipeline.stages.UnnestOptions; import com.google.cloud.firestore.pipeline.stages.Update; +import com.google.cloud.firestore.pipeline.stages.Upsert; import com.google.cloud.firestore.pipeline.stages.Where; import com.google.cloud.firestore.telemetry.MetricsUtil.MetricsContext; import com.google.cloud.firestore.telemetry.TelemetryConstants; @@ -76,6 +78,7 @@ import com.google.firestore.v1.ExecutePipelineRequest; import com.google.firestore.v1.ExecutePipelineResponse; import com.google.firestore.v1.StructuredPipeline; +import com.google.firestore.v1.TransactionOptions; import com.google.firestore.v1.Value; import com.google.protobuf.ByteString; import java.util.ArrayList; @@ -1198,6 +1201,9 @@ public Pipeline unnest(Selectable field, UnnestOptions options) { /** * Performs a delete operation on documents from previous stages. * + *

Each document produced by the previous stages is deleted from the database. The result + * contains a single document with a {@code documents_modified} field. + * *

Example: * *

{@code
@@ -1212,7 +1218,6 @@ public Pipeline unnest(Selectable field, UnnestOptions options) {
    *
    * @return A new {@code Pipeline} object with this stage appended to the stage list.
    */
-  @BetaApi
   public Pipeline delete() {
     return append(new Delete());
   }
@@ -1220,8 +1225,13 @@ public Pipeline delete() {
   /**
    * Performs an update operation using documents from previous stages.
    *
-   * 

This method updates the documents in place based on the data flowing through the pipeline. - * To specify transformations, use {@link #update(Selectable...)}. + *

This method updates existing documents based on the data flowing through the pipeline. To + * specify transformations, use {@link #update(Selectable...)}. + * + *

Each document is written to the path given by its {@code __name__} field. The stored + * document is replaced by the pipeline document, so fields removed by earlier stages (for + * example, with {@link #removeFields(String, String...)}) are also removed from the stored + * document. This stage does not create documents: target documents that don't exist are skipped. * *

Example 1: Update a collection's schema by adding a new field and removing an old one. * @@ -1235,7 +1245,7 @@ public Pipeline delete() { * .get(); * }

* - *

Example 2: Update documents in place with data from literals. + *

Example 2: Update documents with data from literals. * *

{@code
    * Map updateData = new HashMap<>();
@@ -1251,7 +1261,6 @@ public Pipeline delete() {
    *
    * @return A new {@code Pipeline} object with this stage appended to the stage list.
    */
-  @BetaApi
   public Pipeline update() {
     return append(new Update());
   }
@@ -1275,7 +1284,6 @@ public Pipeline update() {
    * @param transformedFields The transformations to apply.
    * @return A new {@code Pipeline} object with this stage appended to the stage list.
    */
-  @BetaApi
   public Pipeline update(Selectable... transformedFields) {
     return append(new Update().withTransformedFields(transformedFields));
   }
@@ -1301,14 +1309,104 @@ public Pipeline update(Selectable... transformedFields) {
    * @param update The {@code Update} stage to append.
    * @return A new {@code Pipeline} object with this stage appended to the stage list.
    */
-  @BetaApi
   public Pipeline update(Update update) {
     return append(update);
   }
 
   /**
-   * Performs an insert operation using documents from previous stages. Adds a generic stage to the
-   * pipeline.
+   * Inserts each document produced by the previous stages at its own path, given by its {@code
+   * __name__} field.
+   *
+   * 

This is equivalent to {@code insert(new Insert())}. A document without a {@code __name__} + * field fails with {@code INVALID_ARGUMENT}. + * + *

The insert fails with {@code ALREADY_EXISTS} if a target document already exists. + * + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + public Pipeline insert() { + return append(new Insert()); + } + + /** + * Inserts each document produced by the previous stages as a new document, using a configured + * {@link Insert} stage. + * + *

The insert fails with {@code ALREADY_EXISTS} if a target document already exists. See {@link + * Insert} for how the target path of each document is determined. + * + *

Example: + * + *

{@code
+   * Map book = new HashMap<>();
+   * book.put("title", "Dune");
+   *
+   * firestore.pipeline()
+   *     .literals(book)
+   *     .insert(new Insert().withCollection("books"))
+   *     .execute(new PipelineExecuteOptions().withAtomic(true))
+   *     .get();
+   * }
+ * + * @param insert The {@code Insert} stage to append. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + public Pipeline insert(Insert insert) { + return append(insert); + } + + /** + * Writes each document produced by the previous stages, using a configured {@link Upsert} stage. + * The target document is created if it doesn't exist and replaced if it does; stored fields are + * not merged. + * + *

See {@link Upsert} for how the target path of each document is determined. + * + *

Example: + * + *

{@code
+   * firestore.pipeline()
+   *     .collection("books")
+   *     .where(field("title").equal("Dune"))
+   *     .upsert(new Upsert().withCollection("archive"))
+   *     .execute()
+   *     .get();
+   * }
+ * + * @param upsert The {@code Upsert} stage to append. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + public Pipeline upsert(Upsert upsert) { + return append(upsert); + } + + /** + * Writes each document produced by the previous stages to the path given by its {@code __name__} + * field, after adding the given fields. The document is created if it doesn't exist and replaced + * if it does; stored fields are not merged. A document without a {@code __name__} field fails + * with {@code INVALID_ARGUMENT}. + * + *

Example: + * + *

{@code
+   * firestore.pipeline()
+   *     .collection("books")
+   *     .where(field("rating").greaterThan(4))
+   *     .upsert(constant("Featured").as("status"))
+   *     .execute()
+   *     .get();
+   * }
+ * + * @param additionalFields Fields to add to each input document before it is written. A field with + * the same name as an existing input field overwrites that field. + * @return A new {@code Pipeline} object with this stage appended to the stage list. + */ + public Pipeline upsert(Selectable... additionalFields) { + return append(new Upsert(additionalFields)); + } + + /** + * Adds a generic stage to the pipeline. * *

This method provides a flexible way to extend the pipeline's functionality by adding custom * stages. Each generic stage is defined by a unique `name` and a set of `params` that control its @@ -1509,31 +1607,50 @@ public void onError(Throwable t) { } } - void executeInternal( + ExecutePipelineRequest toExecutePipelineRequest( @Nonnull PipelineExecuteOptions options, @Nullable final ByteString transactionId, - @Nullable com.google.protobuf.Timestamp readTime, - PipelineResultObserver observer, - MetricsContext metricsContext) { + @Nullable com.google.protobuf.Timestamp readTime) { + java.util.Map optionsMap = + new java.util.HashMap<>(StageUtils.toMap(options)); + optionsMap.remove("atomic"); + ExecutePipelineRequest.Builder request = ExecutePipelineRequest.newBuilder() - .setDatabase(rpcContext.getDatabaseName()) + .setDatabase(rpcContext != null ? rpcContext.getDatabaseName() : "") .setStructuredPipeline( StructuredPipeline.newBuilder() .setPipeline(toProto()) - .putAllOptions(StageUtils.toMap(options)) + .putAllOptions(optionsMap) .build()); if (transactionId != null) { request.setTransaction(transactionId); + } else if (options.isAtomic()) { + request.setNewTransaction( + TransactionOptions.newBuilder() + .setReadWrite(TransactionOptions.ReadWrite.getDefaultInstance()) + .build()); + request.setAutoCommitTransaction(true); } if (readTime != null) { request.setReadTime(readTime); } + return request.build(); + } + + void executeInternal( + @Nonnull PipelineExecuteOptions options, + @Nullable final ByteString transactionId, + @Nullable com.google.protobuf.Timestamp readTime, + PipelineResultObserver observer, + MetricsContext metricsContext) { + ExecutePipelineRequest request = toExecutePipelineRequest(options, transactionId, readTime); + pipelineInternalStream( - request.build(), + request, new PipelineResultObserver() { @Override public void onCompleted() { diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java index f5c11e76d748..080e10d19a5c 100644 --- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java @@ -152,6 +152,13 @@ public Pipeline documents(String... docs) { /** * Creates a new {@link Pipeline} that operates on a static set of documents represented as Maps. * + *

Each map becomes one input document. Field values can be constants or {@link + * com.google.cloud.firestore.pipeline.expressions.Expression}s, including expressions nested + * inside map or list values. {@link FieldValue} sentinels are not supported; use an expression + * such as {@code currentTimestamp()} instead. To give a document a path, set its {@code __name__} + * field to a {@link DocumentReference}. Executing a pipeline with no documents fails with {@code + * INVALID_ARGUMENT}. + * *

Example: * *

{@code
diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Delete.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Delete.java
index c288f0d42a3b..b31d2ee35493 100644
--- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Delete.java
+++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Delete.java
@@ -16,7 +16,6 @@
 
 package com.google.cloud.firestore.pipeline.stages;
 
-import com.google.api.core.BetaApi;
 import com.google.api.core.InternalApi;
 import com.google.firestore.v1.Value;
 import java.util.ArrayList;
@@ -27,7 +26,6 @@ private Delete(InternalOptions options) {
     super("delete", options);
   }
 
-  @BetaApi
   public Delete() {
     this(InternalOptions.EMPTY);
   }
diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Insert.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Insert.java
new file mode 100644
index 000000000000..c87fab63e16f
--- /dev/null
+++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Insert.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.firestore.pipeline.stages;
+
+import com.google.cloud.firestore.PipelineUtils;
+import com.google.cloud.firestore.pipeline.expressions.Expression;
+import com.google.common.collect.ImmutableMap;
+import com.google.firestore.v1.Value;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nullable;
+
+/**
+ * A pipeline stage that inserts each document produced by the previous stages as a new document.
+ *
+ * 

The insert fails with {@code ALREADY_EXISTS} if a target document already exists. + * + *

The target path of each document is determined as follows: + * + *

    + *
  • With neither a collection nor a document ID expression, the input document's own path (its + * {@code __name__} field) is used, so inserting documents read from the database fails with + * {@code ALREADY_EXISTS}, and a document without a {@code __name__} field fails with {@code + * INVALID_ARGUMENT}. + *
  • With only a collection, the document is written to that collection under the input + * document's ID, or under a generated ID if the input document has no {@code __name__}. + *
  • With only a document ID expression, the document is written to the input document's parent + * collection under the ID that the expression evaluates to. + *
  • With both, the document is written to the collection under the ID that the expression + * evaluates to. + *
+ * + *

Example: + * + *

{@code
+ * // Copy a document into another collection under a new ID.
+ * firestore.pipeline()
+ *     .collection("books")
+ *     .where(field("title").equal("Dune"))
+ *     .insert(new Insert().withCollection("archive").withDocumentIdExpression(constant("dune")))
+ *     .execute()
+ *     .get();
+ * }
+ * + * @see com.google.cloud.firestore.Pipeline#insert(Insert) + */ +public final class Insert extends Stage { + + @Nullable private final String collectionPath; + @Nullable private final Expression documentIdExpression; + + private Insert( + @Nullable String collectionPath, + @Nullable Expression documentIdExpression, + InternalOptions options) { + super("insert", buildOptions(collectionPath, documentIdExpression, options)); + this.collectionPath = collectionPath; + this.documentIdExpression = documentIdExpression; + } + + /** + * Creates an insert stage with no target collection and no document ID expression, so each + * document is inserted at the input document's own path. + */ + public Insert() { + this(null, null, InternalOptions.EMPTY); + } + + /** + * Sets the collection that documents are inserted into. + * + * @param collectionPath The path of the target collection, for example {@code "books"} or {@code + * "users/alice/books"}. + * @return A new {@code Insert} stage with the target collection set. + */ + public Insert withCollection(String collectionPath) { + return new Insert(collectionPath, this.documentIdExpression, this.options); + } + + /** + * Sets the expression that produces the ID of each inserted document. + * + * @param documentIdExpression An expression that is evaluated against each input document and + * must evaluate to a document ID (not a document path). Use {@code constant("id")} for a + * fixed ID. + * @return A new {@code Insert} stage with the document ID expression set. + */ + public Insert withDocumentIdExpression(Expression documentIdExpression) { + return new Insert(this.collectionPath, documentIdExpression, this.options); + } + + private static InternalOptions buildOptions( + @Nullable String collectionPath, + @Nullable Expression documentIdExpression, + InternalOptions baseOptions) { + Map optsMap = new HashMap<>(baseOptions.options); + if (collectionPath != null) { + String path = collectionPath.startsWith("/") ? collectionPath : "/" + collectionPath; + optsMap.put("collection", Value.newBuilder().setReferenceValue(path).build()); + } + if (documentIdExpression != null) { + optsMap.put("document_id", PipelineUtils.encodeValue(documentIdExpression)); + } + return new InternalOptions(ImmutableMap.copyOf(optsMap)); + } + + @Override + Iterable toStageArgs() { + return new ArrayList<>(); + } +} diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Literals.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Literals.java index f27e172701c7..a3e18cd51805 100644 --- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Literals.java +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Literals.java @@ -18,9 +18,11 @@ import com.google.api.core.InternalApi; import com.google.cloud.firestore.PipelineUtils; +import com.google.cloud.firestore.pipeline.expressions.Expression; import com.google.firestore.v1.Value; import java.util.ArrayList; import java.util.Arrays; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -49,11 +51,13 @@ private Value encodeLiteralMap(Map map) { for (Map.Entry entry : map.entrySet()) { String key = String.valueOf(entry.getKey()); Object v = entry.getValue(); - if (v instanceof com.google.cloud.firestore.pipeline.expressions.Expression) { - mapValue.putFields( - key, - PipelineUtils.encodeValue( - (com.google.cloud.firestore.pipeline.expressions.Expression) v)); + if (v instanceof Expression) { + mapValue.putFields(key, PipelineUtils.encodeValue((Expression) v)); + } else if (containsExpression(v)) { + // The backend evaluates expressions only in the top-level fields of a literal document, + // so a map or list that contains a nested expression is sent as a map(...) or array(...) + // expression instead of a raw map or array value. + mapValue.putFields(key, PipelineUtils.encodeValue(toExpression(v))); } else if (v instanceof Map) { mapValue.putFields(key, encodeLiteralMap((Map) v)); } else { @@ -62,4 +66,48 @@ private Value encodeLiteralMap(Map map) { } return Value.newBuilder().setMapValue(mapValue.build()).build(); } + + /** Returns whether {@code value} is a map or list that contains an expression at any depth. */ + private static boolean containsExpression(Object value) { + if (value instanceof Map) { + for (Object child : ((Map) value).values()) { + if (child instanceof Expression || containsExpression(child)) { + return true; + } + } + } else if (value instanceof List) { + for (Object child : (List) value) { + if (child instanceof Expression || containsExpression(child)) { + return true; + } + } + } + return false; + } + + /** + * Converts a map or list that contains nested expressions into an equivalent {@code map(...)} or + * {@code array(...)} expression. Children without expressions are kept as constants. + */ + private static Expression toExpression(Object value) { + if (value instanceof Expression) { + return (Expression) value; + } else if (value instanceof Map) { + Map elements = new LinkedHashMap<>(); + for (Map.Entry entry : ((Map) value).entrySet()) { + elements.put(String.valueOf(entry.getKey()), toExpressionIfNeeded(entry.getValue())); + } + return Expression.map(elements); + } else { + List elements = new ArrayList<>(); + for (Object child : (List) value) { + elements.add(toExpressionIfNeeded(child)); + } + return Expression.array(elements); + } + } + + private static Object toExpressionIfNeeded(Object value) { + return value instanceof Expression || containsExpression(value) ? toExpression(value) : value; + } } diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java index 754215e675f2..b9d52aac6d66 100644 --- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java @@ -17,18 +17,24 @@ package com.google.cloud.firestore.pipeline.stages; public final class PipelineExecuteOptions extends AbstractOptions { + private final boolean atomic; public PipelineExecuteOptions() { - super(InternalOptions.EMPTY); + this(InternalOptions.EMPTY, false); } PipelineExecuteOptions(InternalOptions options) { + this(options, false); + } + + PipelineExecuteOptions(InternalOptions options, boolean atomic) { super(options); + this.atomic = atomic; } @Override PipelineExecuteOptions self(InternalOptions options) { - return new PipelineExecuteOptions(options); + return new PipelineExecuteOptions(options, this.atomic); } public PipelineExecuteOptions withExplainOptions(ExplainOptions options) { @@ -38,4 +44,28 @@ public PipelineExecuteOptions withExplainOptions(ExplainOptions options) { public PipelineExecuteOptions withIndexMode(String indexMode) { return with("index_mode", indexMode); } + + /** + * Sets whether the pipeline is executed atomically. + * + *

When {@code true}, the pipeline runs in a single read-write transaction that is committed + * automatically after the pipeline has executed, so either all of its writes (from {@code + * insert}, {@code upsert}, {@code update} and {@code delete} stages) are applied or none are. The + * default is {@code false}. + * + * @param atomic Whether to execute the pipeline atomically. + * @return A new {@code PipelineExecuteOptions} with the atomic setting applied. + */ + public PipelineExecuteOptions withAtomic(boolean atomic) { + return new PipelineExecuteOptions(this.options, atomic); + } + + /** + * Returns whether the pipeline is executed atomically. The default is {@code false}. + * + * @see #withAtomic(boolean) + */ + public boolean isAtomic() { + return this.atomic; + } } diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Update.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Update.java index 22d029045b77..f35b4cbce659 100644 --- a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Update.java +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Update.java @@ -16,8 +16,6 @@ package com.google.cloud.firestore.pipeline.stages; -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; import com.google.cloud.firestore.PipelineUtils; import com.google.cloud.firestore.pipeline.expressions.Expression; import com.google.cloud.firestore.pipeline.expressions.Selectable; @@ -28,7 +26,15 @@ import java.util.Map; import javax.annotation.Nullable; -@InternalApi +/** + * A pipeline stage that updates existing documents in the database using the documents produced by + * the previous stages. Each input document's {@code __name__} field identifies the target document + * to update. + * + *

Use with {@link com.google.cloud.firestore.Pipeline#update(Update)}, or call {@link + * com.google.cloud.firestore.Pipeline#update()} / {@link + * com.google.cloud.firestore.Pipeline#update(Selectable...)} directly. + */ public final class Update extends Stage { @Nullable private final Selectable[] transformedFields; @@ -38,12 +44,10 @@ private Update(@Nullable Selectable[] transformedFields, InternalOptions options this.transformedFields = transformedFields; } - @BetaApi public Update() { this(null, InternalOptions.EMPTY); } - @BetaApi public Update withTransformedFields(Selectable... transformedFields) { return new Update(transformedFields, this.options); } diff --git a/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Upsert.java b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Upsert.java new file mode 100644 index 000000000000..f946af7cd5d5 --- /dev/null +++ b/java-firestore/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Upsert.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.firestore.pipeline.stages; + +import com.google.cloud.firestore.PipelineUtils; +import com.google.cloud.firestore.pipeline.expressions.Expression; +import com.google.cloud.firestore.pipeline.expressions.Selectable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.firestore.v1.Value; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * A pipeline stage that writes each document produced by the previous stages, creating the target + * document if it doesn't exist and replacing it if it does. Stored fields are not merged. + * + *

The target path of each document is determined as follows: + * + *

    + *
  • With neither a collection nor a document ID expression, the input document's own path (its + * {@code __name__} field) is used. A document without a {@code __name__} field fails with + * {@code INVALID_ARGUMENT}. + *
  • With only a collection, the document is written to that collection under the input + * document's ID, or under a generated ID if the input document has no {@code __name__}. + *
  • With only a document ID expression, the document is written to the input document's parent + * collection under the ID that the expression evaluates to. + *
  • With both, the document is written to the collection under the ID that the expression + * evaluates to. + *
+ * + *

Example: + * + *

{@code
+ * // Set "status" on each matching document and write it to the path given by its __name__ field.
+ * firestore.pipeline()
+ *     .collection("books")
+ *     .where(field("rating").greaterThan(4))
+ *     .addFields(constant("Featured").as("status"))
+ *     .upsert()
+ *     .execute()
+ *     .get();
+ * }
+ * + * @see com.google.cloud.firestore.Pipeline#upsert(Upsert) + */ +public final class Upsert extends Stage { + + @Nullable private final ImmutableList additionalFields; + @Nullable private final String collectionPath; + @Nullable private final Expression documentIdExpression; + + private Upsert( + @Nullable ImmutableList additionalFields, + @Nullable String collectionPath, + @Nullable Expression documentIdExpression, + InternalOptions options) { + super("upsert", buildOptions(collectionPath, documentIdExpression, options)); + this.additionalFields = additionalFields; + this.collectionPath = collectionPath; + this.documentIdExpression = documentIdExpression; + } + + /** + * Creates an upsert stage with no additional fields, no target collection and no document ID + * expression, so each document is written to the path given by its {@code __name__} field. + */ + public Upsert() { + this((ImmutableList) null, null, null, InternalOptions.EMPTY); + } + + /** + * Creates an upsert stage that adds the given fields to each input document before it is written + * to the path given by its {@code __name__} field. + * + * @param additionalFields Fields to add to each input document. A field with the same name as an + * existing input field overwrites that field. + */ + public Upsert(Selectable... additionalFields) { + this( + additionalFields != null ? ImmutableList.copyOf(additionalFields) : null, + null, + null, + InternalOptions.EMPTY); + } + + /** + * Sets the fields to add to each input document before it is written. + * + * @param additionalFields Fields to add to each input document. A field with the same name as an + * existing input field overwrites that field. + * @return A new {@code Upsert} stage with the additional fields set. + */ + public Upsert withAdditionalFields(Selectable... additionalFields) { + return new Upsert( + ImmutableList.copyOf(additionalFields), + this.collectionPath, + this.documentIdExpression, + this.options); + } + + /** + * Sets the fields to add to each input document before it is written. + * + * @param additionalFields Fields to add to each input document. A field with the same name as an + * existing input field overwrites that field. + * @return A new {@code Upsert} stage with the additional fields set. + */ + public Upsert withAdditionalFields(List additionalFields) { + return new Upsert( + ImmutableList.copyOf(additionalFields), + this.collectionPath, + this.documentIdExpression, + this.options); + } + + /** + * Sets the collection that documents are written to. + * + * @param collectionPath The path of the target collection, for example {@code "books"} or {@code + * "users/alice/books"}. + * @return A new {@code Upsert} stage with the target collection set. + */ + public Upsert withCollection(String collectionPath) { + return new Upsert( + this.additionalFields, collectionPath, this.documentIdExpression, this.options); + } + + /** + * Sets the expression that produces the ID of each target document. + * + * @param documentIdExpression An expression that is evaluated against each input document and + * must evaluate to a document ID (not a document path). Use {@code constant("id")} for a + * fixed ID. + * @return A new {@code Upsert} stage with the document ID expression set. + */ + public Upsert withDocumentIdExpression(Expression documentIdExpression) { + return new Upsert( + this.additionalFields, this.collectionPath, documentIdExpression, this.options); + } + + private static InternalOptions buildOptions( + @Nullable String collectionPath, + @Nullable Expression documentIdExpression, + InternalOptions baseOptions) { + Map optsMap = new HashMap<>(baseOptions.options); + if (collectionPath != null) { + String path = collectionPath.startsWith("/") ? collectionPath : "/" + collectionPath; + optsMap.put("collection", Value.newBuilder().setReferenceValue(path).build()); + } + if (documentIdExpression != null) { + optsMap.put("document_id", PipelineUtils.encodeValue(documentIdExpression)); + } + return new InternalOptions(ImmutableMap.copyOf(optsMap)); + } + + @Override + Iterable toStageArgs() { + List args = new ArrayList<>(); + if (additionalFields != null && !additionalFields.isEmpty()) { + Map map = + PipelineUtils.selectablesToMap(additionalFields.toArray(new Selectable[0])); + Map encodedMap = new HashMap<>(); + for (Map.Entry entry : map.entrySet()) { + encodedMap.put(entry.getKey(), PipelineUtils.encodeValue(entry.getValue())); + } + args.add(PipelineUtils.encodeValue(encodedMap)); + } else { + args.add(PipelineUtils.encodeValue(new HashMap())); + } + return args; + } +} diff --git a/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PipelineProtoTest.java b/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PipelineProtoTest.java index f62e4ef83f63..eb4bb7d4287b 100644 --- a/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PipelineProtoTest.java +++ b/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/PipelineProtoTest.java @@ -16,11 +16,16 @@ package com.google.cloud.firestore; +import static com.google.cloud.firestore.pipeline.expressions.Expression.add; import static com.google.cloud.firestore.pipeline.expressions.Expression.constant; import static com.google.cloud.firestore.pipeline.expressions.Expression.field; import static com.google.common.truth.Truth.assertThat; +import com.google.cloud.firestore.pipeline.stages.Insert; +import com.google.cloud.firestore.pipeline.stages.PipelineExecuteOptions; import com.google.cloud.firestore.pipeline.stages.Search; +import com.google.cloud.firestore.pipeline.stages.Upsert; +import com.google.firestore.v1.ExecutePipelineRequest; import com.google.firestore.v1.Pipeline.Stage; import com.google.firestore.v1.Value; import org.junit.Test; @@ -103,4 +108,377 @@ public void testSearchStageProtoEncoding() { Value addFields = optionsMap.get("add_fields"); assertThat(addFields.getMapValue().getFieldsMap().get("bar").getBooleanValue()).isTrue(); } + + @Test + public void testInsertStageProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Test Book"); + + Pipeline pipeline = + firestore + .pipeline() + .literals(data) + .insert( + new com.google.cloud.firestore.pipeline.stages.Insert() + .withCollection("books") + .withDocumentIdExpression(constant("book1"))); + + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage insertStage = protoPipeline.getStages(1); + assertThat(insertStage.getName()).isEqualTo("insert"); + assertThat(insertStage.getArgsCount()).isEqualTo(0); + + java.util.Map optionsMap = insertStage.getOptionsMap(); + assertThat(optionsMap.get("collection").getReferenceValue()).isEqualTo("/books"); + assertThat(optionsMap.get("document_id").getStringValue()).isEqualTo("book1"); + } + + @Test + public void testUpsertStageProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Upsert Book"); + data.put("count", 1); + + Pipeline pipeline = + firestore + .pipeline() + .literals(data) + .upsert( + new com.google.cloud.firestore.pipeline.stages.Upsert() + .withAdditionalFields( + com.google.cloud.firestore.pipeline.expressions.Expression.add( + field("count"), constant(1)) + .as("count")) + .withCollection("books") + .withDocumentIdExpression(constant("book1"))); + + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage upsertStage = protoPipeline.getStages(1); + assertThat(upsertStage.getName()).isEqualTo("upsert"); + assertThat(upsertStage.getArgsCount()).isEqualTo(1); + assertThat(upsertStage.getArgs(0).getMapValue().getFieldsMap()).containsKey("count"); + + java.util.Map optionsMap = upsertStage.getOptionsMap(); + assertThat(optionsMap.get("collection").getReferenceValue()).isEqualTo("/books"); + assertThat(optionsMap.get("document_id").getStringValue()).isEqualTo("book1"); + + // Test withAdditionalFields with List + Pipeline pipelineWithList = + firestore + .pipeline() + .literals(data) + .upsert( + new com.google.cloud.firestore.pipeline.stages.Upsert() + .withAdditionalFields( + java.util.Collections.singletonList( + com.google.cloud.firestore.pipeline.expressions.Expression.add( + field("count"), constant(1)) + .as("count"))) + .withCollection("books") + .withDocumentIdExpression(constant("book1"))); + Stage upsertStageWithList = pipelineWithList.toProto().getStages(1); + assertThat(upsertStageWithList.getArgs(0).getMapValue().getFieldsMap()).containsKey("count"); + } + + @Test + public void testAtomicExecutionOptionsConfigureNewTransactionAndAutoCommitTransaction() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Atomic Book"); + + Pipeline pipeline = + firestore + .pipeline() + .literals(data) + .insert( + new com.google.cloud.firestore.pipeline.stages.Insert() + .withCollection("books") + .withDocumentIdExpression(constant("book1"))); + + PipelineExecuteOptions executeOptions = new PipelineExecuteOptions().withAtomic(true); + ExecutePipelineRequest request = pipeline.toExecutePipelineRequest(executeOptions, null, null); + + assertThat(request.hasNewTransaction()).isTrue(); + assertThat(request.getNewTransaction().hasReadWrite()).isTrue(); + assertThat(request.getAutoCommitTransaction()).isTrue(); + assertThat(request.getStructuredPipeline().getOptionsMap()).doesNotContainKey("atomic"); + } + + @Test + public void testNonAtomicExecutionOptionsDoNotConfigureNewTransactionOrAutoCommitTransaction() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Non-Atomic Book"); + + Pipeline pipeline = + firestore + .pipeline() + .literals(data) + .insert( + new com.google.cloud.firestore.pipeline.stages.Insert() + .withCollection("books") + .withDocumentIdExpression(constant("book1"))); + + PipelineExecuteOptions executeOptionsDisabled = new PipelineExecuteOptions().withAtomic(false); + ExecutePipelineRequest requestDisabled = + pipeline.toExecutePipelineRequest(executeOptionsDisabled, null, null); + assertThat(requestDisabled.hasNewTransaction()).isFalse(); + assertThat(requestDisabled.getAutoCommitTransaction()).isFalse(); + assertThat(requestDisabled.getStructuredPipeline().getOptionsMap()).doesNotContainKey("atomic"); + + PipelineExecuteOptions executeOptionsDefault = new PipelineExecuteOptions(); + ExecutePipelineRequest requestDefault = + pipeline.toExecutePipelineRequest(executeOptionsDefault, null, null); + assertThat(requestDefault.hasNewTransaction()).isFalse(); + assertThat(requestDefault.getAutoCommitTransaction()).isFalse(); + assertThat(requestDefault.getStructuredPipeline().getOptionsMap()).doesNotContainKey("atomic"); + } + + @Test + public void testDeleteStageProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + Pipeline pipeline = firestore.pipeline().collection("books").delete(); + + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage deleteStage = protoPipeline.getStages(1); + assertThat(deleteStage.getName()).isEqualTo("delete"); + assertThat(deleteStage.getArgsCount()).isEqualTo(0); + assertThat(deleteStage.getOptionsCount()).isEqualTo(0); + } + + @Test + public void testUpdateStageProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + // 0-arg update() produces 1 empty MapValue arg and 0 options + Pipeline pipeline0 = firestore.pipeline().collection("books").update(); + com.google.firestore.v1.Pipeline protoPipeline0 = pipeline0.toProto(); + assertThat(protoPipeline0.getStagesCount()).isEqualTo(2); + + Stage updateStage0 = protoPipeline0.getStages(1); + assertThat(updateStage0.getName()).isEqualTo("update"); + assertThat(updateStage0.getArgsCount()).isEqualTo(1); + assertThat(updateStage0.getArgs(0).hasMapValue()).isTrue(); + assertThat(updateStage0.getArgs(0).getMapValue().getFieldsCount()).isEqualTo(0); + assertThat(updateStage0.getOptionsCount()).isEqualTo(0); + + // update with vararg Selectables produces 1 MapValue arg with field mappings and 0 options + Pipeline pipeline = + firestore + .pipeline() + .collection("books") + .update(constant("Updated").as("status"), add(field("count"), constant(1)).as("count")); + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage updateStage = protoPipeline.getStages(1); + assertThat(updateStage.getName()).isEqualTo("update"); + assertThat(updateStage.getArgsCount()).isEqualTo(1); + assertThat(updateStage.getArgs(0).hasMapValue()).isTrue(); + java.util.Map fieldsMap = updateStage.getArgs(0).getMapValue().getFieldsMap(); + assertThat(fieldsMap).containsKey("status"); + assertThat(fieldsMap.get("status").getStringValue()).isEqualTo("Updated"); + assertThat(fieldsMap).containsKey("count"); + assertThat(updateStage.getOptionsCount()).isEqualTo(0); + } + + @Test + public void testInsertStageWithoutDocumentIdProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Auto ID Book"); + + Pipeline pipeline = + firestore.pipeline().literals(data).insert(new Insert().withCollection("books")); + + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage insertStage = protoPipeline.getStages(1); + assertThat(insertStage.getName()).isEqualTo("insert"); + assertThat(insertStage.getArgsCount()).isEqualTo(0); + + java.util.Map optionsMap = insertStage.getOptionsMap(); + assertThat(optionsMap.get("collection").getReferenceValue()).isEqualTo("/books"); + assertThat(optionsMap).doesNotContainKey("document_id"); + } + + @Test + public void testUpsertStageWithoutAdditionalFieldsProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Upsert Book"); + + Pipeline pipeline = + firestore + .pipeline() + .literals(data) + .upsert( + new Upsert().withCollection("books").withDocumentIdExpression(constant("book1"))); + + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(2); + + Stage upsertStage = protoPipeline.getStages(1); + assertThat(upsertStage.getName()).isEqualTo("upsert"); + assertThat(upsertStage.getArgsCount()).isEqualTo(1); + assertThat(upsertStage.getArgs(0).hasMapValue()).isTrue(); + assertThat(upsertStage.getArgs(0).getMapValue().getFieldsCount()).isEqualTo(0); + + java.util.Map optionsMap = upsertStage.getOptionsMap(); + assertThat(optionsMap.get("collection").getReferenceValue()).isEqualTo("/books"); + assertThat(optionsMap.get("document_id").getStringValue()).isEqualTo("book1"); + } + + @Test + public void testLiteralsStageProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map doc1 = new java.util.HashMap<>(); + doc1.put("title", "Book 1"); + doc1.put("author", "Author 1"); + + java.util.Map doc2 = new java.util.HashMap<>(); + doc2.put("title", "Book 2"); + doc2.put("calc", constant(42)); + + Pipeline pipeline = firestore.pipeline().literals(doc1, doc2); + com.google.firestore.v1.Pipeline protoPipeline = pipeline.toProto(); + assertThat(protoPipeline.getStagesCount()).isEqualTo(1); + + Stage literalsStage = protoPipeline.getStages(0); + assertThat(literalsStage.getName()).isEqualTo("literals"); + assertThat(literalsStage.getArgsCount()).isEqualTo(2); + assertThat(literalsStage.getOptionsCount()).isEqualTo(0); + + java.util.Map doc1Fields = literalsStage.getArgs(0).getMapValue().getFieldsMap(); + assertThat(doc1Fields.get("title").getStringValue()).isEqualTo("Book 1"); + assertThat(doc1Fields.get("author").getStringValue()).isEqualTo("Author 1"); + + java.util.Map doc2Fields = literalsStage.getArgs(1).getMapValue().getFieldsMap(); + assertThat(doc2Fields.get("title").getStringValue()).isEqualTo("Book 2"); + assertThat(doc2Fields.get("calc").getIntegerValue()).isEqualTo(42L); + } + + @Test + public void testLiteralsWithNestedExpressionsProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + java.util.Map inner = new java.util.HashMap<>(); + inner.put("sum", add(constant(1), constant(2))); + inner.put("plain", 1); + java.util.Map constantMap = new java.util.HashMap<>(); + constantMap.put("stringValue", "abc"); + + java.util.Map doc = new java.util.HashMap<>(); + doc.put("top", add(constant(1), constant(1))); + doc.put("nestedMap", inner); + doc.put("nestedList", java.util.Arrays.asList(1, add(constant(2), constant(3)))); + doc.put("constantMap", constantMap); + doc.put("constantList", java.util.Arrays.asList(1, 2)); + + Stage literalsStage = firestore.pipeline().literals(doc).toProto().getStages(0); + java.util.Map fields = literalsStage.getArgs(0).getMapValue().getFieldsMap(); + + assertThat(fields.get("top").getFunctionValue().getName()).isEqualTo("add"); + + assertThat(fields.get("nestedMap").getFunctionValue().getName()).isEqualTo("map"); + assertThat(fields.get("nestedList").getFunctionValue().getName()).isEqualTo("array"); + java.util.List listArgs = fields.get("nestedList").getFunctionValue().getArgsList(); + assertThat(listArgs.get(0).getIntegerValue()).isEqualTo(1L); + assertThat(listArgs.get(1).getFunctionValue().getName()).isEqualTo("add"); + + // Maps and lists without expressions are encoded as plain map and array values. + assertThat(fields.get("constantMap").hasMapValue()).isTrue(); + assertThat( + fields + .get("constantMap") + .getMapValue() + .getFieldsMap() + .get("stringValue") + .getStringValue()) + .isEqualTo("abc"); + assertThat(fields.get("constantList").getArrayValue().getValuesCount()).isEqualTo(2); + } + + @Test + public void testInsertConvenienceOverloadProtoEncoding() { + FirestoreOptions options = + FirestoreOptions.newBuilder() + .setProjectId("new-project") + .setDatabaseId("(default)") + .build(); + Firestore firestore = options.getService(); + + com.google.firestore.v1.Pipeline insertProto = + firestore.pipeline().collection("books").insert().toProto(); + assertThat(insertProto) + .isEqualTo(firestore.pipeline().collection("books").insert(new Insert()).toProto()); + assertThat(insertProto.getStages(1).getName()).isEqualTo("insert"); + } } diff --git a/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java b/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java index 3af75da42fe7..12f746f83654 100644 --- a/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java +++ b/java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java @@ -126,6 +126,7 @@ import com.google.cloud.firestore.LocalFirestoreHelper; import com.google.cloud.firestore.Pipeline; import com.google.cloud.firestore.PipelineResult; +import com.google.cloud.firestore.QuerySnapshot; import com.google.cloud.firestore.pipeline.expressions.AggregateFunction; import com.google.cloud.firestore.pipeline.expressions.Expression; import com.google.cloud.firestore.pipeline.expressions.Field; @@ -137,11 +138,13 @@ import com.google.cloud.firestore.pipeline.stages.ExplainOptions; import com.google.cloud.firestore.pipeline.stages.FindNearest; import com.google.cloud.firestore.pipeline.stages.FindNearestOptions; +import com.google.cloud.firestore.pipeline.stages.Insert; import com.google.cloud.firestore.pipeline.stages.PipelineExecuteOptions; import com.google.cloud.firestore.pipeline.stages.RawOptions; import com.google.cloud.firestore.pipeline.stages.RawStage; import com.google.cloud.firestore.pipeline.stages.Sample; import com.google.cloud.firestore.pipeline.stages.UnnestOptions; +import com.google.cloud.firestore.pipeline.stages.Upsert; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -4765,4 +4768,470 @@ public void testLiteralsWithExpressions() throws Exception { assertThat(results.get(0).getData().get("base")).isEqualTo(10L); assertThat(results.get(0).getData().get("doubled")).isEqualTo(20L); } + + @Test + public void testInsertStage() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "New Book"); + data.put("author", "Author 1"); + + List results = + firestore + .pipeline() + .literals(data) + .insert( + new Insert() + .withCollection(dmlCol.getPath()) + .withDocumentIdExpression(constant("newBook_insert_1"))) + .execute() + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + + DocumentSnapshot snap = dmlCol.document("newBook_insert_1").get().get(); + assertThat(snap.exists()).isTrue(); + assertThat(snap.get("title")).isEqualTo("New Book"); + } + + @Test + public void testUpsertStageWithTransforms() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Upserted Book"); + data.put("count", 1); + + List results = + firestore + .pipeline() + .literals(data) + .upsert( + new Upsert(add(field("count"), constant(1)).as("count")) + .withCollection(dmlCol.getPath()) + .withDocumentIdExpression(constant("upsertBook_1"))) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + + DocumentSnapshot snap = dmlCol.document("upsertBook_1").get().get(); + assertThat(snap.exists()).isTrue(); + assertThat(snap.get("title")).isEqualTo("Upserted Book"); + } + + @Test + public void testDMLWithAtomicOption() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Atomic Book"); + + List results = + firestore + .pipeline() + .literals(data) + .insert( + new Insert() + .withCollection(dmlCol.getPath()) + .withDocumentIdExpression(constant("atomicBook_1"))) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + + DocumentSnapshot snap = dmlCol.document("atomicBook_1").get().get(); + assertThat(snap.exists()).isTrue(); + } + + @Test + public void testInsertUpsertStagesInsideTransaction() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + firestore + .runTransaction( + transaction -> { + java.util.Map data = new java.util.HashMap<>(); + data.put("title", "Tx Book"); + Pipeline insertPpl = + firestore + .pipeline() + .literals(data) + .insert( + new Insert() + .withCollection(dmlCol.getPath()) + .withDocumentIdExpression(constant("txBook_1"))); + List res = transaction.execute(insertPpl).get().getResults(); + assertThat(res).hasSize(1); + assertThat(res.get(0).getData().get("documents_modified")).isEqualTo(1L); + return null; + }) + .get(); + + DocumentSnapshot snap = dmlCol.document("txBook_1").get().get(); + assertThat(snap.exists()).isTrue(); + assertThat(snap.get("title")).isEqualTo("Tx Book"); + } + + @Test + public void testDeleteNonExistingDocument() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("nonExistingId_999"))) + .delete() + .execute() + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(0L); + } + + @Test + public void testDeleteWithAtomicTrue() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .delete() + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + assertThat(dmlCol.document("book1").get().get().exists()).isFalse(); + } + + @Test + public void testDeleteWithAtomicFalse() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book2"))) + .delete() + .execute(new PipelineExecuteOptions().withAtomic(false)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + assertThat(dmlCol.document("book2").get().get().exists()).isFalse(); + } + + @Test + public void testDeleteStageInsideTransaction() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + firestore + .runTransaction( + transaction -> { + Pipeline deletePpl = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .delete(); + List res = transaction.execute(deletePpl).get().getResults(); + assertThat(res).hasSize(1); + assertThat(res.get(0).getData().get("documents_modified")).isEqualTo(1L); + return null; + }) + .get(); + + assertThat(dmlCol.document("book1").get().get().exists()).isFalse(); + } + + @Test + public void testUpdateSingleDocWithAddFields() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book3"))) + .addFields(field("__name__").documentId().as("id")) + .update(constant("baz").as("foo")) + .execute() + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = dmlCol.document("book3").get().get(); + assertThat(snap.get("foo")).isEqualTo("baz"); + assertThat(snap.get("id")).isEqualTo("book3"); + } + + @Test + public void testUpdateWithMultipleVarargExpressions() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .update(constant("UpdatedMulti").as("status"), constant(99L).as("newField")) + .execute() + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = dmlCol.document("book1").get().get(); + assertThat(snap.get("status")).isEqualTo("UpdatedMulti"); + assertThat(snap.get("newField")).isEqualTo(99L); + } + + @Test + public void testUpdateAtomically() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .update(constant("AtomicUpdate").as("status")) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = dmlCol.document("book1").get().get(); + assertThat(snap.get("status")).isEqualTo("AtomicUpdate"); + } + + @Test + public void testUpdateStageInsideTransaction() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + firestore + .runTransaction( + transaction -> { + Pipeline updatePpl = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .update(constant("TxUpdate").as("status")); + List res = transaction.execute(updatePpl).get().getResults(); + assertThat(res).hasSize(1); + assertThat(res.get(0).getData().get("documents_modified")).isEqualTo(1L); + return null; + }) + .get(); + + assertThat(dmlCol.document("book1").get().get().get("status")).isEqualTo("TxUpdate"); + } + + @Test + public void testInsertAutoGeneratedId() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .removeFields("__name__") + .insert(new Insert().withCollection(dmlCol.getPath())) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + QuerySnapshot allDocs = dmlCol.get().get(); + assertThat(allDocs.size()).isEqualTo(bookDocs.size() + 1); + } + + @Test + public void testInsertFailsWhenDocumentAlreadyExists() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + assertThrows( + Exception.class, + () -> + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .insert( + new Insert() + .withCollection(dmlCol.getPath()) + .withDocumentIdExpression(constant("book2"))) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get()); + } + + @Test + public void testInsertIntoDifferentCollection() throws Exception { + CollectionReference sourceCol = testCollectionWithDocs(bookDocs); + CollectionReference targetCol = firestore.collection(LocalFirestoreHelper.autoId()); + List results = + firestore + .pipeline() + .collection(sourceCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .insert(new Insert().withCollection(targetCol.getPath())) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + QuerySnapshot targetDocs = targetCol.get().get(); + assertThat(targetDocs.size()).isEqualTo(1); + assertThat(targetDocs.getDocuments().get(0).getString("title")) + .isEqualTo("The Hitchhiker's Guide to the Galaxy"); + } + + @Test + public void testInsertInPlaceFromLiterals() throws Exception { + CollectionReference dmlCol = firestore.collection(LocalFirestoreHelper.autoId()); + DocumentReference target = dmlCol.document("literal_doc"); + Map doc = new HashMap<>(); + doc.put("__name__", target); + doc.put("title", "Inserted In Place"); + + List results = + firestore + .pipeline() + .literals(doc) + .insert() + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + assertThat(target.get().get().getString("title")).isEqualTo("Inserted In Place"); + } + + @Test + public void testUpsertInPlaceWithVarargs() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .upsert( + constant("Comedy Sci-Fi").as("genre"), + add(field("rating"), constant(0.5)).as("rating")) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = dmlCol.document("book1").get().get(); + assertThat(snap.get("genre")).isEqualTo("Comedy Sci-Fi"); + assertThat(snap.get("rating")).isEqualTo(4.7); + } + + @Test + public void testUpsertInPlaceWithListViaStage() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + List results = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .upsert( + new Upsert() + .withAdditionalFields( + java.util.Arrays.asList( + constant("Updated Genre List").as("genre"), + constant(5.0).as("rating")))) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = dmlCol.document("book1").get().get(); + assertThat(snap.get("genre")).isEqualTo("Updated Genre List"); + assertThat(snap.get("rating")).isEqualTo(5.0); + } + + @Test + public void testUpsertIntoDifferentCollectionWithoutAdditionalFields() throws Exception { + CollectionReference sourceCol = testCollectionWithDocs(bookDocs); + CollectionReference targetCol = firestore.collection(LocalFirestoreHelper.autoId()); + List results = + firestore + .pipeline() + .collection(sourceCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .upsert( + new Upsert() + .withCollection(targetCol.getPath()) + .withDocumentIdExpression(constant("target_doc_2"))) + .execute(new PipelineExecuteOptions().withAtomic(true)) + .get() + .getResults(); + + assertThat(results).hasSize(1); + assertThat(results.get(0).getData().get("documents_modified")).isEqualTo(1L); + DocumentSnapshot snap = targetCol.document("target_doc_2").get().get(); + assertThat(snap.exists()).isTrue(); + assertThat(snap.getString("title")).isEqualTo("The Hitchhiker's Guide to the Galaxy"); + } + + @Test + public void testUpsertStageInsideTransaction() throws Exception { + CollectionReference dmlCol = testCollectionWithDocs(bookDocs); + firestore + .runTransaction( + transaction -> { + Pipeline upsertPpl = + firestore + .pipeline() + .collection(dmlCol.getPath()) + .where(equal(field("__name__").documentId(), constant("book1"))) + .upsert(constant("TxUpsert").as("status")); + List res = transaction.execute(upsertPpl).get().getResults(); + assertThat(res).hasSize(1); + assertThat(res.get(0).getData().get("documents_modified")).isEqualTo(1L); + return null; + }) + .get(); + + assertThat(dmlCol.document("book1").get().get().get("status")).isEqualTo("TxUpsert"); + } + + @Test + public void testLiteralsWithNestedExpressions() throws Exception { + java.util.Map deepest = new java.util.HashMap<>(); + deepest.put("product", multiply(constant(2), constant(3))); + java.util.Map nested = new java.util.HashMap<>(); + nested.put("sum", add(constant(1), constant(2))); + nested.put("plain", "value"); + nested.put("deeper", deepest); + + java.util.Map data = new java.util.HashMap<>(); + data.put("nestedMap", nested); + data.put("nestedList", java.util.Arrays.asList(1L, add(constant(1), constant(2)))); + + List results = firestore.pipeline().literals(data).execute().get().getResults(); + + assertThat(results).hasSize(1); + java.util.Map expectedDeepest = new java.util.HashMap<>(); + expectedDeepest.put("product", 6L); + java.util.Map expectedNested = new java.util.HashMap<>(); + expectedNested.put("sum", 3L); + expectedNested.put("plain", "value"); + expectedNested.put("deeper", expectedDeepest); + assertThat(results.get(0).getData().get("nestedMap")).isEqualTo(expectedNested); + assertThat(results.get(0).getData().get("nestedList")) + .isEqualTo(java.util.Arrays.asList(1L, 3L)); + } } From 6f10781af066b0587dff7f0b15443bc6c93fc77a Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Thu, 22 Oct 2026 19:20:41 +0200 Subject: [PATCH 16/35] fix(bigquery-jdbc): preserve microsecond precision for `TIME` in `getString()` and LocalTime conversions (#14715) b/570669274 ## Summary Fixes sub-second truncation for BigQuery `TIME` values (including nested `ARRAY