diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index e17df54950..3648968d72 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -34,7 +34,7 @@ - 26.44.0 + 26.45.0 1.20.0 1.0.5.RELEASE 1.3.0 diff --git a/spring-cloud-previews/README.md b/spring-cloud-previews/README.md index 087248605b..00d628534e 100644 --- a/spring-cloud-previews/README.md +++ b/spring-cloud-previews/README.md @@ -16,112 +16,112 @@ add the following dependency to your `pom.xml`: | Client Library | Starter Maven Artifact | |----------------| -----------------------| -|[java/accessapproval](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/accessapproval/README.md)|com.google.cloud:google-cloud-accessapproval-spring-starter| -|[java/accesscontextmanager](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/accesscontextmanager/README.md)|com.google.cloud:google-identity-accesscontextmanager-spring-starter| -|[java/advisorynotifications](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/advisorynotifications/README.md)|com.google.cloud:google-cloud-advisorynotifications-spring-starter| -|[java/aiplatform](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/aiplatform/README.md)|com.google.cloud:google-cloud-aiplatform-spring-starter| -|[java/analyticshub](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/analyticshub/README.md)|com.google.cloud:google-cloud-analyticshub-spring-starter| -|[java/api-gateway](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/api-gateway/README.md)|com.google.cloud:google-cloud-api-gateway-spring-starter| -|[java/apigee-connect](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/apigee-connect/README.md)|com.google.cloud:google-cloud-apigee-connect-spring-starter| -|[java/apikeys](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/apikeys/README.md)|com.google.cloud:google-cloud-apikeys-spring-starter| -|[java/appengine-admin](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/appengine-admin/README.md)|com.google.cloud:google-cloud-appengine-admin-spring-starter| -|[java/artifact-registry](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/artifact-registry/README.md)|com.google.cloud:google-cloud-artifact-registry-spring-starter| -|[java/asset](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/asset/README.md)|com.google.cloud:google-cloud-asset-spring-starter| -|[java/assured-workloads](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/assured-workloads/README.md)|com.google.cloud:google-cloud-assured-workloads-spring-starter| -|[java/automl](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/automl/README.md)|com.google.cloud:google-cloud-automl-spring-starter| -|[java/backupdr](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/backupdr/README.md)|com.google.cloud:google-cloud-backupdr-spring-starter| -|[java/bigqueryconnection](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/bigqueryconnection/README.md)|com.google.cloud:google-cloud-bigqueryconnection-spring-starter| -|[java/bigquerydatatransfer](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/bigquerydatatransfer/README.md)|com.google.cloud:google-cloud-bigquerydatatransfer-spring-starter| -|[java/bigqueryreservation](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/bigqueryreservation/README.md)|com.google.cloud:google-cloud-bigqueryreservation-spring-starter| -|[java/billing](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/billing/README.md)|com.google.cloud:google-cloud-billing-spring-starter| -|[java/billingbudgets](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/billingbudgets/README.md)|com.google.cloud:google-cloud-billingbudgets-spring-starter| -|[java/binary-authorization](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/binary-authorization/README.md)|com.google.cloud:google-cloud-binary-authorization-spring-starter| -|[java/channel](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/channel/README.md)|com.google.cloud:google-cloud-channel-spring-starter| -|[java/cloudbuild](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/cloudbuild/README.md)|com.google.cloud:google-cloud-build-spring-starter| -|[java/cloudcontrolspartner](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/cloudcontrolspartner/README.md)|com.google.cloud:google-cloud-cloudcontrolspartner-spring-starter| -|[java/cloudquotas](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/cloudquotas/README.md)|com.google.cloud:google-cloud-cloudquotas-spring-starter| -|[java/compute](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/compute/README.md)|com.google.cloud:google-cloud-compute-spring-starter| -|[java/contact-center-insights](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/contact-center-insights/README.md)|com.google.cloud:google-cloud-contact-center-insights-spring-starter| -|[java/container](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/container/README.md)|com.google.cloud:google-cloud-container-spring-starter| -|[java/containeranalysis](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/containeranalysis/README.md)|com.google.cloud:google-cloud-containeranalysis-spring-starter| -|[java/data-fusion](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/data-fusion/README.md)|com.google.cloud:google-cloud-data-fusion-spring-starter| -|[java/datacatalog](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/datacatalog/README.md)|com.google.cloud:google-cloud-datacatalog-spring-starter| -|[java/datalineage](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/datalineage/README.md)|com.google.cloud:google-cloud-datalineage-spring-starter| -|[java/dataplex](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dataplex/README.md)|com.google.cloud:google-cloud-dataplex-spring-starter| -|[java/dataproc-metastore](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dataproc-metastore/README.md)|com.google.cloud:google-cloud-dataproc-metastore-spring-starter| -|[java/dataproc](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dataproc/README.md)|com.google.cloud:google-cloud-dataproc-spring-starter| -|[java/datastream](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/datastream/README.md)|com.google.cloud:google-cloud-datastream-spring-starter| -|[java/debugger-client](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/debugger-client/README.md)|com.google.cloud:google-cloud-debugger-client-spring-starter| -|[java/deploy](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/deploy/README.md)|com.google.cloud:google-cloud-deploy-spring-starter| -|[java/dialogflow](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dialogflow/README.md)|com.google.cloud:google-cloud-dialogflow-spring-starter| -|[java/discoveryengine](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/discoveryengine/README.md)|com.google.cloud:google-cloud-discoveryengine-spring-starter| -|[java/distributedcloudedge](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/distributedcloudedge/README.md)|com.google.cloud:google-cloud-distributedcloudedge-spring-starter| -|[java/dlp](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dlp/README.md)|com.google.cloud:google-cloud-dlp-spring-starter| -|[java/dms](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/dms/README.md)|com.google.cloud:google-cloud-dms-spring-starter| -|[java/document-ai](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/document-ai/README.md)|com.google.cloud:google-cloud-document-ai-spring-starter| -|[java/domains](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/domains/README.md)|com.google.cloud:google-cloud-domains-spring-starter| -|[java/edgenetwork](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/edgenetwork/README.md)|com.google.cloud:google-cloud-edgenetwork-spring-starter| -|[java/essential-contacts](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/essential-contacts/README.md)|com.google.cloud:google-cloud-essential-contacts-spring-starter| -|[java/eventarc](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/eventarc/README.md)|com.google.cloud:google-cloud-eventarc-spring-starter| -|[java/filestore](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/filestore/README.md)|com.google.cloud:google-cloud-filestore-spring-starter| -|[java/functions](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/functions/README.md)|com.google.cloud:google-cloud-functions-spring-starter| -|[java/gkehub](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/gkehub/README.md)|com.google.cloud:google-cloud-gkehub-spring-starter| -|[java/gsuite-addons](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/gsuite-addons/README.md)|com.google.cloud:google-cloud-gsuite-addons-spring-starter| -|[java/iam-admin](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/iam-admin/README.md)|com.google.cloud:google-iam-admin-spring-starter| -|[java/iam](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/iam/README.md)|com.google.cloud:google-iam-policy-spring-starter| -|[java/iamcredentials](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/iamcredentials/README.md)|com.google.cloud:google-cloud-iamcredentials-spring-starter| -|[java/iap](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/iap/README.md)|com.google.cloud:google-cloud-iap-spring-starter| -|[java/ids](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/ids/README.md)|com.google.cloud:google-cloud-ids-spring-starter| -|[java/infra-manager](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/infra-manager/README.md)|com.google.cloud:google-cloud-infra-manager-spring-starter| -|[java/iot](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/iot/README.md)|com.google.cloud:google-cloud-iot-spring-starter| -|[java/language](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/language/README.md)|com.google.cloud:google-cloud-language-spring-starter| -|[java/managed-identities](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/managed-identities/README.md)|com.google.cloud:google-cloud-managed-identities-spring-starter| -|[java/memcache](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/memcache/README.md)|com.google.cloud:google-cloud-memcache-spring-starter| -|[java/monitoring-dashboards](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/monitoring-dashboards/README.md)|com.google.cloud:google-cloud-monitoring-dashboard-spring-starter| -|[java/network-management](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/network-management/README.md)|com.google.cloud:google-cloud-network-management-spring-starter| -|[java/network-security](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/network-security/README.md)|com.google.cloud:google-cloud-network-security-spring-starter| -|[java/networkconnectivity](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/networkconnectivity/README.md)|com.google.cloud:google-cloud-networkconnectivity-spring-starter| -|[java/notebooks](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/notebooks/README.md)|com.google.cloud:google-cloud-notebooks-spring-starter| -|[java/optimization](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/optimization/README.md)|com.google.cloud:google-cloud-optimization-spring-starter| -|[java/orchestration-airflow](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/orchestration-airflow/README.md)|com.google.cloud:google-cloud-orchestration-airflow-spring-starter| -|[java/orgpolicy](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/orgpolicy/README.md)|com.google.cloud:google-cloud-orgpolicy-spring-starter| -|[java/os-config](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/os-config/README.md)|com.google.cloud:google-cloud-os-config-spring-starter| -|[java/os-login](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/os-login/README.md)|com.google.cloud:google-cloud-os-login-spring-starter| -|[java/policy-troubleshooter](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/policy-troubleshooter/README.md)|com.google.cloud:google-cloud-policy-troubleshooter-spring-starter| -|[java/profiler](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/profiler/README.md)|com.google.cloud:google-cloud-profiler-spring-starter| -|[java/publicca](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/publicca/README.md)|com.google.cloud:google-cloud-publicca-spring-starter| -|[java/recaptchaenterprise](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/recaptchaenterprise/README.md)|com.google.cloud:google-cloud-recaptchaenterprise-spring-starter| -|[java/recommender](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/recommender/README.md)|com.google.cloud:google-cloud-recommender-spring-starter| -|[java/redis](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/redis/README.md)|com.google.cloud:google-cloud-redis-spring-starter| -|[java/resource-settings](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/resource-settings/README.md)|com.google.cloud:google-cloud-resource-settings-spring-starter| -|[java/retail](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/retail/README.md)|com.google.cloud:google-cloud-retail-spring-starter| -|[java/scheduler](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/scheduler/README.md)|com.google.cloud:google-cloud-scheduler-spring-starter| -|[java/securesourcemanager](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/securesourcemanager/README.md)|com.google.cloud:google-cloud-securesourcemanager-spring-starter| -|[java/security-private-ca](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/security-private-ca/README.md)|com.google.cloud:google-cloud-security-private-ca-spring-starter| -|[java/securitycenter](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/securitycenter/README.md)|com.google.cloud:google-cloud-securitycenter-spring-starter| -|[java/securitycentermanagement](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/securitycentermanagement/README.md)|com.google.cloud:google-cloud-securitycentermanagement-spring-starter| -|[java/securityposture](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/securityposture/README.md)|com.google.cloud:google-cloud-securityposture-spring-starter| -|[java/service-control](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/service-control/README.md)|com.google.cloud:google-cloud-service-control-spring-starter| -|[java/service-management](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/service-management/README.md)|com.google.cloud:google-cloud-service-management-spring-starter| -|[java/service-usage](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/service-usage/README.md)|com.google.cloud:google-cloud-service-usage-spring-starter| -|[java/servicedirectory](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/servicedirectory/README.md)|com.google.cloud:google-cloud-servicedirectory-spring-starter| -|[java/shell](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/shell/README.md)|com.google.cloud:google-cloud-shell-spring-starter| -|[java/speech](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/speech/README.md)|com.google.cloud:google-cloud-speech-spring-starter| -|[java/storage-transfer](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/storage-transfer/README.md)|com.google.cloud:google-cloud-storage-transfer-spring-starter| -|[java/talent](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/talent/README.md)|com.google.cloud:google-cloud-talent-spring-starter| -|[java/tasks](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/tasks/README.md)|com.google.cloud:google-cloud-tasks-spring-starter| -|[java/telcoautomation](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/telcoautomation/README.md)|com.google.cloud:google-cloud-telcoautomation-spring-starter| -|[java/texttospeech](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/texttospeech/README.md)|com.google.cloud:google-cloud-texttospeech-spring-starter| -|[java/tpu](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/tpu/README.md)|com.google.cloud:google-cloud-tpu-spring-starter| -|[java/trace](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/trace/README.md)|com.google.cloud:google-cloud-trace-spring-starter| -|[java/translate](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/translate/README.md)|com.google.cloud:google-cloud-translate-spring-starter| -|[java/video-intelligence](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/video-intelligence/README.md)|com.google.cloud:google-cloud-video-intelligence-spring-starter| -|[java/video-stitcher](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/video-stitcher/README.md)|com.google.cloud:google-cloud-video-stitcher-spring-starter| -|[java/video-transcoder](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/video-transcoder/README.md)|com.google.cloud:google-cloud-video-transcoder-spring-starter| -|[java/vmmigration](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/vmmigration/README.md)|com.google.cloud:google-cloud-vmmigration-spring-starter| -|[java/vpcaccess](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/vpcaccess/README.md)|com.google.cloud:google-cloud-vpcaccess-spring-starter| -|[java/webrisk](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/webrisk/README.md)|com.google.cloud:google-cloud-webrisk-spring-starter| -|[java/websecurityscanner](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/websecurityscanner/README.md)|com.google.cloud:google-cloud-websecurityscanner-spring-starter| -|[java/workflow-executions](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/workflow-executions/README.md)|com.google.cloud:google-cloud-workflow-executions-spring-starter| -|[java/workflows](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/workflows/README.md)|com.google.cloud:google-cloud-workflows-spring-starter| -|[java/workstations](https://github.com/googleapis/google-cloud-java/blob/v1.41.0/java/workstations/README.md)|com.google.cloud:google-cloud-workstations-spring-starter| +|[java/accessapproval](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/accessapproval/README.md)|com.google.cloud:google-cloud-accessapproval-spring-starter| +|[java/accesscontextmanager](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/accesscontextmanager/README.md)|com.google.cloud:google-identity-accesscontextmanager-spring-starter| +|[java/advisorynotifications](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/advisorynotifications/README.md)|com.google.cloud:google-cloud-advisorynotifications-spring-starter| +|[java/aiplatform](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/aiplatform/README.md)|com.google.cloud:google-cloud-aiplatform-spring-starter| +|[java/analyticshub](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/analyticshub/README.md)|com.google.cloud:google-cloud-analyticshub-spring-starter| +|[java/api-gateway](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/api-gateway/README.md)|com.google.cloud:google-cloud-api-gateway-spring-starter| +|[java/apigee-connect](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/apigee-connect/README.md)|com.google.cloud:google-cloud-apigee-connect-spring-starter| +|[java/apikeys](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/apikeys/README.md)|com.google.cloud:google-cloud-apikeys-spring-starter| +|[java/appengine-admin](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/appengine-admin/README.md)|com.google.cloud:google-cloud-appengine-admin-spring-starter| +|[java/artifact-registry](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/artifact-registry/README.md)|com.google.cloud:google-cloud-artifact-registry-spring-starter| +|[java/asset](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/asset/README.md)|com.google.cloud:google-cloud-asset-spring-starter| +|[java/assured-workloads](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/assured-workloads/README.md)|com.google.cloud:google-cloud-assured-workloads-spring-starter| +|[java/automl](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/automl/README.md)|com.google.cloud:google-cloud-automl-spring-starter| +|[java/backupdr](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/backupdr/README.md)|com.google.cloud:google-cloud-backupdr-spring-starter| +|[java/bigqueryconnection](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/bigqueryconnection/README.md)|com.google.cloud:google-cloud-bigqueryconnection-spring-starter| +|[java/bigquerydatatransfer](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/bigquerydatatransfer/README.md)|com.google.cloud:google-cloud-bigquerydatatransfer-spring-starter| +|[java/bigqueryreservation](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/bigqueryreservation/README.md)|com.google.cloud:google-cloud-bigqueryreservation-spring-starter| +|[java/billing](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/billing/README.md)|com.google.cloud:google-cloud-billing-spring-starter| +|[java/billingbudgets](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/billingbudgets/README.md)|com.google.cloud:google-cloud-billingbudgets-spring-starter| +|[java/binary-authorization](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/binary-authorization/README.md)|com.google.cloud:google-cloud-binary-authorization-spring-starter| +|[java/channel](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/channel/README.md)|com.google.cloud:google-cloud-channel-spring-starter| +|[java/cloudbuild](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/cloudbuild/README.md)|com.google.cloud:google-cloud-build-spring-starter| +|[java/cloudcontrolspartner](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/cloudcontrolspartner/README.md)|com.google.cloud:google-cloud-cloudcontrolspartner-spring-starter| +|[java/cloudquotas](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/cloudquotas/README.md)|com.google.cloud:google-cloud-cloudquotas-spring-starter| +|[java/compute](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/compute/README.md)|com.google.cloud:google-cloud-compute-spring-starter| +|[java/contact-center-insights](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/contact-center-insights/README.md)|com.google.cloud:google-cloud-contact-center-insights-spring-starter| +|[java/container](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/container/README.md)|com.google.cloud:google-cloud-container-spring-starter| +|[java/containeranalysis](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/containeranalysis/README.md)|com.google.cloud:google-cloud-containeranalysis-spring-starter| +|[java/data-fusion](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/data-fusion/README.md)|com.google.cloud:google-cloud-data-fusion-spring-starter| +|[java/datacatalog](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/datacatalog/README.md)|com.google.cloud:google-cloud-datacatalog-spring-starter| +|[java/datalineage](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/datalineage/README.md)|com.google.cloud:google-cloud-datalineage-spring-starter| +|[java/dataplex](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dataplex/README.md)|com.google.cloud:google-cloud-dataplex-spring-starter| +|[java/dataproc-metastore](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dataproc-metastore/README.md)|com.google.cloud:google-cloud-dataproc-metastore-spring-starter| +|[java/dataproc](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dataproc/README.md)|com.google.cloud:google-cloud-dataproc-spring-starter| +|[java/datastream](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/datastream/README.md)|com.google.cloud:google-cloud-datastream-spring-starter| +|[java/debugger-client](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/debugger-client/README.md)|com.google.cloud:google-cloud-debugger-client-spring-starter| +|[java/deploy](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/deploy/README.md)|com.google.cloud:google-cloud-deploy-spring-starter| +|[java/dialogflow](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dialogflow/README.md)|com.google.cloud:google-cloud-dialogflow-spring-starter| +|[java/discoveryengine](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/discoveryengine/README.md)|com.google.cloud:google-cloud-discoveryengine-spring-starter| +|[java/distributedcloudedge](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/distributedcloudedge/README.md)|com.google.cloud:google-cloud-distributedcloudedge-spring-starter| +|[java/dlp](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dlp/README.md)|com.google.cloud:google-cloud-dlp-spring-starter| +|[java/dms](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/dms/README.md)|com.google.cloud:google-cloud-dms-spring-starter| +|[java/document-ai](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/document-ai/README.md)|com.google.cloud:google-cloud-document-ai-spring-starter| +|[java/domains](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/domains/README.md)|com.google.cloud:google-cloud-domains-spring-starter| +|[java/edgenetwork](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/edgenetwork/README.md)|com.google.cloud:google-cloud-edgenetwork-spring-starter| +|[java/essential-contacts](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/essential-contacts/README.md)|com.google.cloud:google-cloud-essential-contacts-spring-starter| +|[java/eventarc](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/eventarc/README.md)|com.google.cloud:google-cloud-eventarc-spring-starter| +|[java/filestore](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/filestore/README.md)|com.google.cloud:google-cloud-filestore-spring-starter| +|[java/functions](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/functions/README.md)|com.google.cloud:google-cloud-functions-spring-starter| +|[java/gkehub](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/gkehub/README.md)|com.google.cloud:google-cloud-gkehub-spring-starter| +|[java/gsuite-addons](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/gsuite-addons/README.md)|com.google.cloud:google-cloud-gsuite-addons-spring-starter| +|[java/iam-admin](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/iam-admin/README.md)|com.google.cloud:google-iam-admin-spring-starter| +|[java/iam](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/iam/README.md)|com.google.cloud:google-iam-policy-spring-starter| +|[java/iamcredentials](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/iamcredentials/README.md)|com.google.cloud:google-cloud-iamcredentials-spring-starter| +|[java/iap](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/iap/README.md)|com.google.cloud:google-cloud-iap-spring-starter| +|[java/ids](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/ids/README.md)|com.google.cloud:google-cloud-ids-spring-starter| +|[java/infra-manager](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/infra-manager/README.md)|com.google.cloud:google-cloud-infra-manager-spring-starter| +|[java/iot](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/iot/README.md)|com.google.cloud:google-cloud-iot-spring-starter| +|[java/language](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/language/README.md)|com.google.cloud:google-cloud-language-spring-starter| +|[java/managed-identities](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/managed-identities/README.md)|com.google.cloud:google-cloud-managed-identities-spring-starter| +|[java/memcache](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/memcache/README.md)|com.google.cloud:google-cloud-memcache-spring-starter| +|[java/monitoring-dashboards](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/monitoring-dashboards/README.md)|com.google.cloud:google-cloud-monitoring-dashboard-spring-starter| +|[java/network-management](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/network-management/README.md)|com.google.cloud:google-cloud-network-management-spring-starter| +|[java/network-security](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/network-security/README.md)|com.google.cloud:google-cloud-network-security-spring-starter| +|[java/networkconnectivity](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/networkconnectivity/README.md)|com.google.cloud:google-cloud-networkconnectivity-spring-starter| +|[java/notebooks](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/notebooks/README.md)|com.google.cloud:google-cloud-notebooks-spring-starter| +|[java/optimization](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/optimization/README.md)|com.google.cloud:google-cloud-optimization-spring-starter| +|[java/orchestration-airflow](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/orchestration-airflow/README.md)|com.google.cloud:google-cloud-orchestration-airflow-spring-starter| +|[java/orgpolicy](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/orgpolicy/README.md)|com.google.cloud:google-cloud-orgpolicy-spring-starter| +|[java/os-config](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/os-config/README.md)|com.google.cloud:google-cloud-os-config-spring-starter| +|[java/os-login](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/os-login/README.md)|com.google.cloud:google-cloud-os-login-spring-starter| +|[java/policy-troubleshooter](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/policy-troubleshooter/README.md)|com.google.cloud:google-cloud-policy-troubleshooter-spring-starter| +|[java/profiler](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/profiler/README.md)|com.google.cloud:google-cloud-profiler-spring-starter| +|[java/publicca](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/publicca/README.md)|com.google.cloud:google-cloud-publicca-spring-starter| +|[java/recaptchaenterprise](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/recaptchaenterprise/README.md)|com.google.cloud:google-cloud-recaptchaenterprise-spring-starter| +|[java/recommender](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/recommender/README.md)|com.google.cloud:google-cloud-recommender-spring-starter| +|[java/redis](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/redis/README.md)|com.google.cloud:google-cloud-redis-spring-starter| +|[java/resource-settings](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/resource-settings/README.md)|com.google.cloud:google-cloud-resource-settings-spring-starter| +|[java/retail](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/retail/README.md)|com.google.cloud:google-cloud-retail-spring-starter| +|[java/scheduler](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/scheduler/README.md)|com.google.cloud:google-cloud-scheduler-spring-starter| +|[java/securesourcemanager](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/securesourcemanager/README.md)|com.google.cloud:google-cloud-securesourcemanager-spring-starter| +|[java/security-private-ca](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/security-private-ca/README.md)|com.google.cloud:google-cloud-security-private-ca-spring-starter| +|[java/securitycenter](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/securitycenter/README.md)|com.google.cloud:google-cloud-securitycenter-spring-starter| +|[java/securitycentermanagement](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/securitycentermanagement/README.md)|com.google.cloud:google-cloud-securitycentermanagement-spring-starter| +|[java/securityposture](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/securityposture/README.md)|com.google.cloud:google-cloud-securityposture-spring-starter| +|[java/service-control](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/service-control/README.md)|com.google.cloud:google-cloud-service-control-spring-starter| +|[java/service-management](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/service-management/README.md)|com.google.cloud:google-cloud-service-management-spring-starter| +|[java/service-usage](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/service-usage/README.md)|com.google.cloud:google-cloud-service-usage-spring-starter| +|[java/servicedirectory](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/servicedirectory/README.md)|com.google.cloud:google-cloud-servicedirectory-spring-starter| +|[java/shell](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/shell/README.md)|com.google.cloud:google-cloud-shell-spring-starter| +|[java/speech](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/speech/README.md)|com.google.cloud:google-cloud-speech-spring-starter| +|[java/storage-transfer](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/storage-transfer/README.md)|com.google.cloud:google-cloud-storage-transfer-spring-starter| +|[java/talent](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/talent/README.md)|com.google.cloud:google-cloud-talent-spring-starter| +|[java/tasks](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/tasks/README.md)|com.google.cloud:google-cloud-tasks-spring-starter| +|[java/telcoautomation](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/telcoautomation/README.md)|com.google.cloud:google-cloud-telcoautomation-spring-starter| +|[java/texttospeech](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/texttospeech/README.md)|com.google.cloud:google-cloud-texttospeech-spring-starter| +|[java/tpu](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/tpu/README.md)|com.google.cloud:google-cloud-tpu-spring-starter| +|[java/trace](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/trace/README.md)|com.google.cloud:google-cloud-trace-spring-starter| +|[java/translate](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/translate/README.md)|com.google.cloud:google-cloud-translate-spring-starter| +|[java/video-intelligence](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/video-intelligence/README.md)|com.google.cloud:google-cloud-video-intelligence-spring-starter| +|[java/video-stitcher](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/video-stitcher/README.md)|com.google.cloud:google-cloud-video-stitcher-spring-starter| +|[java/video-transcoder](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/video-transcoder/README.md)|com.google.cloud:google-cloud-video-transcoder-spring-starter| +|[java/vmmigration](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/vmmigration/README.md)|com.google.cloud:google-cloud-vmmigration-spring-starter| +|[java/vpcaccess](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/vpcaccess/README.md)|com.google.cloud:google-cloud-vpcaccess-spring-starter| +|[java/webrisk](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/webrisk/README.md)|com.google.cloud:google-cloud-webrisk-spring-starter| +|[java/websecurityscanner](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/websecurityscanner/README.md)|com.google.cloud:google-cloud-websecurityscanner-spring-starter| +|[java/workflow-executions](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/workflow-executions/README.md)|com.google.cloud:google-cloud-workflow-executions-spring-starter| +|[java/workflows](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/workflows/README.md)|com.google.cloud:google-cloud-workflows-spring-starter| +|[java/workstations](https://github.com/googleapis/google-cloud-java/blob/v1.42.0/java/workstations/README.md)|com.google.cloud:google-cloud-workstations-spring-starter| diff --git a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringAutoConfiguration.java new file mode 100644 index 0000000000..0b7b3f20a4 --- /dev/null +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringAutoConfiguration.java @@ -0,0 +1,282 @@ +/* + * Copyright 2024 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.aiplatform.v1.spring; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.aiplatform.v1.EvaluationServiceClient; +import com.google.cloud.aiplatform.v1.EvaluationServiceSettings; +import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; +import com.google.cloud.spring.core.DefaultCredentialsProvider; +import com.google.cloud.spring.core.Retry; +import com.google.cloud.spring.core.util.RetryUtil; +import java.io.IOException; +import java.util.Collections; +import javax.annotation.Generated; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Auto-configuration for {@link EvaluationServiceClient}. + * + *

Provides auto-configuration for Spring Boot + * + *

The default instance has everything set to sensible defaults: + * + *

+ */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@AutoConfiguration +@AutoConfigureAfter(GcpContextAutoConfiguration.class) +@ConditionalOnClass(EvaluationServiceClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.aiplatform.v1.evaluation-service.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(EvaluationServiceSpringProperties.class) +public class EvaluationServiceSpringAutoConfiguration { + private final EvaluationServiceSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(EvaluationServiceSpringAutoConfiguration.class); + + protected EvaluationServiceSpringAutoConfiguration( + EvaluationServiceSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from EvaluationService-specific configuration"); + } + this.credentialsProvider = + ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); + } else { + this.credentialsProvider = credentialsProvider; + } + } + + /** + * Provides a default transport channel provider bean, corresponding to the client library's + * default transport channel provider. If the library supports both GRPC and REST transport, and + * the useRest property is configured, the HTTP/JSON transport provider will be used instead of + * GRPC. + * + * @return a default transport channel provider. + */ + @Bean + @ConditionalOnMissingBean(name = "defaultEvaluationServiceTransportChannelProvider") + public TransportChannelProvider defaultEvaluationServiceTransportChannelProvider() { + return EvaluationServiceSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a EvaluationServiceSettings bean configured to use a DefaultCredentialsProvider and + * the client library's default transport channel provider + * (defaultEvaluationServiceTransportChannelProvider()). It also configures the quota project ID + * and executor thread count, if provided through properties. + * + *

Retry settings are also configured from service-level and method-level properties specified + * in EvaluationServiceSpringProperties. Method-level properties will take precedence over + * service-level properties if available, and client library defaults will be used if neither are + * specified. + * + * @param defaultTransportChannelProvider TransportChannelProvider to use in the settings. + * @return a {@link EvaluationServiceSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public EvaluationServiceSettings evaluationServiceSettings( + @Qualifier("defaultEvaluationServiceTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + EvaluationServiceSettings.Builder clientSettingsBuilder = + EvaluationServiceSettings.newBuilder(); + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(EvaluationServiceSettings.getDefaultEndpoint()) + .setHeaderProvider(this.userAgentHeaderProvider()); + if (this.clientProperties.getQuotaProjectId() != null) { + clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } + } + if (this.clientProperties.getExecutorThreadCount() != null) { + ExecutorProvider executorProvider = + EvaluationServiceSettings.defaultExecutorProviderBuilder() + .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) + .build(); + clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } + } + Retry serviceRetry = clientProperties.getRetry(); + if (serviceRetry != null) { + RetrySettings evaluateInstancesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.evaluateInstancesSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .evaluateInstancesSettings() + .setRetrySettings(evaluateInstancesRetrySettings); + + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + + RetrySettings setIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.setIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.setIamPolicySettings().setRetrySettings(setIamPolicyRetrySettings); + + RetrySettings getIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getIamPolicySettings().setRetrySettings(getIamPolicyRetrySettings); + + RetrySettings testIamPermissionsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.testIamPermissionsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .testIamPermissionsSettings() + .setRetrySettings(testIamPermissionsRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry evaluateInstancesRetry = clientProperties.getEvaluateInstancesRetry(); + if (evaluateInstancesRetry != null) { + RetrySettings evaluateInstancesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.evaluateInstancesSettings().getRetrySettings(), + evaluateInstancesRetry); + clientSettingsBuilder + .evaluateInstancesSettings() + .setRetrySettings(evaluateInstancesRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for evaluateInstances from properties."); + } + } + Retry listLocationsRetry = clientProperties.getListLocationsRetry(); + if (listLocationsRetry != null) { + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), listLocationsRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listLocations from properties."); + } + } + Retry getLocationRetry = clientProperties.getGetLocationRetry(); + if (getLocationRetry != null) { + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), getLocationRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getLocation from properties."); + } + } + Retry setIamPolicyRetry = clientProperties.getSetIamPolicyRetry(); + if (setIamPolicyRetry != null) { + RetrySettings setIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.setIamPolicySettings().getRetrySettings(), setIamPolicyRetry); + clientSettingsBuilder.setIamPolicySettings().setRetrySettings(setIamPolicyRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for setIamPolicy from properties."); + } + } + Retry getIamPolicyRetry = clientProperties.getGetIamPolicyRetry(); + if (getIamPolicyRetry != null) { + RetrySettings getIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getIamPolicySettings().getRetrySettings(), getIamPolicyRetry); + clientSettingsBuilder.getIamPolicySettings().setRetrySettings(getIamPolicyRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getIamPolicy from properties."); + } + } + Retry testIamPermissionsRetry = clientProperties.getTestIamPermissionsRetry(); + if (testIamPermissionsRetry != null) { + RetrySettings testIamPermissionsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.testIamPermissionsSettings().getRetrySettings(), + testIamPermissionsRetry); + clientSettingsBuilder + .testIamPermissionsSettings() + .setRetrySettings(testIamPermissionsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for testIamPermissions from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a EvaluationServiceClient bean configured with EvaluationServiceSettings. + * + * @param evaluationServiceSettings settings to configure an instance of client bean. + * @return a {@link EvaluationServiceClient} bean configured with {@link + * EvaluationServiceSettings} + */ + @Bean + @ConditionalOnMissingBean + public EvaluationServiceClient evaluationServiceClient( + EvaluationServiceSettings evaluationServiceSettings) throws IOException { + return EvaluationServiceClient.create(evaluationServiceSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-evaluation-service"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringProperties.java b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringProperties.java new file mode 100644 index 0000000000..6f97c592c2 --- /dev/null +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/EvaluationServiceSpringProperties.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 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.aiplatform.v1.spring; + +import com.google.api.core.BetaApi; +import com.google.cloud.spring.core.Credentials; +import com.google.cloud.spring.core.CredentialsSupplier; +import com.google.cloud.spring.core.Retry; +import javax.annotation.Generated; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** Provides default property values for EvaluationService client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.aiplatform.v1.evaluation-service") +public class EvaluationServiceSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ + @NestedConfigurationProperty + private final Credentials credentials = + new Credentials("https://www.googleapis.com/auth/cloud-platform"); + /** Quota project to use for billing. */ + private String quotaProjectId; + /** Number of threads used for executors. */ + private Integer executorThreadCount; + /** Allow override of retry settings at service level, applying to all of its RPC methods. */ + @NestedConfigurationProperty private Retry retry; + /** + * Allow override of retry settings at method-level for evaluateInstances. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry evaluateInstancesRetry; + /** + * Allow override of retry settings at method-level for listLocations. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listLocationsRetry; + /** + * Allow override of retry settings at method-level for getLocation. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getLocationRetry; + /** + * Allow override of retry settings at method-level for setIamPolicy. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry setIamPolicyRetry; + /** + * Allow override of retry settings at method-level for getIamPolicy. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getIamPolicyRetry; + /** + * Allow override of retry settings at method-level for testIamPermissions. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry testIamPermissionsRetry; + + @Override + public Credentials getCredentials() { + return this.credentials; + } + + public String getQuotaProjectId() { + return this.quotaProjectId; + } + + public void setQuotaProjectId(String quotaProjectId) { + this.quotaProjectId = quotaProjectId; + } + + public Integer getExecutorThreadCount() { + return this.executorThreadCount; + } + + public void setExecutorThreadCount(Integer executorThreadCount) { + this.executorThreadCount = executorThreadCount; + } + + public Retry getRetry() { + return this.retry; + } + + public void setRetry(Retry retry) { + this.retry = retry; + } + + public Retry getEvaluateInstancesRetry() { + return this.evaluateInstancesRetry; + } + + public void setEvaluateInstancesRetry(Retry evaluateInstancesRetry) { + this.evaluateInstancesRetry = evaluateInstancesRetry; + } + + public Retry getListLocationsRetry() { + return this.listLocationsRetry; + } + + public void setListLocationsRetry(Retry listLocationsRetry) { + this.listLocationsRetry = listLocationsRetry; + } + + public Retry getGetLocationRetry() { + return this.getLocationRetry; + } + + public void setGetLocationRetry(Retry getLocationRetry) { + this.getLocationRetry = getLocationRetry; + } + + public Retry getSetIamPolicyRetry() { + return this.setIamPolicyRetry; + } + + public void setSetIamPolicyRetry(Retry setIamPolicyRetry) { + this.setIamPolicyRetry = setIamPolicyRetry; + } + + public Retry getGetIamPolicyRetry() { + return this.getIamPolicyRetry; + } + + public void setGetIamPolicyRetry(Retry getIamPolicyRetry) { + this.getIamPolicyRetry = getIamPolicyRetry; + } + + public Retry getTestIamPermissionsRetry() { + return this.testIamPermissionsRetry; + } + + public void setTestIamPermissionsRetry(Retry testIamPermissionsRetry) { + this.testIamPermissionsRetry = testIamPermissionsRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 94a054b2ab..cc5fc3086d 100644 --- a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -18,6 +18,12 @@ "description": "Auto-configure Google Cloud aiplatform/EndpointService components.", "defaultValue": true }, + { + "name": "com.google.cloud.aiplatform.v1.evaluation-service.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud aiplatform/EvaluationService components.", + "defaultValue": true + }, { "name": "com.google.cloud.aiplatform.v1.feature-online-store-admin-service.enabled", "type": "java.lang.Boolean", diff --git a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 0e0b4ab34e..a386101016 100644 --- a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,6 +1,7 @@ com.google.cloud.aiplatform.v1.spring.DatasetServiceSpringAutoConfiguration com.google.cloud.aiplatform.v1.spring.DeploymentResourcePoolServiceSpringAutoConfiguration com.google.cloud.aiplatform.v1.spring.EndpointServiceSpringAutoConfiguration +com.google.cloud.aiplatform.v1.spring.EvaluationServiceSpringAutoConfiguration com.google.cloud.aiplatform.v1.spring.FeatureOnlineStoreAdminServiceSpringAutoConfiguration com.google.cloud.aiplatform.v1.spring.FeatureOnlineStoreServiceSpringAutoConfiguration com.google.cloud.aiplatform.v1.spring.FeatureRegistryServiceSpringAutoConfiguration diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringAutoConfiguration.java index 2fb77d15a0..e057f6fb44 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringAutoConfiguration.java @@ -210,6 +210,14 @@ public ConversationsSettings conversationsSettings( .generateStatelessSummarySettings() .setRetrySettings(generateStatelessSummaryRetrySettings); + RetrySettings generateStatelessSuggestionRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.generateStatelessSuggestionSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .generateStatelessSuggestionSettings() + .setRetrySettings(generateStatelessSuggestionRetrySettings); + RetrySettings searchKnowledgeRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.searchKnowledgeSettings().getRetrySettings(), serviceRetry); @@ -324,6 +332,20 @@ public ConversationsSettings conversationsSettings( "Configured method-level retry settings for generateStatelessSummary from properties."); } } + Retry generateStatelessSuggestionRetry = clientProperties.getGenerateStatelessSuggestionRetry(); + if (generateStatelessSuggestionRetry != null) { + RetrySettings generateStatelessSuggestionRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.generateStatelessSuggestionSettings().getRetrySettings(), + generateStatelessSuggestionRetry); + clientSettingsBuilder + .generateStatelessSuggestionSettings() + .setRetrySettings(generateStatelessSuggestionRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for generateStatelessSuggestion from properties."); + } + } Retry searchKnowledgeRetry = clientProperties.getSearchKnowledgeRetry(); if (searchKnowledgeRetry != null) { RetrySettings searchKnowledgeRetrySettings = diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringProperties.java index 5b4b67766c..61e5cfa071 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringProperties.java +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ConversationsSpringProperties.java @@ -79,6 +79,11 @@ public class ConversationsSpringProperties implements CredentialsSupplier { * takes precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry generateStatelessSummaryRetry; + /** + * Allow override of retry settings at method-level for generateStatelessSuggestion. If defined, + * this takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry generateStatelessSuggestionRetry; /** * Allow override of retry settings at method-level for searchKnowledge. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -188,6 +193,14 @@ public void setGenerateStatelessSummaryRetry(Retry generateStatelessSummaryRetry this.generateStatelessSummaryRetry = generateStatelessSummaryRetry; } + public Retry getGenerateStatelessSuggestionRetry() { + return this.generateStatelessSuggestionRetry; + } + + public void setGenerateStatelessSuggestionRetry(Retry generateStatelessSuggestionRetry) { + this.generateStatelessSuggestionRetry = generateStatelessSuggestionRetry; + } + public Retry getSearchKnowledgeRetry() { return this.searchKnowledgeRetry; } diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringAutoConfiguration.java new file mode 100644 index 0000000000..aec5a55d0c --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringAutoConfiguration.java @@ -0,0 +1,242 @@ +/* + * Copyright 2024 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.dialogflow.v2.spring; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.dialogflow.v2.EncryptionSpecServiceClient; +import com.google.cloud.dialogflow.v2.EncryptionSpecServiceSettings; +import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; +import com.google.cloud.spring.core.DefaultCredentialsProvider; +import com.google.cloud.spring.core.Retry; +import com.google.cloud.spring.core.util.RetryUtil; +import java.io.IOException; +import java.util.Collections; +import javax.annotation.Generated; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Auto-configuration for {@link EncryptionSpecServiceClient}. + * + *

Provides auto-configuration for Spring Boot + * + *

The default instance has everything set to sensible defaults: + * + *

+ */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@AutoConfiguration +@AutoConfigureAfter(GcpContextAutoConfiguration.class) +@ConditionalOnClass(EncryptionSpecServiceClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.dialogflow.v2.encryption-spec-service.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(EncryptionSpecServiceSpringProperties.class) +public class EncryptionSpecServiceSpringAutoConfiguration { + private final EncryptionSpecServiceSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(EncryptionSpecServiceSpringAutoConfiguration.class); + + protected EncryptionSpecServiceSpringAutoConfiguration( + EncryptionSpecServiceSpringProperties clientProperties, + CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from EncryptionSpecService-specific configuration"); + } + this.credentialsProvider = + ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); + } else { + this.credentialsProvider = credentialsProvider; + } + } + + /** + * Provides a default transport channel provider bean, corresponding to the client library's + * default transport channel provider. If the library supports both GRPC and REST transport, and + * the useRest property is configured, the HTTP/JSON transport provider will be used instead of + * GRPC. + * + * @return a default transport channel provider. + */ + @Bean + @ConditionalOnMissingBean(name = "defaultEncryptionSpecServiceTransportChannelProvider") + public TransportChannelProvider defaultEncryptionSpecServiceTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return EncryptionSpecServiceSettings.defaultHttpJsonTransportProviderBuilder().build(); + } + return EncryptionSpecServiceSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a EncryptionSpecServiceSettings bean configured to use a DefaultCredentialsProvider + * and the client library's default transport channel provider + * (defaultEncryptionSpecServiceTransportChannelProvider()). It also configures the quota project + * ID and executor thread count, if provided through properties. + * + *

Retry settings are also configured from service-level and method-level properties specified + * in EncryptionSpecServiceSpringProperties. Method-level properties will take precedence over + * service-level properties if available, and client library defaults will be used if neither are + * specified. + * + * @param defaultTransportChannelProvider TransportChannelProvider to use in the settings. + * @return a {@link EncryptionSpecServiceSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public EncryptionSpecServiceSettings encryptionSpecServiceSettings( + @Qualifier("defaultEncryptionSpecServiceTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + EncryptionSpecServiceSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = EncryptionSpecServiceSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = EncryptionSpecServiceSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(EncryptionSpecServiceSettings.getDefaultEndpoint()) + .setHeaderProvider(this.userAgentHeaderProvider()); + if (this.clientProperties.getQuotaProjectId() != null) { + clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } + } + if (this.clientProperties.getExecutorThreadCount() != null) { + ExecutorProvider executorProvider = + EncryptionSpecServiceSettings.defaultExecutorProviderBuilder() + .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) + .build(); + clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } + } + Retry serviceRetry = clientProperties.getRetry(); + if (serviceRetry != null) { + RetrySettings getEncryptionSpecRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getEncryptionSpecSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .getEncryptionSpecSettings() + .setRetrySettings(getEncryptionSpecRetrySettings); + + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry getEncryptionSpecRetry = clientProperties.getGetEncryptionSpecRetry(); + if (getEncryptionSpecRetry != null) { + RetrySettings getEncryptionSpecRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getEncryptionSpecSettings().getRetrySettings(), + getEncryptionSpecRetry); + clientSettingsBuilder + .getEncryptionSpecSettings() + .setRetrySettings(getEncryptionSpecRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for getEncryptionSpec from properties."); + } + } + Retry listLocationsRetry = clientProperties.getListLocationsRetry(); + if (listLocationsRetry != null) { + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), listLocationsRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listLocations from properties."); + } + } + Retry getLocationRetry = clientProperties.getGetLocationRetry(); + if (getLocationRetry != null) { + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), getLocationRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getLocation from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a EncryptionSpecServiceClient bean configured with EncryptionSpecServiceSettings. + * + * @param encryptionSpecServiceSettings settings to configure an instance of client bean. + * @return a {@link EncryptionSpecServiceClient} bean configured with {@link + * EncryptionSpecServiceSettings} + */ + @Bean + @ConditionalOnMissingBean + public EncryptionSpecServiceClient encryptionSpecServiceClient( + EncryptionSpecServiceSettings encryptionSpecServiceSettings) throws IOException { + return EncryptionSpecServiceClient.create(encryptionSpecServiceSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-encryption-spec-service"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringProperties.java new file mode 100644 index 0000000000..5b6470391b --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/EncryptionSpecServiceSpringProperties.java @@ -0,0 +1,123 @@ +/* + * Copyright 2024 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.dialogflow.v2.spring; + +import com.google.api.core.BetaApi; +import com.google.cloud.spring.core.Credentials; +import com.google.cloud.spring.core.CredentialsSupplier; +import com.google.cloud.spring.core.Retry; +import javax.annotation.Generated; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** Provides default property values for EncryptionSpecService client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.dialogflow.v2.encryption-spec-service") +public class EncryptionSpecServiceSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ + @NestedConfigurationProperty + private final Credentials credentials = + new Credentials( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow"); + /** Quota project to use for billing. */ + private String quotaProjectId; + /** Number of threads used for executors. */ + private Integer executorThreadCount; + /** Allow override of default transport channel provider to use REST instead of gRPC. */ + private boolean useRest = false; + /** Allow override of retry settings at service level, applying to all of its RPC methods. */ + @NestedConfigurationProperty private Retry retry; + /** + * Allow override of retry settings at method-level for getEncryptionSpec. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getEncryptionSpecRetry; + /** + * Allow override of retry settings at method-level for listLocations. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listLocationsRetry; + /** + * Allow override of retry settings at method-level for getLocation. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getLocationRetry; + + @Override + public Credentials getCredentials() { + return this.credentials; + } + + public String getQuotaProjectId() { + return this.quotaProjectId; + } + + public void setQuotaProjectId(String quotaProjectId) { + this.quotaProjectId = quotaProjectId; + } + + public boolean getUseRest() { + return this.useRest; + } + + public void setUseRest(boolean useRest) { + this.useRest = useRest; + } + + public Integer getExecutorThreadCount() { + return this.executorThreadCount; + } + + public void setExecutorThreadCount(Integer executorThreadCount) { + this.executorThreadCount = executorThreadCount; + } + + public Retry getRetry() { + return this.retry; + } + + public void setRetry(Retry retry) { + this.retry = retry; + } + + public Retry getGetEncryptionSpecRetry() { + return this.getEncryptionSpecRetry; + } + + public void setGetEncryptionSpecRetry(Retry getEncryptionSpecRetry) { + this.getEncryptionSpecRetry = getEncryptionSpecRetry; + } + + public Retry getListLocationsRetry() { + return this.listLocationsRetry; + } + + public void setListLocationsRetry(Retry listLocationsRetry) { + this.listLocationsRetry = listLocationsRetry; + } + + public Retry getGetLocationRetry() { + return this.getLocationRetry; + } + + public void setGetLocationRetry(Retry getLocationRetry) { + this.getLocationRetry = getLocationRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringAutoConfiguration.java new file mode 100644 index 0000000000..2786aa11f6 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringAutoConfiguration.java @@ -0,0 +1,308 @@ +/* + * Copyright 2024 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.dialogflow.v2.spring; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.ExecutorProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.dialogflow.v2.GeneratorsClient; +import com.google.cloud.dialogflow.v2.GeneratorsSettings; +import com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration; +import com.google.cloud.spring.core.DefaultCredentialsProvider; +import com.google.cloud.spring.core.Retry; +import com.google.cloud.spring.core.util.RetryUtil; +import java.io.IOException; +import java.util.Collections; +import javax.annotation.Generated; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Auto-configuration for {@link GeneratorsClient}. + * + *

Provides auto-configuration for Spring Boot + * + *

The default instance has everything set to sensible defaults: + * + *

+ */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@AutoConfiguration +@AutoConfigureAfter(GcpContextAutoConfiguration.class) +@ConditionalOnClass(GeneratorsClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.dialogflow.v2.generators.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(GeneratorsSpringProperties.class) +public class GeneratorsSpringAutoConfiguration { + private final GeneratorsSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = LogFactory.getLog(GeneratorsSpringAutoConfiguration.class); + + protected GeneratorsSpringAutoConfiguration( + GeneratorsSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Generators-specific configuration"); + } + this.credentialsProvider = + ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); + } else { + this.credentialsProvider = credentialsProvider; + } + } + + /** + * Provides a default transport channel provider bean, corresponding to the client library's + * default transport channel provider. If the library supports both GRPC and REST transport, and + * the useRest property is configured, the HTTP/JSON transport provider will be used instead of + * GRPC. + * + * @return a default transport channel provider. + */ + @Bean + @ConditionalOnMissingBean(name = "defaultGeneratorsTransportChannelProvider") + public TransportChannelProvider defaultGeneratorsTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return GeneratorsSettings.defaultHttpJsonTransportProviderBuilder().build(); + } + return GeneratorsSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a GeneratorsSettings bean configured to use a DefaultCredentialsProvider and the + * client library's default transport channel provider + * (defaultGeneratorsTransportChannelProvider()). It also configures the quota project ID and + * executor thread count, if provided through properties. + * + *

Retry settings are also configured from service-level and method-level properties specified + * in GeneratorsSpringProperties. Method-level properties will take precedence over service-level + * properties if available, and client library defaults will be used if neither are specified. + * + * @param defaultTransportChannelProvider TransportChannelProvider to use in the settings. + * @return a {@link GeneratorsSettings} bean configured with {@link TransportChannelProvider} + * bean. + */ + @Bean + @ConditionalOnMissingBean + public GeneratorsSettings generatorsSettings( + @Qualifier("defaultGeneratorsTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + GeneratorsSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = GeneratorsSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = GeneratorsSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(GeneratorsSettings.getDefaultEndpoint()) + .setHeaderProvider(this.userAgentHeaderProvider()); + if (this.clientProperties.getQuotaProjectId() != null) { + clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } + } + if (this.clientProperties.getExecutorThreadCount() != null) { + ExecutorProvider executorProvider = + GeneratorsSettings.defaultExecutorProviderBuilder() + .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) + .build(); + clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } + } + Retry serviceRetry = clientProperties.getRetry(); + if (serviceRetry != null) { + RetrySettings createGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createGeneratorSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .createGeneratorSettings() + .setRetrySettings(createGeneratorRetrySettings); + + RetrySettings getGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGeneratorSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getGeneratorSettings().setRetrySettings(getGeneratorRetrySettings); + + RetrySettings listGeneratorsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGeneratorsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listGeneratorsSettings().setRetrySettings(listGeneratorsRetrySettings); + + RetrySettings deleteGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGeneratorSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .deleteGeneratorSettings() + .setRetrySettings(deleteGeneratorRetrySettings); + + RetrySettings updateGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateGeneratorSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .updateGeneratorSettings() + .setRetrySettings(updateGeneratorRetrySettings); + + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry createGeneratorRetry = clientProperties.getCreateGeneratorRetry(); + if (createGeneratorRetry != null) { + RetrySettings createGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createGeneratorSettings().getRetrySettings(), + createGeneratorRetry); + clientSettingsBuilder + .createGeneratorSettings() + .setRetrySettings(createGeneratorRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for createGenerator from properties."); + } + } + Retry getGeneratorRetry = clientProperties.getGetGeneratorRetry(); + if (getGeneratorRetry != null) { + RetrySettings getGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGeneratorSettings().getRetrySettings(), getGeneratorRetry); + clientSettingsBuilder.getGeneratorSettings().setRetrySettings(getGeneratorRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getGenerator from properties."); + } + } + Retry listGeneratorsRetry = clientProperties.getListGeneratorsRetry(); + if (listGeneratorsRetry != null) { + RetrySettings listGeneratorsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGeneratorsSettings().getRetrySettings(), + listGeneratorsRetry); + clientSettingsBuilder.listGeneratorsSettings().setRetrySettings(listGeneratorsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listGenerators from properties."); + } + } + Retry deleteGeneratorRetry = clientProperties.getDeleteGeneratorRetry(); + if (deleteGeneratorRetry != null) { + RetrySettings deleteGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGeneratorSettings().getRetrySettings(), + deleteGeneratorRetry); + clientSettingsBuilder + .deleteGeneratorSettings() + .setRetrySettings(deleteGeneratorRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for deleteGenerator from properties."); + } + } + Retry updateGeneratorRetry = clientProperties.getUpdateGeneratorRetry(); + if (updateGeneratorRetry != null) { + RetrySettings updateGeneratorRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateGeneratorSettings().getRetrySettings(), + updateGeneratorRetry); + clientSettingsBuilder + .updateGeneratorSettings() + .setRetrySettings(updateGeneratorRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for updateGenerator from properties."); + } + } + Retry listLocationsRetry = clientProperties.getListLocationsRetry(); + if (listLocationsRetry != null) { + RetrySettings listLocationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listLocationsSettings().getRetrySettings(), listLocationsRetry); + clientSettingsBuilder.listLocationsSettings().setRetrySettings(listLocationsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listLocations from properties."); + } + } + Retry getLocationRetry = clientProperties.getGetLocationRetry(); + if (getLocationRetry != null) { + RetrySettings getLocationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getLocationSettings().getRetrySettings(), getLocationRetry); + clientSettingsBuilder.getLocationSettings().setRetrySettings(getLocationRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getLocation from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a GeneratorsClient bean configured with GeneratorsSettings. + * + * @param generatorsSettings settings to configure an instance of client bean. + * @return a {@link GeneratorsClient} bean configured with {@link GeneratorsSettings} + */ + @Bean + @ConditionalOnMissingBean + public GeneratorsClient generatorsClient(GeneratorsSettings generatorsSettings) + throws IOException { + return GeneratorsClient.create(generatorsSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-generators"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringProperties.java new file mode 100644 index 0000000000..c547d9d680 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorsSpringProperties.java @@ -0,0 +1,175 @@ +/* + * Copyright 2024 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.dialogflow.v2.spring; + +import com.google.api.core.BetaApi; +import com.google.cloud.spring.core.Credentials; +import com.google.cloud.spring.core.CredentialsSupplier; +import com.google.cloud.spring.core.Retry; +import javax.annotation.Generated; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** Provides default property values for Generators client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.dialogflow.v2.generators") +public class GeneratorsSpringProperties implements CredentialsSupplier { + /** OAuth2 credentials to authenticate and authorize calls to Google Cloud Client Libraries. */ + @NestedConfigurationProperty + private final Credentials credentials = + new Credentials( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow"); + /** Quota project to use for billing. */ + private String quotaProjectId; + /** Number of threads used for executors. */ + private Integer executorThreadCount; + /** Allow override of default transport channel provider to use REST instead of gRPC. */ + private boolean useRest = false; + /** Allow override of retry settings at service level, applying to all of its RPC methods. */ + @NestedConfigurationProperty private Retry retry; + /** + * Allow override of retry settings at method-level for createGenerator. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry createGeneratorRetry; + /** + * Allow override of retry settings at method-level for getGenerator. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getGeneratorRetry; + /** + * Allow override of retry settings at method-level for listGenerators. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listGeneratorsRetry; + /** + * Allow override of retry settings at method-level for deleteGenerator. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry deleteGeneratorRetry; + /** + * Allow override of retry settings at method-level for updateGenerator. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry updateGeneratorRetry; + /** + * Allow override of retry settings at method-level for listLocations. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listLocationsRetry; + /** + * Allow override of retry settings at method-level for getLocation. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getLocationRetry; + + @Override + public Credentials getCredentials() { + return this.credentials; + } + + public String getQuotaProjectId() { + return this.quotaProjectId; + } + + public void setQuotaProjectId(String quotaProjectId) { + this.quotaProjectId = quotaProjectId; + } + + public boolean getUseRest() { + return this.useRest; + } + + public void setUseRest(boolean useRest) { + this.useRest = useRest; + } + + public Integer getExecutorThreadCount() { + return this.executorThreadCount; + } + + public void setExecutorThreadCount(Integer executorThreadCount) { + this.executorThreadCount = executorThreadCount; + } + + public Retry getRetry() { + return this.retry; + } + + public void setRetry(Retry retry) { + this.retry = retry; + } + + public Retry getCreateGeneratorRetry() { + return this.createGeneratorRetry; + } + + public void setCreateGeneratorRetry(Retry createGeneratorRetry) { + this.createGeneratorRetry = createGeneratorRetry; + } + + public Retry getGetGeneratorRetry() { + return this.getGeneratorRetry; + } + + public void setGetGeneratorRetry(Retry getGeneratorRetry) { + this.getGeneratorRetry = getGeneratorRetry; + } + + public Retry getListGeneratorsRetry() { + return this.listGeneratorsRetry; + } + + public void setListGeneratorsRetry(Retry listGeneratorsRetry) { + this.listGeneratorsRetry = listGeneratorsRetry; + } + + public Retry getDeleteGeneratorRetry() { + return this.deleteGeneratorRetry; + } + + public void setDeleteGeneratorRetry(Retry deleteGeneratorRetry) { + this.deleteGeneratorRetry = deleteGeneratorRetry; + } + + public Retry getUpdateGeneratorRetry() { + return this.updateGeneratorRetry; + } + + public void setUpdateGeneratorRetry(Retry updateGeneratorRetry) { + this.updateGeneratorRetry = updateGeneratorRetry; + } + + public Retry getListLocationsRetry() { + return this.listLocationsRetry; + } + + public void setListLocationsRetry(Retry listLocationsRetry) { + this.listLocationsRetry = listLocationsRetry; + } + + public Retry getGetLocationRetry() { + return this.getLocationRetry; + } + + public void setGetLocationRetry(Retry getLocationRetry) { + this.getLocationRetry = getLocationRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringAutoConfiguration.java index ead3a93279..9a2133ec45 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringAutoConfiguration.java @@ -212,6 +212,14 @@ public ParticipantsSettings participantsSettings( .suggestSmartRepliesSettings() .setRetrySettings(suggestSmartRepliesRetrySettings); + RetrySettings suggestKnowledgeAssistRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.suggestKnowledgeAssistSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .suggestKnowledgeAssistSettings() + .setRetrySettings(suggestKnowledgeAssistRetrySettings); + RetrySettings listLocationsRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); @@ -331,6 +339,20 @@ public ParticipantsSettings participantsSettings( "Configured method-level retry settings for suggestSmartReplies from properties."); } } + Retry suggestKnowledgeAssistRetry = clientProperties.getSuggestKnowledgeAssistRetry(); + if (suggestKnowledgeAssistRetry != null) { + RetrySettings suggestKnowledgeAssistRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.suggestKnowledgeAssistSettings().getRetrySettings(), + suggestKnowledgeAssistRetry); + clientSettingsBuilder + .suggestKnowledgeAssistSettings() + .setRetrySettings(suggestKnowledgeAssistRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for suggestKnowledgeAssist from properties."); + } + } Retry listLocationsRetry = clientProperties.getListLocationsRetry(); if (listLocationsRetry != null) { RetrySettings listLocationsRetrySettings = diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringProperties.java index 4045e1a6e4..8313567f3a 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringProperties.java +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ParticipantsSpringProperties.java @@ -84,6 +84,11 @@ public class ParticipantsSpringProperties implements CredentialsSupplier { * takes precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry suggestSmartRepliesRetry; + /** + * Allow override of retry settings at method-level for suggestKnowledgeAssist. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry suggestKnowledgeAssistRetry; /** * Allow override of retry settings at method-level for listLocations. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -196,6 +201,14 @@ public void setSuggestSmartRepliesRetry(Retry suggestSmartRepliesRetry) { this.suggestSmartRepliesRetry = suggestSmartRepliesRetry; } + public Retry getSuggestKnowledgeAssistRetry() { + return this.suggestKnowledgeAssistRetry; + } + + public void setSuggestKnowledgeAssistRetry(Retry suggestKnowledgeAssistRetry) { + this.suggestKnowledgeAssistRetry = suggestKnowledgeAssistRetry; + } + public Retry getListLocationsRetry() { return this.listLocationsRetry; } diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 9aaa381333..11290d4487 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -48,6 +48,12 @@ "description": "Auto-configure Google Cloud dialogflow/Documents components.", "defaultValue": true }, + { + "name": "com.google.cloud.dialogflow.v2.encryption-spec-service.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud dialogflow/EncryptionSpecService components.", + "defaultValue": true + }, { "name": "com.google.cloud.dialogflow.v2.entity-types.enabled", "type": "java.lang.Boolean", @@ -66,6 +72,12 @@ "description": "Auto-configure Google Cloud dialogflow/Fulfillments components.", "defaultValue": true }, + { + "name": "com.google.cloud.dialogflow.v2.generators.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud dialogflow/Generators components.", + "defaultValue": true + }, { "name": "com.google.cloud.dialogflow.v2.intents.enabled", "type": "java.lang.Boolean", diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index b010137332..84015b38e1 100644 --- a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -6,9 +6,11 @@ com.google.cloud.dialogflow.v2.spring.ConversationDatasetsSpringAutoConfiguratio com.google.cloud.dialogflow.v2.spring.ConversationModelsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.ConversationProfilesSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.DocumentsSpringAutoConfiguration +com.google.cloud.dialogflow.v2.spring.EncryptionSpecServiceSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.EntityTypesSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.EnvironmentsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.FulfillmentsSpringAutoConfiguration +com.google.cloud.dialogflow.v2.spring.GeneratorsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.IntentsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.KnowledgeBasesSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.ParticipantsSpringAutoConfiguration diff --git a/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringAutoConfiguration.java index 999379a07e..1696a0fd67 100644 --- a/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringAutoConfiguration.java @@ -204,6 +204,11 @@ public RecaptchaEnterpriseServiceSettings recaptchaEnterpriseServiceSettings( clientSettingsBuilder.migrateKeySettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.migrateKeySettings().setRetrySettings(migrateKeyRetrySettings); + RetrySettings addIpOverrideRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.addIpOverrideSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.addIpOverrideSettings().setRetrySettings(addIpOverrideRetrySettings); + RetrySettings getMetricsRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.getMetricsSettings().getRetrySettings(), serviceRetry); @@ -388,6 +393,16 @@ public RecaptchaEnterpriseServiceSettings recaptchaEnterpriseServiceSettings( LOGGER.trace("Configured method-level retry settings for migrateKey from properties."); } } + Retry addIpOverrideRetry = clientProperties.getAddIpOverrideRetry(); + if (addIpOverrideRetry != null) { + RetrySettings addIpOverrideRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.addIpOverrideSettings().getRetrySettings(), addIpOverrideRetry); + clientSettingsBuilder.addIpOverrideSettings().setRetrySettings(addIpOverrideRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for addIpOverride from properties."); + } + } Retry getMetricsRetry = clientProperties.getGetMetricsRetry(); if (getMetricsRetry != null) { RetrySettings getMetricsRetrySettings = diff --git a/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringProperties.java b/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringProperties.java index 9ef6225343..652fc8ae1b 100644 --- a/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringProperties.java +++ b/spring-cloud-previews/google-cloud-recaptchaenterprise-spring-starter/src/main/java/com/google/cloud/recaptchaenterprise/v1/spring/RecaptchaEnterpriseServiceSpringProperties.java @@ -85,6 +85,11 @@ public class RecaptchaEnterpriseServiceSpringProperties implements CredentialsSu * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry migrateKeyRetry; + /** + * Allow override of retry settings at method-level for addIpOverride. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry addIpOverrideRetry; /** * Allow override of retry settings at method-level for getMetrics. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -237,6 +242,14 @@ public void setMigrateKeyRetry(Retry migrateKeyRetry) { this.migrateKeyRetry = migrateKeyRetry; } + public Retry getAddIpOverrideRetry() { + return this.addIpOverrideRetry; + } + + public void setAddIpOverrideRetry(Retry addIpOverrideRetry) { + this.addIpOverrideRetry = addIpOverrideRetry; + } + public Retry getGetMetricsRetry() { return this.getMetricsRetry; } diff --git a/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringAutoConfiguration.java index c83e413c1b..6135e72715 100644 --- a/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringAutoConfiguration.java @@ -166,6 +166,11 @@ public TranslationServiceSettings translationServiceSettings( clientSettingsBuilder.translateTextSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.translateTextSettings().setRetrySettings(translateTextRetrySettings); + RetrySettings romanizeTextRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.romanizeTextSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.romanizeTextSettings().setRetrySettings(romanizeTextRetrySettings); + RetrySettings detectLanguageRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.detectLanguageSettings().getRetrySettings(), serviceRetry); @@ -196,6 +201,51 @@ public TranslationServiceSettings translationServiceSettings( clientSettingsBuilder.getGlossarySettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.getGlossarySettings().setRetrySettings(getGlossaryRetrySettings); + RetrySettings getGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGlossaryEntrySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .getGlossaryEntrySettings() + .setRetrySettings(getGlossaryEntryRetrySettings); + + RetrySettings listGlossaryEntriesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGlossaryEntriesSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .listGlossaryEntriesSettings() + .setRetrySettings(listGlossaryEntriesRetrySettings); + + RetrySettings createGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createGlossaryEntrySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .createGlossaryEntrySettings() + .setRetrySettings(createGlossaryEntryRetrySettings); + + RetrySettings updateGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateGlossaryEntrySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .updateGlossaryEntrySettings() + .setRetrySettings(updateGlossaryEntryRetrySettings); + + RetrySettings deleteGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGlossaryEntrySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .deleteGlossaryEntrySettings() + .setRetrySettings(deleteGlossaryEntryRetrySettings); + + RetrySettings getDatasetRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getDatasetSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getDatasetSettings().setRetrySettings(getDatasetRetrySettings); + + RetrySettings listDatasetsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listDatasetsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listDatasetsSettings().setRetrySettings(listDatasetsRetrySettings); + RetrySettings createAdaptiveMtDatasetRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.createAdaptiveMtDatasetSettings().getRetrySettings(), @@ -273,6 +323,21 @@ public TranslationServiceSettings translationServiceSettings( .listAdaptiveMtSentencesSettings() .setRetrySettings(listAdaptiveMtSentencesRetrySettings); + RetrySettings listExamplesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listExamplesSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listExamplesSettings().setRetrySettings(listExamplesRetrySettings); + + RetrySettings listModelsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listModelsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listModelsSettings().setRetrySettings(listModelsRetrySettings); + + RetrySettings getModelRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getModelSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getModelSettings().setRetrySettings(getModelRetrySettings); + if (LOGGER.isTraceEnabled()) { LOGGER.trace("Configured service-level retry settings from properties."); } @@ -287,6 +352,16 @@ public TranslationServiceSettings translationServiceSettings( LOGGER.trace("Configured method-level retry settings for translateText from properties."); } } + Retry romanizeTextRetry = clientProperties.getRomanizeTextRetry(); + if (romanizeTextRetry != null) { + RetrySettings romanizeTextRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.romanizeTextSettings().getRetrySettings(), romanizeTextRetry); + clientSettingsBuilder.romanizeTextSettings().setRetrySettings(romanizeTextRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for romanizeText from properties."); + } + } Retry detectLanguageRetry = clientProperties.getDetectLanguageRetry(); if (detectLanguageRetry != null) { RetrySettings detectLanguageRetrySettings = @@ -347,6 +422,96 @@ public TranslationServiceSettings translationServiceSettings( LOGGER.trace("Configured method-level retry settings for getGlossary from properties."); } } + Retry getGlossaryEntryRetry = clientProperties.getGetGlossaryEntryRetry(); + if (getGlossaryEntryRetry != null) { + RetrySettings getGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGlossaryEntrySettings().getRetrySettings(), + getGlossaryEntryRetry); + clientSettingsBuilder + .getGlossaryEntrySettings() + .setRetrySettings(getGlossaryEntryRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for getGlossaryEntry from properties."); + } + } + Retry listGlossaryEntriesRetry = clientProperties.getListGlossaryEntriesRetry(); + if (listGlossaryEntriesRetry != null) { + RetrySettings listGlossaryEntriesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGlossaryEntriesSettings().getRetrySettings(), + listGlossaryEntriesRetry); + clientSettingsBuilder + .listGlossaryEntriesSettings() + .setRetrySettings(listGlossaryEntriesRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for listGlossaryEntries from properties."); + } + } + Retry createGlossaryEntryRetry = clientProperties.getCreateGlossaryEntryRetry(); + if (createGlossaryEntryRetry != null) { + RetrySettings createGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createGlossaryEntrySettings().getRetrySettings(), + createGlossaryEntryRetry); + clientSettingsBuilder + .createGlossaryEntrySettings() + .setRetrySettings(createGlossaryEntryRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for createGlossaryEntry from properties."); + } + } + Retry updateGlossaryEntryRetry = clientProperties.getUpdateGlossaryEntryRetry(); + if (updateGlossaryEntryRetry != null) { + RetrySettings updateGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateGlossaryEntrySettings().getRetrySettings(), + updateGlossaryEntryRetry); + clientSettingsBuilder + .updateGlossaryEntrySettings() + .setRetrySettings(updateGlossaryEntryRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for updateGlossaryEntry from properties."); + } + } + Retry deleteGlossaryEntryRetry = clientProperties.getDeleteGlossaryEntryRetry(); + if (deleteGlossaryEntryRetry != null) { + RetrySettings deleteGlossaryEntryRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGlossaryEntrySettings().getRetrySettings(), + deleteGlossaryEntryRetry); + clientSettingsBuilder + .deleteGlossaryEntrySettings() + .setRetrySettings(deleteGlossaryEntryRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for deleteGlossaryEntry from properties."); + } + } + Retry getDatasetRetry = clientProperties.getGetDatasetRetry(); + if (getDatasetRetry != null) { + RetrySettings getDatasetRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getDatasetSettings().getRetrySettings(), getDatasetRetry); + clientSettingsBuilder.getDatasetSettings().setRetrySettings(getDatasetRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getDataset from properties."); + } + } + Retry listDatasetsRetry = clientProperties.getListDatasetsRetry(); + if (listDatasetsRetry != null) { + RetrySettings listDatasetsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listDatasetsSettings().getRetrySettings(), listDatasetsRetry); + clientSettingsBuilder.listDatasetsSettings().setRetrySettings(listDatasetsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listDatasets from properties."); + } + } Retry createAdaptiveMtDatasetRetry = clientProperties.getCreateAdaptiveMtDatasetRetry(); if (createAdaptiveMtDatasetRetry != null) { RetrySettings createAdaptiveMtDatasetRetrySettings = @@ -487,6 +652,36 @@ public TranslationServiceSettings translationServiceSettings( "Configured method-level retry settings for listAdaptiveMtSentences from properties."); } } + Retry listExamplesRetry = clientProperties.getListExamplesRetry(); + if (listExamplesRetry != null) { + RetrySettings listExamplesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listExamplesSettings().getRetrySettings(), listExamplesRetry); + clientSettingsBuilder.listExamplesSettings().setRetrySettings(listExamplesRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listExamples from properties."); + } + } + Retry listModelsRetry = clientProperties.getListModelsRetry(); + if (listModelsRetry != null) { + RetrySettings listModelsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listModelsSettings().getRetrySettings(), listModelsRetry); + clientSettingsBuilder.listModelsSettings().setRetrySettings(listModelsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listModels from properties."); + } + } + Retry getModelRetry = clientProperties.getGetModelRetry(); + if (getModelRetry != null) { + RetrySettings getModelRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getModelSettings().getRetrySettings(), getModelRetry); + clientSettingsBuilder.getModelSettings().setRetrySettings(getModelRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getModel from properties."); + } + } return clientSettingsBuilder.build(); } diff --git a/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringProperties.java b/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringProperties.java index ecb02d919c..5a25478d4f 100644 --- a/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringProperties.java +++ b/spring-cloud-previews/google-cloud-translate-spring-starter/src/main/java/com/google/cloud/translate/v3/spring/TranslationServiceSpringProperties.java @@ -49,6 +49,11 @@ public class TranslationServiceSpringProperties implements CredentialsSupplier { * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry translateTextRetry; + /** + * Allow override of retry settings at method-level for romanizeText. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry romanizeTextRetry; /** * Allow override of retry settings at method-level for detectLanguage. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -74,6 +79,41 @@ public class TranslationServiceSpringProperties implements CredentialsSupplier { * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry getGlossaryRetry; + /** + * Allow override of retry settings at method-level for getGlossaryEntry. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getGlossaryEntryRetry; + /** + * Allow override of retry settings at method-level for listGlossaryEntries. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listGlossaryEntriesRetry; + /** + * Allow override of retry settings at method-level for createGlossaryEntry. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry createGlossaryEntryRetry; + /** + * Allow override of retry settings at method-level for updateGlossaryEntry. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry updateGlossaryEntryRetry; + /** + * Allow override of retry settings at method-level for deleteGlossaryEntry. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry deleteGlossaryEntryRetry; + /** + * Allow override of retry settings at method-level for getDataset. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getDatasetRetry; + /** + * Allow override of retry settings at method-level for listDatasets. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listDatasetsRetry; /** * Allow override of retry settings at method-level for createAdaptiveMtDataset. If defined, this * takes precedence over service-level retry configurations for that RPC method. @@ -124,6 +164,21 @@ public class TranslationServiceSpringProperties implements CredentialsSupplier { * takes precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry listAdaptiveMtSentencesRetry; + /** + * Allow override of retry settings at method-level for listExamples. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listExamplesRetry; + /** + * Allow override of retry settings at method-level for listModels. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listModelsRetry; + /** + * Allow override of retry settings at method-level for getModel. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getModelRetry; @Override public Credentials getCredentials() { @@ -170,6 +225,14 @@ public void setTranslateTextRetry(Retry translateTextRetry) { this.translateTextRetry = translateTextRetry; } + public Retry getRomanizeTextRetry() { + return this.romanizeTextRetry; + } + + public void setRomanizeTextRetry(Retry romanizeTextRetry) { + this.romanizeTextRetry = romanizeTextRetry; + } + public Retry getDetectLanguageRetry() { return this.detectLanguageRetry; } @@ -210,6 +273,62 @@ public void setGetGlossaryRetry(Retry getGlossaryRetry) { this.getGlossaryRetry = getGlossaryRetry; } + public Retry getGetGlossaryEntryRetry() { + return this.getGlossaryEntryRetry; + } + + public void setGetGlossaryEntryRetry(Retry getGlossaryEntryRetry) { + this.getGlossaryEntryRetry = getGlossaryEntryRetry; + } + + public Retry getListGlossaryEntriesRetry() { + return this.listGlossaryEntriesRetry; + } + + public void setListGlossaryEntriesRetry(Retry listGlossaryEntriesRetry) { + this.listGlossaryEntriesRetry = listGlossaryEntriesRetry; + } + + public Retry getCreateGlossaryEntryRetry() { + return this.createGlossaryEntryRetry; + } + + public void setCreateGlossaryEntryRetry(Retry createGlossaryEntryRetry) { + this.createGlossaryEntryRetry = createGlossaryEntryRetry; + } + + public Retry getUpdateGlossaryEntryRetry() { + return this.updateGlossaryEntryRetry; + } + + public void setUpdateGlossaryEntryRetry(Retry updateGlossaryEntryRetry) { + this.updateGlossaryEntryRetry = updateGlossaryEntryRetry; + } + + public Retry getDeleteGlossaryEntryRetry() { + return this.deleteGlossaryEntryRetry; + } + + public void setDeleteGlossaryEntryRetry(Retry deleteGlossaryEntryRetry) { + this.deleteGlossaryEntryRetry = deleteGlossaryEntryRetry; + } + + public Retry getGetDatasetRetry() { + return this.getDatasetRetry; + } + + public void setGetDatasetRetry(Retry getDatasetRetry) { + this.getDatasetRetry = getDatasetRetry; + } + + public Retry getListDatasetsRetry() { + return this.listDatasetsRetry; + } + + public void setListDatasetsRetry(Retry listDatasetsRetry) { + this.listDatasetsRetry = listDatasetsRetry; + } + public Retry getCreateAdaptiveMtDatasetRetry() { return this.createAdaptiveMtDatasetRetry; } @@ -289,4 +408,28 @@ public Retry getListAdaptiveMtSentencesRetry() { public void setListAdaptiveMtSentencesRetry(Retry listAdaptiveMtSentencesRetry) { this.listAdaptiveMtSentencesRetry = listAdaptiveMtSentencesRetry; } + + public Retry getListExamplesRetry() { + return this.listExamplesRetry; + } + + public void setListExamplesRetry(Retry listExamplesRetry) { + this.listExamplesRetry = listExamplesRetry; + } + + public Retry getListModelsRetry() { + return this.listModelsRetry; + } + + public void setListModelsRetry(Retry listModelsRetry) { + this.listModelsRetry = listModelsRetry; + } + + public Retry getGetModelRetry() { + return this.getModelRetry; + } + + public void setGetModelRetry(Retry getModelRetry) { + this.getModelRetry = getModelRetry; + } }