diff --git a/spring-cloud-gcp-dependencies/pom.xml b/spring-cloud-gcp-dependencies/pom.xml index b44965d7e4c..239f6e08136 100644 --- a/spring-cloud-gcp-dependencies/pom.xml +++ b/spring-cloud-gcp-dependencies/pom.xml @@ -34,7 +34,7 @@ - 26.71.0 + 26.73.0 1.25.0 1.0.7.RELEASE 1.3.0 diff --git a/spring-cloud-previews/README.md b/spring-cloud-previews/README.md index 5b75fb35e15..d5343af90d4 100644 --- a/spring-cloud-previews/README.md +++ b/spring-cloud-previews/README.md @@ -16,111 +16,111 @@ add the following dependency to your `pom.xml`: | Client Library | Starter Maven Artifact | |----------------| -----------------------| -|[java/accessapproval](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/accessapproval/README.md)|com.google.cloud:google-cloud-accessapproval-spring-starter| -|[java/accesscontextmanager](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/accesscontextmanager/README.md)|com.google.cloud:google-identity-accesscontextmanager-spring-starter| -|[java/advisorynotifications](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/advisorynotifications/README.md)|com.google.cloud:google-cloud-advisorynotifications-spring-starter| -|[java/aiplatform](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/aiplatform/README.md)|com.google.cloud:google-cloud-aiplatform-spring-starter| -|[java/analyticshub](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.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.72.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.72.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.72.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.72.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.72.0/java/automl/README.md)|com.google.cloud:google-cloud-automl-spring-starter| -|[java/backupdr](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/backupdr/README.md)|com.google.cloud:google-cloud-backupdr-spring-starter| -|[java/bigqueryconnection](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/bigqueryconnection/README.md)|com.google.cloud:google-cloud-bigqueryconnection-spring-starter| -|[java/bigquerydatatransfer](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/bigquerydatatransfer/README.md)|com.google.cloud:google-cloud-bigquerydatatransfer-spring-starter| -|[java/bigqueryreservation](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/bigqueryreservation/README.md)|com.google.cloud:google-cloud-bigqueryreservation-spring-starter| -|[java/billing](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/billing/README.md)|com.google.cloud:google-cloud-billing-spring-starter| -|[java/billingbudgets](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/channel/README.md)|com.google.cloud:google-cloud-channel-spring-starter| -|[java/cloudbuild](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/cloudbuild/README.md)|com.google.cloud:google-cloud-build-spring-starter| -|[java/cloudcontrolspartner](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/cloudcontrolspartner/README.md)|com.google.cloud:google-cloud-cloudcontrolspartner-spring-starter| -|[java/cloudquotas](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/cloudquotas/README.md)|com.google.cloud:google-cloud-cloudquotas-spring-starter| -|[java/compute](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/container/README.md)|com.google.cloud:google-cloud-container-spring-starter| -|[java/containeranalysis](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/datacatalog/README.md)|com.google.cloud:google-cloud-datacatalog-spring-starter| -|[java/datalineage](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/datalineage/README.md)|com.google.cloud:google-cloud-datalineage-spring-starter| -|[java/dataplex](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/dataproc/README.md)|com.google.cloud:google-cloud-dataproc-spring-starter| -|[java/datastream](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/datastream/README.md)|com.google.cloud:google-cloud-datastream-spring-starter| -|[java/deploy](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/deploy/README.md)|com.google.cloud:google-cloud-deploy-spring-starter| -|[java/dialogflow](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/dialogflow/README.md)|com.google.cloud:google-cloud-dialogflow-spring-starter| -|[java/discoveryengine](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/discoveryengine/README.md)|com.google.cloud:google-cloud-discoveryengine-spring-starter| -|[java/distributedcloudedge](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/distributedcloudedge/README.md)|com.google.cloud:google-cloud-distributedcloudedge-spring-starter| -|[java/dlp](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/dlp/README.md)|com.google.cloud:google-cloud-dlp-spring-starter| -|[java/dms](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/domains/README.md)|com.google.cloud:google-cloud-domains-spring-starter| -|[java/edgenetwork](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/eventarc/README.md)|com.google.cloud:google-cloud-eventarc-spring-starter| -|[java/filestore](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/filestore/README.md)|com.google.cloud:google-cloud-filestore-spring-starter| -|[java/functions](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/functions/README.md)|com.google.cloud:google-cloud-functions-spring-starter| -|[java/gkehub](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.0/java/iam/README.md)|com.google.cloud:google-iam-policy-spring-starter| -|[java/iamcredentials](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/iamcredentials/README.md)|com.google.cloud:google-cloud-iamcredentials-spring-starter| -|[java/iap](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/iap/README.md)|com.google.cloud:google-cloud-iap-spring-starter| -|[java/ids](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/iot/README.md)|com.google.cloud:google-cloud-iot-spring-starter| -|[java/language](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.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.72.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.72.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.72.0/java/networkconnectivity/README.md)|com.google.cloud:google-cloud-networkconnectivity-spring-starter| -|[java/notebooks](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/notebooks/README.md)|com.google.cloud:google-cloud-notebooks-spring-starter| -|[java/optimization](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.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.72.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.72.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.72.0/java/profiler/README.md)|com.google.cloud:google-cloud-profiler-spring-starter| -|[java/publicca](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/publicca/README.md)|com.google.cloud:google-cloud-publicca-spring-starter| -|[java/recaptchaenterprise](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/recaptchaenterprise/README.md)|com.google.cloud:google-cloud-recaptchaenterprise-spring-starter| -|[java/recommender](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/recommender/README.md)|com.google.cloud:google-cloud-recommender-spring-starter| -|[java/redis](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/redis/README.md)|com.google.cloud:google-cloud-redis-spring-starter| -|[java/retail](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/retail/README.md)|com.google.cloud:google-cloud-retail-spring-starter| -|[java/scheduler](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/scheduler/README.md)|com.google.cloud:google-cloud-scheduler-spring-starter| -|[java/securesourcemanager](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/securitycenter/README.md)|com.google.cloud:google-cloud-securitycenter-spring-starter| -|[java/securitycentermanagement](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/securitycentermanagement/README.md)|com.google.cloud:google-cloud-securitycentermanagement-spring-starter| -|[java/securityposture](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.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.72.0/java/servicedirectory/README.md)|com.google.cloud:google-cloud-servicedirectory-spring-starter| -|[java/shell](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/shell/README.md)|com.google.cloud:google-cloud-shell-spring-starter| -|[java/speech](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/talent/README.md)|com.google.cloud:google-cloud-talent-spring-starter| -|[java/tasks](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/tasks/README.md)|com.google.cloud:google-cloud-tasks-spring-starter| -|[java/telcoautomation](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/telcoautomation/README.md)|com.google.cloud:google-cloud-telcoautomation-spring-starter| -|[java/texttospeech](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/texttospeech/README.md)|com.google.cloud:google-cloud-texttospeech-spring-starter| -|[java/tpu](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/tpu/README.md)|com.google.cloud:google-cloud-tpu-spring-starter| -|[java/trace](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/trace/README.md)|com.google.cloud:google-cloud-trace-spring-starter| -|[java/translate](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/translate/README.md)|com.google.cloud:google-cloud-translate-spring-starter| -|[java/valkey](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/valkey/README.md)|com.google.cloud:google-cloud-valkey-spring-starter| -|[java/video-intelligence](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.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.72.0/java/vmmigration/README.md)|com.google.cloud:google-cloud-vmmigration-spring-starter| -|[java/vpcaccess](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/vpcaccess/README.md)|com.google.cloud:google-cloud-vpcaccess-spring-starter| -|[java/webrisk](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/webrisk/README.md)|com.google.cloud:google-cloud-webrisk-spring-starter| -|[java/websecurityscanner](https://github.com/googleapis/google-cloud-java/blob/v1.72.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.72.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.72.0/java/workflows/README.md)|com.google.cloud:google-cloud-workflows-spring-starter| -|[java/workstations](https://github.com/googleapis/google-cloud-java/blob/v1.72.0/java/workstations/README.md)|com.google.cloud:google-cloud-workstations-spring-starter| +|[java/accessapproval](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/accessapproval/README.md)|com.google.cloud:google-cloud-accessapproval-spring-starter| +|[java/accesscontextmanager](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/accesscontextmanager/README.md)|com.google.cloud:google-identity-accesscontextmanager-spring-starter| +|[java/advisorynotifications](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/advisorynotifications/README.md)|com.google.cloud:google-cloud-advisorynotifications-spring-starter| +|[java/aiplatform](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/aiplatform/README.md)|com.google.cloud:google-cloud-aiplatform-spring-starter| +|[java/analyticshub](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.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.75.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.75.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.75.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.75.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.75.0/java/automl/README.md)|com.google.cloud:google-cloud-automl-spring-starter| +|[java/backupdr](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/backupdr/README.md)|com.google.cloud:google-cloud-backupdr-spring-starter| +|[java/bigqueryconnection](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/bigqueryconnection/README.md)|com.google.cloud:google-cloud-bigqueryconnection-spring-starter| +|[java/bigquerydatatransfer](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/bigquerydatatransfer/README.md)|com.google.cloud:google-cloud-bigquerydatatransfer-spring-starter| +|[java/bigqueryreservation](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/bigqueryreservation/README.md)|com.google.cloud:google-cloud-bigqueryreservation-spring-starter| +|[java/billing](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/billing/README.md)|com.google.cloud:google-cloud-billing-spring-starter| +|[java/billingbudgets](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/channel/README.md)|com.google.cloud:google-cloud-channel-spring-starter| +|[java/cloudbuild](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/cloudbuild/README.md)|com.google.cloud:google-cloud-build-spring-starter| +|[java/cloudcontrolspartner](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/cloudcontrolspartner/README.md)|com.google.cloud:google-cloud-cloudcontrolspartner-spring-starter| +|[java/cloudquotas](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/cloudquotas/README.md)|com.google.cloud:google-cloud-cloudquotas-spring-starter| +|[java/compute](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/container/README.md)|com.google.cloud:google-cloud-container-spring-starter| +|[java/containeranalysis](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/datacatalog/README.md)|com.google.cloud:google-cloud-datacatalog-spring-starter| +|[java/datalineage](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/datalineage/README.md)|com.google.cloud:google-cloud-datalineage-spring-starter| +|[java/dataplex](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/dataproc/README.md)|com.google.cloud:google-cloud-dataproc-spring-starter| +|[java/datastream](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/datastream/README.md)|com.google.cloud:google-cloud-datastream-spring-starter| +|[java/deploy](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/deploy/README.md)|com.google.cloud:google-cloud-deploy-spring-starter| +|[java/dialogflow](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/dialogflow/README.md)|com.google.cloud:google-cloud-dialogflow-spring-starter| +|[java/discoveryengine](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/discoveryengine/README.md)|com.google.cloud:google-cloud-discoveryengine-spring-starter| +|[java/distributedcloudedge](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/distributedcloudedge/README.md)|com.google.cloud:google-cloud-distributedcloudedge-spring-starter| +|[java/dlp](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/dlp/README.md)|com.google.cloud:google-cloud-dlp-spring-starter| +|[java/dms](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/domains/README.md)|com.google.cloud:google-cloud-domains-spring-starter| +|[java/edgenetwork](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/eventarc/README.md)|com.google.cloud:google-cloud-eventarc-spring-starter| +|[java/filestore](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/filestore/README.md)|com.google.cloud:google-cloud-filestore-spring-starter| +|[java/functions](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/functions/README.md)|com.google.cloud:google-cloud-functions-spring-starter| +|[java/gkehub](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.0/java/iam/README.md)|com.google.cloud:google-iam-policy-spring-starter| +|[java/iamcredentials](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/iamcredentials/README.md)|com.google.cloud:google-cloud-iamcredentials-spring-starter| +|[java/iap](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/iap/README.md)|com.google.cloud:google-cloud-iap-spring-starter| +|[java/ids](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/iot/README.md)|com.google.cloud:google-cloud-iot-spring-starter| +|[java/language](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.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.75.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.75.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.75.0/java/networkconnectivity/README.md)|com.google.cloud:google-cloud-networkconnectivity-spring-starter| +|[java/notebooks](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/notebooks/README.md)|com.google.cloud:google-cloud-notebooks-spring-starter| +|[java/optimization](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.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.75.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.75.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.75.0/java/profiler/README.md)|com.google.cloud:google-cloud-profiler-spring-starter| +|[java/publicca](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/publicca/README.md)|com.google.cloud:google-cloud-publicca-spring-starter| +|[java/recaptchaenterprise](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/recaptchaenterprise/README.md)|com.google.cloud:google-cloud-recaptchaenterprise-spring-starter| +|[java/recommender](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/recommender/README.md)|com.google.cloud:google-cloud-recommender-spring-starter| +|[java/redis](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/redis/README.md)|com.google.cloud:google-cloud-redis-spring-starter| +|[java/retail](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/retail/README.md)|com.google.cloud:google-cloud-retail-spring-starter| +|[java/scheduler](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/scheduler/README.md)|com.google.cloud:google-cloud-scheduler-spring-starter| +|[java/securesourcemanager](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/securitycenter/README.md)|com.google.cloud:google-cloud-securitycenter-spring-starter| +|[java/securitycentermanagement](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/securitycentermanagement/README.md)|com.google.cloud:google-cloud-securitycentermanagement-spring-starter| +|[java/securityposture](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.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.75.0/java/servicedirectory/README.md)|com.google.cloud:google-cloud-servicedirectory-spring-starter| +|[java/shell](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/shell/README.md)|com.google.cloud:google-cloud-shell-spring-starter| +|[java/speech](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/talent/README.md)|com.google.cloud:google-cloud-talent-spring-starter| +|[java/tasks](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/tasks/README.md)|com.google.cloud:google-cloud-tasks-spring-starter| +|[java/telcoautomation](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/telcoautomation/README.md)|com.google.cloud:google-cloud-telcoautomation-spring-starter| +|[java/texttospeech](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/texttospeech/README.md)|com.google.cloud:google-cloud-texttospeech-spring-starter| +|[java/tpu](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/tpu/README.md)|com.google.cloud:google-cloud-tpu-spring-starter| +|[java/trace](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/trace/README.md)|com.google.cloud:google-cloud-trace-spring-starter| +|[java/translate](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/translate/README.md)|com.google.cloud:google-cloud-translate-spring-starter| +|[java/valkey](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/valkey/README.md)|com.google.cloud:google-cloud-valkey-spring-starter| +|[java/video-intelligence](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.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.75.0/java/vmmigration/README.md)|com.google.cloud:google-cloud-vmmigration-spring-starter| +|[java/vpcaccess](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/vpcaccess/README.md)|com.google.cloud:google-cloud-vpcaccess-spring-starter| +|[java/webrisk](https://github.com/googleapis/google-cloud-java/blob/v1.75.0/java/webrisk/README.md)|com.google.cloud:google-cloud-webrisk-spring-starter| +|[java/websecurityscanner](https://github.com/googleapis/google-cloud-java/blob/v1.75.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.75.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.75.0/java/workflows/README.md)|com.google.cloud:google-cloud-workflows-spring-starter| +|[java/workstations](https://github.com/googleapis/google-cloud-java/blob/v1.75.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/PredictionServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringAutoConfiguration.java index 3a4710a0e59..bc2f481777d 100644 --- a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringAutoConfiguration.java @@ -185,6 +185,11 @@ public PredictionServiceSettings predictionServiceSettings( .generateContentSettings() .setRetrySettings(generateContentRetrySettings); + RetrySettings embedContentRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.embedContentSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.embedContentSettings().setRetrySettings(embedContentRetrySettings); + RetrySettings listLocationsRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); @@ -283,6 +288,16 @@ public PredictionServiceSettings predictionServiceSettings( LOGGER.trace("Configured method-level retry settings for generateContent from properties."); } } + Retry embedContentRetry = clientProperties.getEmbedContentRetry(); + if (embedContentRetry != null) { + RetrySettings embedContentRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.embedContentSettings().getRetrySettings(), embedContentRetry); + clientSettingsBuilder.embedContentSettings().setRetrySettings(embedContentRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for embedContent from properties."); + } + } Retry listLocationsRetry = clientProperties.getListLocationsRetry(); if (listLocationsRetry != null) { RetrySettings listLocationsRetrySettings = diff --git a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringProperties.java b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringProperties.java index 5bad8a1fe85..53f3f57ff33 100644 --- a/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringProperties.java +++ b/spring-cloud-previews/google-cloud-aiplatform-spring-starter/src/main/java/com/google/cloud/aiplatform/v1/spring/PredictionServiceSpringProperties.java @@ -72,6 +72,11 @@ public class PredictionServiceSpringProperties implements CredentialsSupplier { * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry generateContentRetry; + /** + * Allow override of retry settings at method-level for embedContent. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry embedContentRetry; /** * Allow override of retry settings at method-level for listLocations. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -175,6 +180,14 @@ public void setGenerateContentRetry(Retry generateContentRetry) { this.generateContentRetry = generateContentRetry; } + public Retry getEmbedContentRetry() { + return this.embedContentRetry; + } + + public void setEmbedContentRetry(Retry embedContentRetry) { + this.embedContentRetry = embedContentRetry; + } + public Retry getListLocationsRetry() { return this.listLocationsRetry; } diff --git a/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringAutoConfiguration.java index 8886b4ac28f..5859909c827 100644 --- a/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringAutoConfiguration.java @@ -209,6 +209,14 @@ public BackupDRSettings backupDRSettings( clientSettingsBuilder.listBackupsSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.listBackupsSettings().setRetrySettings(listBackupsRetrySettings); + RetrySettings fetchBackupsForResourceTypeRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.fetchBackupsForResourceTypeSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .fetchBackupsForResourceTypeSettings() + .setRetrySettings(fetchBackupsForResourceTypeRetrySettings); + RetrySettings getBackupRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.getBackupSettings().getRetrySettings(), serviceRetry); @@ -276,6 +284,14 @@ public BackupDRSettings backupDRSettings( .getDataSourceReferenceSettings() .setRetrySettings(getDataSourceReferenceRetrySettings); + RetrySettings listDataSourceReferencesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listDataSourceReferencesSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .listDataSourceReferencesSettings() + .setRetrySettings(listDataSourceReferencesRetrySettings); + RetrySettings fetchDataSourceReferencesForResourceTypeRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder @@ -417,6 +433,20 @@ public BackupDRSettings backupDRSettings( LOGGER.trace("Configured method-level retry settings for listBackups from properties."); } } + Retry fetchBackupsForResourceTypeRetry = clientProperties.getFetchBackupsForResourceTypeRetry(); + if (fetchBackupsForResourceTypeRetry != null) { + RetrySettings fetchBackupsForResourceTypeRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.fetchBackupsForResourceTypeSettings().getRetrySettings(), + fetchBackupsForResourceTypeRetry); + clientSettingsBuilder + .fetchBackupsForResourceTypeSettings() + .setRetrySettings(fetchBackupsForResourceTypeRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for fetchBackupsForResourceType from properties."); + } + } Retry getBackupRetry = clientProperties.getGetBackupRetry(); if (getBackupRetry != null) { RetrySettings getBackupRetrySettings = @@ -537,6 +567,20 @@ public BackupDRSettings backupDRSettings( "Configured method-level retry settings for getDataSourceReference from properties."); } } + Retry listDataSourceReferencesRetry = clientProperties.getListDataSourceReferencesRetry(); + if (listDataSourceReferencesRetry != null) { + RetrySettings listDataSourceReferencesRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listDataSourceReferencesSettings().getRetrySettings(), + listDataSourceReferencesRetry); + clientSettingsBuilder + .listDataSourceReferencesSettings() + .setRetrySettings(listDataSourceReferencesRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for listDataSourceReferences from properties."); + } + } Retry fetchDataSourceReferencesForResourceTypeRetry = clientProperties.getFetchDataSourceReferencesForResourceTypeRetry(); if (fetchDataSourceReferencesForResourceTypeRetry != null) { diff --git a/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringProperties.java b/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringProperties.java index 4c02761a173..1366e00fb6e 100644 --- a/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringProperties.java +++ b/spring-cloud-previews/google-cloud-backupdr-spring-starter/src/main/java/com/google/cloud/backupdr/v1/spring/BackupDRSpringProperties.java @@ -82,6 +82,11 @@ public class BackupDRSpringProperties implements CredentialsSupplier { * precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry listBackupsRetry; + /** + * Allow override of retry settings at method-level for fetchBackupsForResourceType. If defined, + * this takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry fetchBackupsForResourceTypeRetry; /** * Allow override of retry settings at method-level for getBackup. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -128,6 +133,11 @@ public class BackupDRSpringProperties implements CredentialsSupplier { * takes precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry getDataSourceReferenceRetry; + /** + * Allow override of retry settings at method-level for listDataSourceReferences. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listDataSourceReferencesRetry; /** * Allow override of retry settings at method-level for fetchDataSourceReferencesForResourceType. * If defined, this takes precedence over service-level retry configurations for that RPC method. @@ -260,6 +270,14 @@ public void setListBackupsRetry(Retry listBackupsRetry) { this.listBackupsRetry = listBackupsRetry; } + public Retry getFetchBackupsForResourceTypeRetry() { + return this.fetchBackupsForResourceTypeRetry; + } + + public void setFetchBackupsForResourceTypeRetry(Retry fetchBackupsForResourceTypeRetry) { + this.fetchBackupsForResourceTypeRetry = fetchBackupsForResourceTypeRetry; + } + public Retry getGetBackupRetry() { return this.getBackupRetry; } @@ -334,6 +352,14 @@ public void setGetDataSourceReferenceRetry(Retry getDataSourceReferenceRetry) { this.getDataSourceReferenceRetry = getDataSourceReferenceRetry; } + public Retry getListDataSourceReferencesRetry() { + return this.listDataSourceReferencesRetry; + } + + public void setListDataSourceReferencesRetry(Retry listDataSourceReferencesRetry) { + this.listDataSourceReferencesRetry = listDataSourceReferencesRetry; + } + public Retry getFetchDataSourceReferencesForResourceTypeRetry() { return this.fetchDataSourceReferencesForResourceTypeRetry; } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringAutoConfiguration.java new file mode 100644 index 00000000000..c74194f8d32 --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringAutoConfiguration.java @@ -0,0 +1,186 @@ +/* + * Copyright 2025 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.compute.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.compute.v1.AdviceClient; +import com.google.cloud.compute.v1.AdviceSettings; +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 AdviceClient}. + * + *

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(AdviceClient.class) +@ConditionalOnProperty(value = "com.google.cloud.compute.v1.advice.enabled", matchIfMissing = true) +@EnableConfigurationProperties(AdviceSpringProperties.class) +public class AdviceSpringAutoConfiguration { + private final AdviceSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = LogFactory.getLog(AdviceSpringAutoConfiguration.class); + + protected AdviceSpringAutoConfiguration( + AdviceSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Advice-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 = "defaultAdviceTransportChannelProvider") + public TransportChannelProvider defaultAdviceTransportChannelProvider() { + return AdviceSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a AdviceSettings bean configured to use a DefaultCredentialsProvider and the client + * library's default transport channel provider (defaultAdviceTransportChannelProvider()). 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 AdviceSpringProperties. 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 AdviceSettings} bean configured with {@link TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public AdviceSettings adviceSettings( + @Qualifier("defaultAdviceTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + AdviceSettings.Builder clientSettingsBuilder = AdviceSettings.newBuilder(); + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(AdviceSettings.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 = + AdviceSettings.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 calendarModeRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.calendarModeSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.calendarModeSettings().setRetrySettings(calendarModeRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry calendarModeRetry = clientProperties.getCalendarModeRetry(); + if (calendarModeRetry != null) { + RetrySettings calendarModeRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.calendarModeSettings().getRetrySettings(), calendarModeRetry); + clientSettingsBuilder.calendarModeSettings().setRetrySettings(calendarModeRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for calendarMode from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a AdviceClient bean configured with AdviceSettings. + * + * @param adviceSettings settings to configure an instance of client bean. + * @return a {@link AdviceClient} bean configured with {@link AdviceSettings} + */ + @Bean + @ConditionalOnMissingBean + public AdviceClient adviceClient(AdviceSettings adviceSettings) throws IOException { + return AdviceClient.create(adviceSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-advice"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringProperties.java new file mode 100644 index 00000000000..5aa013b879a --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/AdviceSpringProperties.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 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.compute.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 Advice client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.compute.v1.advice") +public class AdviceSpringProperties 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/compute", + "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 calendarMode. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry calendarModeRetry; + + @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 getCalendarModeRetry() { + return this.calendarModeRetry; + } + + public void setCalendarModeRetry(Retry calendarModeRetry) { + this.calendarModeRetry = calendarModeRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringAutoConfiguration.java new file mode 100644 index 00000000000..fcc07d23cca --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringAutoConfiguration.java @@ -0,0 +1,210 @@ +/* + * Copyright 2025 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.compute.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.compute.v1.CrossSiteNetworksClient; +import com.google.cloud.compute.v1.CrossSiteNetworksSettings; +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 CrossSiteNetworksClient}. + * + *

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(CrossSiteNetworksClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.compute.v1.cross-site-networks.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(CrossSiteNetworksSpringProperties.class) +public class CrossSiteNetworksSpringAutoConfiguration { + private final CrossSiteNetworksSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(CrossSiteNetworksSpringAutoConfiguration.class); + + protected CrossSiteNetworksSpringAutoConfiguration( + CrossSiteNetworksSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from CrossSiteNetworks-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 = "defaultCrossSiteNetworksTransportChannelProvider") + public TransportChannelProvider defaultCrossSiteNetworksTransportChannelProvider() { + return CrossSiteNetworksSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a CrossSiteNetworksSettings bean configured to use a DefaultCredentialsProvider and + * the client library's default transport channel provider + * (defaultCrossSiteNetworksTransportChannelProvider()). 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 CrossSiteNetworksSpringProperties. 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 CrossSiteNetworksSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public CrossSiteNetworksSettings crossSiteNetworksSettings( + @Qualifier("defaultCrossSiteNetworksTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + CrossSiteNetworksSettings.Builder clientSettingsBuilder = + CrossSiteNetworksSettings.newBuilder(); + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(CrossSiteNetworksSettings.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 = + CrossSiteNetworksSettings.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 getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry getRetry = clientProperties.getGetRetry(); + if (getRetry != null) { + RetrySettings getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), getRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for get from properties."); + } + } + Retry listRetry = clientProperties.getListRetry(); + if (listRetry != null) { + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), listRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for list from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a CrossSiteNetworksClient bean configured with CrossSiteNetworksSettings. + * + * @param crossSiteNetworksSettings settings to configure an instance of client bean. + * @return a {@link CrossSiteNetworksClient} bean configured with {@link + * CrossSiteNetworksSettings} + */ + @Bean + @ConditionalOnMissingBean + public CrossSiteNetworksClient crossSiteNetworksClient( + CrossSiteNetworksSettings crossSiteNetworksSettings) throws IOException { + return CrossSiteNetworksClient.create(crossSiteNetworksSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-cross-site-networks"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringProperties.java new file mode 100644 index 00000000000..ae764f4662f --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/CrossSiteNetworksSpringProperties.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 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.compute.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 CrossSiteNetworks client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.compute.v1.cross-site-networks") +public class CrossSiteNetworksSpringProperties 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/compute", + "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 get. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getRetry; + /** + * Allow override of retry settings at method-level for list. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listRetry; + + @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 getGetRetry() { + return this.getRetry; + } + + public void setGetRetry(Retry getRetry) { + this.getRetry = getRetry; + } + + public Retry getListRetry() { + return this.listRetry; + } + + public void setListRetry(Retry listRetry) { + this.listRetry = listRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringAutoConfiguration.java index aebaa61ce68..009ad577f8c 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringAutoConfiguration.java @@ -156,6 +156,13 @@ public FirewallsSettings firewallsSettings( clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + RetrySettings testIamPermissionsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.testIamPermissionsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .testIamPermissionsSettings() + .setRetrySettings(testIamPermissionsRetrySettings); + if (LOGGER.isTraceEnabled()) { LOGGER.trace("Configured service-level retry settings from properties."); } @@ -180,6 +187,20 @@ public FirewallsSettings firewallsSettings( LOGGER.trace("Configured method-level retry settings for list 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(); } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringProperties.java index 85211aa1778..d22eb483b73 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringProperties.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FirewallsSpringProperties.java @@ -52,6 +52,11 @@ public class FirewallsSpringProperties implements CredentialsSupplier { * over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry listRetry; + /** + * 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() { @@ -97,4 +102,12 @@ public Retry getListRetry() { public void setListRetry(Retry listRetry) { this.listRetry = listRetry; } + + public Retry getTestIamPermissionsRetry() { + return this.testIamPermissionsRetry; + } + + public void setTestIamPermissionsRetry(Retry testIamPermissionsRetry) { + this.testIamPermissionsRetry = testIamPermissionsRetry; + } } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringAutoConfiguration.java new file mode 100644 index 00000000000..856072b390f --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringAutoConfiguration.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 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.compute.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.compute.v1.FutureReservationsClient; +import com.google.cloud.compute.v1.FutureReservationsSettings; +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 FutureReservationsClient}. + * + *

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(FutureReservationsClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.compute.v1.future-reservations.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(FutureReservationsSpringProperties.class) +public class FutureReservationsSpringAutoConfiguration { + private final FutureReservationsSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(FutureReservationsSpringAutoConfiguration.class); + + protected FutureReservationsSpringAutoConfiguration( + FutureReservationsSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from FutureReservations-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 = "defaultFutureReservationsTransportChannelProvider") + public TransportChannelProvider defaultFutureReservationsTransportChannelProvider() { + return FutureReservationsSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a FutureReservationsSettings bean configured to use a DefaultCredentialsProvider and + * the client library's default transport channel provider + * (defaultFutureReservationsTransportChannelProvider()). 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 FutureReservationsSpringProperties. 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 FutureReservationsSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public FutureReservationsSettings futureReservationsSettings( + @Qualifier("defaultFutureReservationsTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + FutureReservationsSettings.Builder clientSettingsBuilder = + FutureReservationsSettings.newBuilder(); + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(FutureReservationsSettings.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 = + FutureReservationsSettings.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 aggregatedListRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.aggregatedListSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.aggregatedListSettings().setRetrySettings(aggregatedListRetrySettings); + + RetrySettings getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry aggregatedListRetry = clientProperties.getAggregatedListRetry(); + if (aggregatedListRetry != null) { + RetrySettings aggregatedListRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.aggregatedListSettings().getRetrySettings(), + aggregatedListRetry); + clientSettingsBuilder.aggregatedListSettings().setRetrySettings(aggregatedListRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for aggregatedList from properties."); + } + } + Retry getRetry = clientProperties.getGetRetry(); + if (getRetry != null) { + RetrySettings getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), getRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for get from properties."); + } + } + Retry listRetry = clientProperties.getListRetry(); + if (listRetry != null) { + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), listRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for list from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a FutureReservationsClient bean configured with FutureReservationsSettings. + * + * @param futureReservationsSettings settings to configure an instance of client bean. + * @return a {@link FutureReservationsClient} bean configured with {@link + * FutureReservationsSettings} + */ + @Bean + @ConditionalOnMissingBean + public FutureReservationsClient futureReservationsClient( + FutureReservationsSettings futureReservationsSettings) throws IOException { + return FutureReservationsClient.create(futureReservationsSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-future-reservations"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringProperties.java new file mode 100644 index 00000000000..af1c391c147 --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/FutureReservationsSpringProperties.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 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.compute.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 FutureReservations client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.compute.v1.future-reservations") +public class FutureReservationsSpringProperties 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/compute", + "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 aggregatedList. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry aggregatedListRetry; + /** + * Allow override of retry settings at method-level for get. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getRetry; + /** + * Allow override of retry settings at method-level for list. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listRetry; + + @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 getAggregatedListRetry() { + return this.aggregatedListRetry; + } + + public void setAggregatedListRetry(Retry aggregatedListRetry) { + this.aggregatedListRetry = aggregatedListRetry; + } + + public Retry getGetRetry() { + return this.getRetry; + } + + public void setGetRetry(Retry getRetry) { + this.getRetry = getRetry; + } + + public Retry getListRetry() { + return this.listRetry; + } + + public void setListRetry(Retry listRetry) { + this.listRetry = listRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringAutoConfiguration.java index 1d1dc1d5694..2757f541445 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringAutoConfiguration.java @@ -156,11 +156,28 @@ public ReservationBlocksSettings reservationBlocksSettings( clientSettingsBuilder.getSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + RetrySettings getIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getIamPolicySettings().setRetrySettings(getIamPolicyRetrySettings); + RetrySettings listRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + RetrySettings setIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.setIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.setIamPolicySettings().setRetrySettings(setIamPolicyRetrySettings); + + RetrySettings testIamPermissionsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.testIamPermissionsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .testIamPermissionsSettings() + .setRetrySettings(testIamPermissionsRetrySettings); + if (LOGGER.isTraceEnabled()) { LOGGER.trace("Configured service-level retry settings from properties."); } @@ -175,6 +192,16 @@ public ReservationBlocksSettings reservationBlocksSettings( LOGGER.trace("Configured method-level retry settings for get 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 listRetry = clientProperties.getListRetry(); if (listRetry != null) { RetrySettings listRetrySettings = @@ -185,6 +212,30 @@ public ReservationBlocksSettings reservationBlocksSettings( LOGGER.trace("Configured method-level retry settings for list 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 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(); } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringProperties.java index db386f5a50b..b356881587c 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringProperties.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationBlocksSpringProperties.java @@ -47,11 +47,26 @@ public class ReservationBlocksSpringProperties implements CredentialsSupplier { * over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry getRetry; + /** + * 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 list. If defined, this takes precedence * over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry listRetry; + /** + * 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 testIamPermissions. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry testIamPermissionsRetry; @Override public Credentials getCredentials() { @@ -90,6 +105,14 @@ public void setGetRetry(Retry getRetry) { this.getRetry = getRetry; } + public Retry getGetIamPolicyRetry() { + return this.getIamPolicyRetry; + } + + public void setGetIamPolicyRetry(Retry getIamPolicyRetry) { + this.getIamPolicyRetry = getIamPolicyRetry; + } + public Retry getListRetry() { return this.listRetry; } @@ -97,4 +120,20 @@ public Retry getListRetry() { public void setListRetry(Retry listRetry) { this.listRetry = listRetry; } + + public Retry getSetIamPolicyRetry() { + return this.setIamPolicyRetry; + } + + public void setSetIamPolicyRetry(Retry setIamPolicyRetry) { + this.setIamPolicyRetry = setIamPolicyRetry; + } + + public Retry getTestIamPermissionsRetry() { + return this.testIamPermissionsRetry; + } + + public void setTestIamPermissionsRetry(Retry testIamPermissionsRetry) { + this.testIamPermissionsRetry = testIamPermissionsRetry; + } } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringAutoConfiguration.java index ded92b42970..b8d1456d271 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringAutoConfiguration.java @@ -157,11 +157,28 @@ public ReservationSubBlocksSettings reservationSubBlocksSettings( clientSettingsBuilder.getSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + RetrySettings getIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getIamPolicySettings().setRetrySettings(getIamPolicyRetrySettings); + RetrySettings listRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + RetrySettings setIamPolicyRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.setIamPolicySettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.setIamPolicySettings().setRetrySettings(setIamPolicyRetrySettings); + + RetrySettings testIamPermissionsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.testIamPermissionsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder + .testIamPermissionsSettings() + .setRetrySettings(testIamPermissionsRetrySettings); + if (LOGGER.isTraceEnabled()) { LOGGER.trace("Configured service-level retry settings from properties."); } @@ -176,6 +193,16 @@ public ReservationSubBlocksSettings reservationSubBlocksSettings( LOGGER.trace("Configured method-level retry settings for get 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 listRetry = clientProperties.getListRetry(); if (listRetry != null) { RetrySettings listRetrySettings = @@ -186,6 +213,30 @@ public ReservationSubBlocksSettings reservationSubBlocksSettings( LOGGER.trace("Configured method-level retry settings for list 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 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(); } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringProperties.java index 5e4065ecea4..1a5fe8908b0 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringProperties.java +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/ReservationSubBlocksSpringProperties.java @@ -47,11 +47,26 @@ public class ReservationSubBlocksSpringProperties implements CredentialsSupplier * over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry getRetry; + /** + * 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 list. If defined, this takes precedence * over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry listRetry; + /** + * 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 testIamPermissions. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry testIamPermissionsRetry; @Override public Credentials getCredentials() { @@ -90,6 +105,14 @@ public void setGetRetry(Retry getRetry) { this.getRetry = getRetry; } + public Retry getGetIamPolicyRetry() { + return this.getIamPolicyRetry; + } + + public void setGetIamPolicyRetry(Retry getIamPolicyRetry) { + this.getIamPolicyRetry = getIamPolicyRetry; + } + public Retry getListRetry() { return this.listRetry; } @@ -97,4 +120,20 @@ public Retry getListRetry() { public void setListRetry(Retry listRetry) { this.listRetry = listRetry; } + + public Retry getSetIamPolicyRetry() { + return this.setIamPolicyRetry; + } + + public void setSetIamPolicyRetry(Retry setIamPolicyRetry) { + this.setIamPolicyRetry = setIamPolicyRetry; + } + + public Retry getTestIamPermissionsRetry() { + return this.testIamPermissionsRetry; + } + + public void setTestIamPermissionsRetry(Retry testIamPermissionsRetry) { + this.testIamPermissionsRetry = testIamPermissionsRetry; + } } diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringAutoConfiguration.java new file mode 100644 index 00000000000..09aaeb91efc --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringAutoConfiguration.java @@ -0,0 +1,206 @@ +/* + * Copyright 2025 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.compute.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.compute.v1.WireGroupsClient; +import com.google.cloud.compute.v1.WireGroupsSettings; +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 WireGroupsClient}. + * + *

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(WireGroupsClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.compute.v1.wire-groups.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(WireGroupsSpringProperties.class) +public class WireGroupsSpringAutoConfiguration { + private final WireGroupsSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = LogFactory.getLog(WireGroupsSpringAutoConfiguration.class); + + protected WireGroupsSpringAutoConfiguration( + WireGroupsSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from WireGroups-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 = "defaultWireGroupsTransportChannelProvider") + public TransportChannelProvider defaultWireGroupsTransportChannelProvider() { + return WireGroupsSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a WireGroupsSettings bean configured to use a DefaultCredentialsProvider and the + * client library's default transport channel provider + * (defaultWireGroupsTransportChannelProvider()). 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 WireGroupsSpringProperties. 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 WireGroupsSettings} bean configured with {@link TransportChannelProvider} + * bean. + */ + @Bean + @ConditionalOnMissingBean + public WireGroupsSettings wireGroupsSettings( + @Qualifier("defaultWireGroupsTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + WireGroupsSettings.Builder clientSettingsBuilder = WireGroupsSettings.newBuilder(); + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(WireGroupsSettings.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 = + WireGroupsSettings.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 getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured service-level retry settings from properties."); + } + } + Retry getRetry = clientProperties.getGetRetry(); + if (getRetry != null) { + RetrySettings getRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSettings().getRetrySettings(), getRetry); + clientSettingsBuilder.getSettings().setRetrySettings(getRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for get from properties."); + } + } + Retry listRetry = clientProperties.getListRetry(); + if (listRetry != null) { + RetrySettings listRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSettings().getRetrySettings(), listRetry); + clientSettingsBuilder.listSettings().setRetrySettings(listRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for list from properties."); + } + } + return clientSettingsBuilder.build(); + } + + /** + * Provides a WireGroupsClient bean configured with WireGroupsSettings. + * + * @param wireGroupsSettings settings to configure an instance of client bean. + * @return a {@link WireGroupsClient} bean configured with {@link WireGroupsSettings} + */ + @Bean + @ConditionalOnMissingBean + public WireGroupsClient wireGroupsClient(WireGroupsSettings wireGroupsSettings) + throws IOException { + return WireGroupsClient.create(wireGroupsSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-wire-groups"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringProperties.java b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringProperties.java new file mode 100644 index 00000000000..dc9ec911f76 --- /dev/null +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/java/com/google/cloud/compute/v1/spring/WireGroupsSpringProperties.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 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.compute.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 WireGroups client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.compute.v1.wire-groups") +public class WireGroupsSpringProperties 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/compute", + "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 get. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getRetry; + /** + * Allow override of retry settings at method-level for list. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listRetry; + + @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 getGetRetry() { + return this.getRetry; + } + + public void setGetRetry(Retry getRetry) { + this.getRetry = getRetry; + } + + public Retry getListRetry() { + return this.listRetry; + } + + public void setListRetry(Retry listRetry) { + this.listRetry = listRetry; + } +} diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 4aa146d25c1..20dad3de509 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -12,6 +12,12 @@ "description": "Auto-configure Google Cloud compute/Addresses components.", "defaultValue": true }, + { + "name": "com.google.cloud.compute.v1.advice.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud compute/Advice components.", + "defaultValue": true + }, { "name": "com.google.cloud.compute.v1.autoscalers.enabled", "type": "java.lang.Boolean", @@ -30,6 +36,12 @@ "description": "Auto-configure Google Cloud compute/BackendServices components.", "defaultValue": true }, + { + "name": "com.google.cloud.compute.v1.cross-site-networks.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud compute/CrossSiteNetworks components.", + "defaultValue": true + }, { "name": "com.google.cloud.compute.v1.disk-types.enabled", "type": "java.lang.Boolean", @@ -66,6 +78,12 @@ "description": "Auto-configure Google Cloud compute/ForwardingRules components.", "defaultValue": true }, + { + "name": "com.google.cloud.compute.v1.future-reservations.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud compute/FutureReservations components.", + "defaultValue": true + }, { "name": "com.google.cloud.compute.v1.global-addresses.enabled", "type": "java.lang.Boolean", @@ -618,6 +636,12 @@ "description": "Auto-configure Google Cloud compute/VpnTunnels components.", "defaultValue": true }, + { + "name": "com.google.cloud.compute.v1.wire-groups.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud compute/WireGroups components.", + "defaultValue": true + }, { "name": "com.google.cloud.compute.v1.zone-operations.enabled", "type": "java.lang.Boolean", diff --git a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 9a17ba272ff..037bd3649ed 100644 --- a/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-previews/google-cloud-compute-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,14 +1,17 @@ com.google.cloud.compute.v1.spring.AcceleratorTypesSpringAutoConfiguration com.google.cloud.compute.v1.spring.AddressesSpringAutoConfiguration +com.google.cloud.compute.v1.spring.AdviceSpringAutoConfiguration com.google.cloud.compute.v1.spring.AutoscalersSpringAutoConfiguration com.google.cloud.compute.v1.spring.BackendBucketsSpringAutoConfiguration com.google.cloud.compute.v1.spring.BackendServicesSpringAutoConfiguration +com.google.cloud.compute.v1.spring.CrossSiteNetworksSpringAutoConfiguration com.google.cloud.compute.v1.spring.DiskTypesSpringAutoConfiguration com.google.cloud.compute.v1.spring.DisksSpringAutoConfiguration com.google.cloud.compute.v1.spring.ExternalVpnGatewaysSpringAutoConfiguration com.google.cloud.compute.v1.spring.FirewallPoliciesSpringAutoConfiguration com.google.cloud.compute.v1.spring.FirewallsSpringAutoConfiguration com.google.cloud.compute.v1.spring.ForwardingRulesSpringAutoConfiguration +com.google.cloud.compute.v1.spring.FutureReservationsSpringAutoConfiguration com.google.cloud.compute.v1.spring.GlobalAddressesSpringAutoConfiguration com.google.cloud.compute.v1.spring.GlobalForwardingRulesSpringAutoConfiguration com.google.cloud.compute.v1.spring.GlobalNetworkEndpointGroupsSpringAutoConfiguration @@ -101,5 +104,6 @@ com.google.cloud.compute.v1.spring.TargetVpnGatewaysSpringAutoConfiguration com.google.cloud.compute.v1.spring.UrlMapsSpringAutoConfiguration com.google.cloud.compute.v1.spring.VpnGatewaysSpringAutoConfiguration com.google.cloud.compute.v1.spring.VpnTunnelsSpringAutoConfiguration +com.google.cloud.compute.v1.spring.WireGroupsSpringAutoConfiguration com.google.cloud.compute.v1.spring.ZoneOperationsSpringAutoConfiguration com.google.cloud.compute.v1.spring.ZonesSpringAutoConfiguration \ No newline at end of file diff --git a/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorEvaluationsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorEvaluationsSpringAutoConfiguration.java new file mode 100644 index 00000000000..71919095391 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorEvaluationsSpringAutoConfiguration.java @@ -0,0 +1,287 @@ +/* + * Copyright 2025 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.GeneratorEvaluationsClient; +import com.google.cloud.dialogflow.v2.GeneratorEvaluationsSettings; +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 GeneratorEvaluationsClient}. + * + *

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(GeneratorEvaluationsClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.dialogflow.v2.generator-evaluations.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(GeneratorEvaluationsSpringProperties.class) +public class GeneratorEvaluationsSpringAutoConfiguration { + private final GeneratorEvaluationsSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(GeneratorEvaluationsSpringAutoConfiguration.class); + + protected GeneratorEvaluationsSpringAutoConfiguration( + GeneratorEvaluationsSpringProperties clientProperties, + CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from GeneratorEvaluations-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 = "defaultGeneratorEvaluationsTransportChannelProvider") + public TransportChannelProvider defaultGeneratorEvaluationsTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return GeneratorEvaluationsSettings.defaultHttpJsonTransportProviderBuilder().build(); + } + return GeneratorEvaluationsSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a GeneratorEvaluationsSettings bean configured to use a DefaultCredentialsProvider and + * the client library's default transport channel provider + * (defaultGeneratorEvaluationsTransportChannelProvider()). 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 GeneratorEvaluationsSpringProperties. 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 GeneratorEvaluationsSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public GeneratorEvaluationsSettings generatorEvaluationsSettings( + @Qualifier("defaultGeneratorEvaluationsTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + GeneratorEvaluationsSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = GeneratorEvaluationsSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = GeneratorEvaluationsSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(GeneratorEvaluationsSettings.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 = + GeneratorEvaluationsSettings.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 getGeneratorEvaluationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGeneratorEvaluationSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .getGeneratorEvaluationSettings() + .setRetrySettings(getGeneratorEvaluationRetrySettings); + + RetrySettings listGeneratorEvaluationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGeneratorEvaluationsSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .listGeneratorEvaluationsSettings() + .setRetrySettings(listGeneratorEvaluationsRetrySettings); + + RetrySettings deleteGeneratorEvaluationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGeneratorEvaluationSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .deleteGeneratorEvaluationSettings() + .setRetrySettings(deleteGeneratorEvaluationRetrySettings); + + 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 getGeneratorEvaluationRetry = clientProperties.getGetGeneratorEvaluationRetry(); + if (getGeneratorEvaluationRetry != null) { + RetrySettings getGeneratorEvaluationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getGeneratorEvaluationSettings().getRetrySettings(), + getGeneratorEvaluationRetry); + clientSettingsBuilder + .getGeneratorEvaluationSettings() + .setRetrySettings(getGeneratorEvaluationRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for getGeneratorEvaluation from properties."); + } + } + Retry listGeneratorEvaluationsRetry = clientProperties.getListGeneratorEvaluationsRetry(); + if (listGeneratorEvaluationsRetry != null) { + RetrySettings listGeneratorEvaluationsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listGeneratorEvaluationsSettings().getRetrySettings(), + listGeneratorEvaluationsRetry); + clientSettingsBuilder + .listGeneratorEvaluationsSettings() + .setRetrySettings(listGeneratorEvaluationsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for listGeneratorEvaluations from properties."); + } + } + Retry deleteGeneratorEvaluationRetry = clientProperties.getDeleteGeneratorEvaluationRetry(); + if (deleteGeneratorEvaluationRetry != null) { + RetrySettings deleteGeneratorEvaluationRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteGeneratorEvaluationSettings().getRetrySettings(), + deleteGeneratorEvaluationRetry); + clientSettingsBuilder + .deleteGeneratorEvaluationSettings() + .setRetrySettings(deleteGeneratorEvaluationRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for deleteGeneratorEvaluation 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 GeneratorEvaluationsClient bean configured with GeneratorEvaluationsSettings. + * + * @param generatorEvaluationsSettings settings to configure an instance of client bean. + * @return a {@link GeneratorEvaluationsClient} bean configured with {@link + * GeneratorEvaluationsSettings} + */ + @Bean + @ConditionalOnMissingBean + public GeneratorEvaluationsClient generatorEvaluationsClient( + GeneratorEvaluationsSettings generatorEvaluationsSettings) throws IOException { + return GeneratorEvaluationsClient.create(generatorEvaluationsSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-generator-evaluations"; + 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/GeneratorEvaluationsSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorEvaluationsSpringProperties.java new file mode 100644 index 00000000000..f5a578aa777 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/GeneratorEvaluationsSpringProperties.java @@ -0,0 +1,149 @@ +/* + * Copyright 2025 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 GeneratorEvaluations client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.dialogflow.v2.generator-evaluations") +public class GeneratorEvaluationsSpringProperties 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 getGeneratorEvaluation. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getGeneratorEvaluationRetry; + /** + * Allow override of retry settings at method-level for listGeneratorEvaluations. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listGeneratorEvaluationsRetry; + /** + * Allow override of retry settings at method-level for deleteGeneratorEvaluation. If defined, + * this takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry deleteGeneratorEvaluationRetry; + /** + * 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 getGetGeneratorEvaluationRetry() { + return this.getGeneratorEvaluationRetry; + } + + public void setGetGeneratorEvaluationRetry(Retry getGeneratorEvaluationRetry) { + this.getGeneratorEvaluationRetry = getGeneratorEvaluationRetry; + } + + public Retry getListGeneratorEvaluationsRetry() { + return this.listGeneratorEvaluationsRetry; + } + + public void setListGeneratorEvaluationsRetry(Retry listGeneratorEvaluationsRetry) { + this.listGeneratorEvaluationsRetry = listGeneratorEvaluationsRetry; + } + + public Retry getDeleteGeneratorEvaluationRetry() { + return this.deleteGeneratorEvaluationRetry; + } + + public void setDeleteGeneratorEvaluationRetry(Retry deleteGeneratorEvaluationRetry) { + this.deleteGeneratorEvaluationRetry = deleteGeneratorEvaluationRetry; + } + + 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/SipTrunksSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/SipTrunksSpringAutoConfiguration.java new file mode 100644 index 00000000000..3da85693bd4 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/SipTrunksSpringAutoConfiguration.java @@ -0,0 +1,292 @@ +/* + * Copyright 2025 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.SipTrunksClient; +import com.google.cloud.dialogflow.v2.SipTrunksSettings; +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 SipTrunksClient}. + * + *

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(SipTrunksClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.dialogflow.v2.sip-trunks.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(SipTrunksSpringProperties.class) +public class SipTrunksSpringAutoConfiguration { + private final SipTrunksSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = LogFactory.getLog(SipTrunksSpringAutoConfiguration.class); + + protected SipTrunksSpringAutoConfiguration( + SipTrunksSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from SipTrunks-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 = "defaultSipTrunksTransportChannelProvider") + public TransportChannelProvider defaultSipTrunksTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return SipTrunksSettings.defaultHttpJsonTransportProviderBuilder().build(); + } + return SipTrunksSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a SipTrunksSettings bean configured to use a DefaultCredentialsProvider and the client + * library's default transport channel provider (defaultSipTrunksTransportChannelProvider()). 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 SipTrunksSpringProperties. 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 SipTrunksSettings} bean configured with {@link TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public SipTrunksSettings sipTrunksSettings( + @Qualifier("defaultSipTrunksTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + SipTrunksSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = SipTrunksSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = SipTrunksSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(SipTrunksSettings.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 = + SipTrunksSettings.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 createSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createSipTrunkSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.createSipTrunkSettings().setRetrySettings(createSipTrunkRetrySettings); + + RetrySettings deleteSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteSipTrunkSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.deleteSipTrunkSettings().setRetrySettings(deleteSipTrunkRetrySettings); + + RetrySettings listSipTrunksRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSipTrunksSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listSipTrunksSettings().setRetrySettings(listSipTrunksRetrySettings); + + RetrySettings getSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSipTrunkSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getSipTrunkSettings().setRetrySettings(getSipTrunkRetrySettings); + + RetrySettings updateSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateSipTrunkSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.updateSipTrunkSettings().setRetrySettings(updateSipTrunkRetrySettings); + + 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 createSipTrunkRetry = clientProperties.getCreateSipTrunkRetry(); + if (createSipTrunkRetry != null) { + RetrySettings createSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createSipTrunkSettings().getRetrySettings(), + createSipTrunkRetry); + clientSettingsBuilder.createSipTrunkSettings().setRetrySettings(createSipTrunkRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for createSipTrunk from properties."); + } + } + Retry deleteSipTrunkRetry = clientProperties.getDeleteSipTrunkRetry(); + if (deleteSipTrunkRetry != null) { + RetrySettings deleteSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteSipTrunkSettings().getRetrySettings(), + deleteSipTrunkRetry); + clientSettingsBuilder.deleteSipTrunkSettings().setRetrySettings(deleteSipTrunkRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for deleteSipTrunk from properties."); + } + } + Retry listSipTrunksRetry = clientProperties.getListSipTrunksRetry(); + if (listSipTrunksRetry != null) { + RetrySettings listSipTrunksRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listSipTrunksSettings().getRetrySettings(), listSipTrunksRetry); + clientSettingsBuilder.listSipTrunksSettings().setRetrySettings(listSipTrunksRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listSipTrunks from properties."); + } + } + Retry getSipTrunkRetry = clientProperties.getGetSipTrunkRetry(); + if (getSipTrunkRetry != null) { + RetrySettings getSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getSipTrunkSettings().getRetrySettings(), getSipTrunkRetry); + clientSettingsBuilder.getSipTrunkSettings().setRetrySettings(getSipTrunkRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getSipTrunk from properties."); + } + } + Retry updateSipTrunkRetry = clientProperties.getUpdateSipTrunkRetry(); + if (updateSipTrunkRetry != null) { + RetrySettings updateSipTrunkRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateSipTrunkSettings().getRetrySettings(), + updateSipTrunkRetry); + clientSettingsBuilder.updateSipTrunkSettings().setRetrySettings(updateSipTrunkRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for updateSipTrunk 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 SipTrunksClient bean configured with SipTrunksSettings. + * + * @param sipTrunksSettings settings to configure an instance of client bean. + * @return a {@link SipTrunksClient} bean configured with {@link SipTrunksSettings} + */ + @Bean + @ConditionalOnMissingBean + public SipTrunksClient sipTrunksClient(SipTrunksSettings sipTrunksSettings) throws IOException { + return SipTrunksClient.create(sipTrunksSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-sip-trunks"; + 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/SipTrunksSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/SipTrunksSpringProperties.java new file mode 100644 index 00000000000..33561f89f83 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/SipTrunksSpringProperties.java @@ -0,0 +1,175 @@ +/* + * Copyright 2025 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 SipTrunks client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.dialogflow.v2.sip-trunks") +public class SipTrunksSpringProperties 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 createSipTrunk. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry createSipTrunkRetry; + /** + * Allow override of retry settings at method-level for deleteSipTrunk. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry deleteSipTrunkRetry; + /** + * Allow override of retry settings at method-level for listSipTrunks. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listSipTrunksRetry; + /** + * Allow override of retry settings at method-level for getSipTrunk. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getSipTrunkRetry; + /** + * Allow override of retry settings at method-level for updateSipTrunk. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry updateSipTrunkRetry; + /** + * 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 getCreateSipTrunkRetry() { + return this.createSipTrunkRetry; + } + + public void setCreateSipTrunkRetry(Retry createSipTrunkRetry) { + this.createSipTrunkRetry = createSipTrunkRetry; + } + + public Retry getDeleteSipTrunkRetry() { + return this.deleteSipTrunkRetry; + } + + public void setDeleteSipTrunkRetry(Retry deleteSipTrunkRetry) { + this.deleteSipTrunkRetry = deleteSipTrunkRetry; + } + + public Retry getListSipTrunksRetry() { + return this.listSipTrunksRetry; + } + + public void setListSipTrunksRetry(Retry listSipTrunksRetry) { + this.listSipTrunksRetry = listSipTrunksRetry; + } + + public Retry getGetSipTrunkRetry() { + return this.getSipTrunkRetry; + } + + public void setGetSipTrunkRetry(Retry getSipTrunkRetry) { + this.getSipTrunkRetry = getSipTrunkRetry; + } + + public Retry getUpdateSipTrunkRetry() { + return this.updateSipTrunkRetry; + } + + public void setUpdateSipTrunkRetry(Retry updateSipTrunkRetry) { + this.updateSipTrunkRetry = updateSipTrunkRetry; + } + + 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/ToolsSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ToolsSpringAutoConfiguration.java new file mode 100644 index 00000000000..d2bf4703d09 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ToolsSpringAutoConfiguration.java @@ -0,0 +1,289 @@ +/* + * Copyright 2025 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.ToolsClient; +import com.google.cloud.dialogflow.v2.ToolsSettings; +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 ToolsClient}. + * + *

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(ToolsClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.dialogflow.v2.tools.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(ToolsSpringProperties.class) +public class ToolsSpringAutoConfiguration { + private final ToolsSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = LogFactory.getLog(ToolsSpringAutoConfiguration.class); + + protected ToolsSpringAutoConfiguration( + ToolsSpringProperties clientProperties, CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Tools-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 = "defaultToolsTransportChannelProvider") + public TransportChannelProvider defaultToolsTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return ToolsSettings.defaultHttpJsonTransportProviderBuilder().build(); + } + return ToolsSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a ToolsSettings bean configured to use a DefaultCredentialsProvider and the client + * library's default transport channel provider (defaultToolsTransportChannelProvider()). 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 ToolsSpringProperties. 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 ToolsSettings} bean configured with {@link TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public ToolsSettings toolsSettings( + @Qualifier("defaultToolsTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + ToolsSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = ToolsSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = ToolsSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(ToolsSettings.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 = + ToolsSettings.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 createToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createToolSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.createToolSettings().setRetrySettings(createToolRetrySettings); + + RetrySettings getToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getToolSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.getToolSettings().setRetrySettings(getToolRetrySettings); + + RetrySettings listToolsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listToolsSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.listToolsSettings().setRetrySettings(listToolsRetrySettings); + + RetrySettings deleteToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteToolSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.deleteToolSettings().setRetrySettings(deleteToolRetrySettings); + + RetrySettings updateToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateToolSettings().getRetrySettings(), serviceRetry); + clientSettingsBuilder.updateToolSettings().setRetrySettings(updateToolRetrySettings); + + 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 createToolRetry = clientProperties.getCreateToolRetry(); + if (createToolRetry != null) { + RetrySettings createToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.createToolSettings().getRetrySettings(), createToolRetry); + clientSettingsBuilder.createToolSettings().setRetrySettings(createToolRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for createTool from properties."); + } + } + Retry getToolRetry = clientProperties.getGetToolRetry(); + if (getToolRetry != null) { + RetrySettings getToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getToolSettings().getRetrySettings(), getToolRetry); + clientSettingsBuilder.getToolSettings().setRetrySettings(getToolRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for getTool from properties."); + } + } + Retry listToolsRetry = clientProperties.getListToolsRetry(); + if (listToolsRetry != null) { + RetrySettings listToolsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listToolsSettings().getRetrySettings(), listToolsRetry); + clientSettingsBuilder.listToolsSettings().setRetrySettings(listToolsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for listTools from properties."); + } + } + Retry deleteToolRetry = clientProperties.getDeleteToolRetry(); + if (deleteToolRetry != null) { + RetrySettings deleteToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.deleteToolSettings().getRetrySettings(), deleteToolRetry); + clientSettingsBuilder.deleteToolSettings().setRetrySettings(deleteToolRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for deleteTool from properties."); + } + } + Retry updateToolRetry = clientProperties.getUpdateToolRetry(); + if (updateToolRetry != null) { + RetrySettings updateToolRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.updateToolSettings().getRetrySettings(), updateToolRetry); + clientSettingsBuilder.updateToolSettings().setRetrySettings(updateToolRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Configured method-level retry settings for updateTool 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 ToolsClient bean configured with ToolsSettings. + * + * @param toolsSettings settings to configure an instance of client bean. + * @return a {@link ToolsClient} bean configured with {@link ToolsSettings} + */ + @Bean + @ConditionalOnMissingBean + public ToolsClient toolsClient(ToolsSettings toolsSettings) throws IOException { + return ToolsClient.create(toolsSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-tools"; + 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/ToolsSpringProperties.java b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ToolsSpringProperties.java new file mode 100644 index 00000000000..233308b9363 --- /dev/null +++ b/spring-cloud-previews/google-cloud-dialogflow-spring-starter/src/main/java/com/google/cloud/dialogflow/v2/spring/ToolsSpringProperties.java @@ -0,0 +1,175 @@ +/* + * Copyright 2025 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 Tools client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.dialogflow.v2.tools") +public class ToolsSpringProperties 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 createTool. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry createToolRetry; + /** + * Allow override of retry settings at method-level for getTool. If defined, this takes precedence + * over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getToolRetry; + /** + * Allow override of retry settings at method-level for listTools. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listToolsRetry; + /** + * Allow override of retry settings at method-level for deleteTool. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry deleteToolRetry; + /** + * Allow override of retry settings at method-level for updateTool. If defined, this takes + * precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry updateToolRetry; + /** + * 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 getCreateToolRetry() { + return this.createToolRetry; + } + + public void setCreateToolRetry(Retry createToolRetry) { + this.createToolRetry = createToolRetry; + } + + public Retry getGetToolRetry() { + return this.getToolRetry; + } + + public void setGetToolRetry(Retry getToolRetry) { + this.getToolRetry = getToolRetry; + } + + public Retry getListToolsRetry() { + return this.listToolsRetry; + } + + public void setListToolsRetry(Retry listToolsRetry) { + this.listToolsRetry = listToolsRetry; + } + + public Retry getDeleteToolRetry() { + return this.deleteToolRetry; + } + + public void setDeleteToolRetry(Retry deleteToolRetry) { + this.deleteToolRetry = deleteToolRetry; + } + + public Retry getUpdateToolRetry() { + return this.updateToolRetry; + } + + public void setUpdateToolRetry(Retry updateToolRetry) { + this.updateToolRetry = updateToolRetry; + } + + 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/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 11290d44872..8f8debcb013 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 @@ -78,6 +78,12 @@ "description": "Auto-configure Google Cloud dialogflow/Generators components.", "defaultValue": true }, + { + "name": "com.google.cloud.dialogflow.v2.generator-evaluations.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud dialogflow/GeneratorEvaluations components.", + "defaultValue": true + }, { "name": "com.google.cloud.dialogflow.v2.intents.enabled", "type": "java.lang.Boolean", @@ -108,6 +114,18 @@ "description": "Auto-configure Google Cloud dialogflow/SessionEntityTypes components.", "defaultValue": true }, + { + "name": "com.google.cloud.dialogflow.v2.sip-trunks.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud dialogflow/SipTrunks components.", + "defaultValue": true + }, + { + "name": "com.google.cloud.dialogflow.v2.tools.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud dialogflow/Tools components.", + "defaultValue": true + }, { "name": "com.google.cloud.dialogflow.v2.versions.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 84015b38e1b..5b396a1140c 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 @@ -11,9 +11,12 @@ 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.GeneratorEvaluationsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.IntentsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.KnowledgeBasesSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.ParticipantsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.SessionsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.SessionEntityTypesSpringAutoConfiguration +com.google.cloud.dialogflow.v2.spring.SipTrunksSpringAutoConfiguration +com.google.cloud.dialogflow.v2.spring.ToolsSpringAutoConfiguration com.google.cloud.dialogflow.v2.spring.VersionsSpringAutoConfiguration \ No newline at end of file diff --git a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringAutoConfiguration.java new file mode 100644 index 00000000000..601e1a1fad3 --- /dev/null +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringAutoConfiguration.java @@ -0,0 +1,320 @@ +/* + * Copyright 2025 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.networkmanagement.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.networkmanagement.v1.OrganizationVpcFlowLogsServiceClient; +import com.google.cloud.networkmanagement.v1.OrganizationVpcFlowLogsServiceSettings; +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 OrganizationVpcFlowLogsServiceClient}. + * + *

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(OrganizationVpcFlowLogsServiceClient.class) +@ConditionalOnProperty( + value = "com.google.cloud.networkmanagement.v1.organization-vpc-flow-logs-service.enabled", + matchIfMissing = true) +@EnableConfigurationProperties(OrganizationVpcFlowLogsServiceSpringProperties.class) +public class OrganizationVpcFlowLogsServiceSpringAutoConfiguration { + private final OrganizationVpcFlowLogsServiceSpringProperties clientProperties; + private final CredentialsProvider credentialsProvider; + private static final Log LOGGER = + LogFactory.getLog(OrganizationVpcFlowLogsServiceSpringAutoConfiguration.class); + + protected OrganizationVpcFlowLogsServiceSpringAutoConfiguration( + OrganizationVpcFlowLogsServiceSpringProperties clientProperties, + CredentialsProvider credentialsProvider) + throws IOException { + this.clientProperties = clientProperties; + if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Using credentials from OrganizationVpcFlowLogsService-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 = "defaultOrganizationVpcFlowLogsServiceTransportChannelProvider") + public TransportChannelProvider defaultOrganizationVpcFlowLogsServiceTransportChannelProvider() { + if (this.clientProperties.getUseRest()) { + return OrganizationVpcFlowLogsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .build(); + } + return OrganizationVpcFlowLogsServiceSettings.defaultTransportChannelProvider(); + } + + /** + * Provides a OrganizationVpcFlowLogsServiceSettings bean configured to use a + * DefaultCredentialsProvider and the client library's default transport channel provider + * (defaultOrganizationVpcFlowLogsServiceTransportChannelProvider()). 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 OrganizationVpcFlowLogsServiceSpringProperties. 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 OrganizationVpcFlowLogsServiceSettings} bean configured with {@link + * TransportChannelProvider} bean. + */ + @Bean + @ConditionalOnMissingBean + public OrganizationVpcFlowLogsServiceSettings organizationVpcFlowLogsServiceSettings( + @Qualifier("defaultOrganizationVpcFlowLogsServiceTransportChannelProvider") + TransportChannelProvider defaultTransportChannelProvider) + throws IOException { + OrganizationVpcFlowLogsServiceSettings.Builder clientSettingsBuilder; + if (this.clientProperties.getUseRest()) { + clientSettingsBuilder = OrganizationVpcFlowLogsServiceSettings.newHttpJsonBuilder(); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using REST (HTTP/JSON) transport."); + } + } else { + clientSettingsBuilder = OrganizationVpcFlowLogsServiceSettings.newBuilder(); + } + clientSettingsBuilder + .setCredentialsProvider(this.credentialsProvider) + .setTransportChannelProvider(defaultTransportChannelProvider) + .setEndpoint(OrganizationVpcFlowLogsServiceSettings.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 = + OrganizationVpcFlowLogsServiceSettings.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 listVpcFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listVpcFlowLogsConfigsSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .listVpcFlowLogsConfigsSettings() + .setRetrySettings(listVpcFlowLogsConfigsRetrySettings); + + RetrySettings getVpcFlowLogsConfigRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getVpcFlowLogsConfigSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .getVpcFlowLogsConfigSettings() + .setRetrySettings(getVpcFlowLogsConfigRetrySettings); + + 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 listVpcFlowLogsConfigsRetry = clientProperties.getListVpcFlowLogsConfigsRetry(); + if (listVpcFlowLogsConfigsRetry != null) { + RetrySettings listVpcFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.listVpcFlowLogsConfigsSettings().getRetrySettings(), + listVpcFlowLogsConfigsRetry); + clientSettingsBuilder + .listVpcFlowLogsConfigsSettings() + .setRetrySettings(listVpcFlowLogsConfigsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for listVpcFlowLogsConfigs from properties."); + } + } + Retry getVpcFlowLogsConfigRetry = clientProperties.getGetVpcFlowLogsConfigRetry(); + if (getVpcFlowLogsConfigRetry != null) { + RetrySettings getVpcFlowLogsConfigRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.getVpcFlowLogsConfigSettings().getRetrySettings(), + getVpcFlowLogsConfigRetry); + clientSettingsBuilder + .getVpcFlowLogsConfigSettings() + .setRetrySettings(getVpcFlowLogsConfigRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for getVpcFlowLogsConfig 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 OrganizationVpcFlowLogsServiceClient bean configured with + * OrganizationVpcFlowLogsServiceSettings. + * + * @param organizationVpcFlowLogsServiceSettings settings to configure an instance of client bean. + * @return a {@link OrganizationVpcFlowLogsServiceClient} bean configured with {@link + * OrganizationVpcFlowLogsServiceSettings} + */ + @Bean + @ConditionalOnMissingBean + public OrganizationVpcFlowLogsServiceClient organizationVpcFlowLogsServiceClient( + OrganizationVpcFlowLogsServiceSettings organizationVpcFlowLogsServiceSettings) + throws IOException { + return OrganizationVpcFlowLogsServiceClient.create(organizationVpcFlowLogsServiceSettings); + } + + private HeaderProvider userAgentHeaderProvider() { + String springLibrary = "spring-autogen-organization-vpc-flow-logs-service"; + String version = this.getClass().getPackage().getImplementationVersion(); + return () -> Collections.singletonMap("user-agent", springLibrary + "/" + version); + } +} diff --git a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringProperties.java b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringProperties.java new file mode 100644 index 00000000000..6846b7e9c0d --- /dev/null +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/OrganizationVpcFlowLogsServiceSpringProperties.java @@ -0,0 +1,173 @@ +/* + * Copyright 2025 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.networkmanagement.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 OrganizationVpcFlowLogsService client bean */ +@Generated("by google-cloud-spring-generator") +@BetaApi("Autogenerated Spring autoconfiguration is not yet stable") +@ConfigurationProperties("com.google.cloud.networkmanagement.v1.organization-vpc-flow-logs-service") +public class OrganizationVpcFlowLogsServiceSpringProperties 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 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 listVpcFlowLogsConfigs. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry listVpcFlowLogsConfigsRetry; + /** + * Allow override of retry settings at method-level for getVpcFlowLogsConfig. If defined, this + * takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry getVpcFlowLogsConfigRetry; + /** + * 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 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 getListVpcFlowLogsConfigsRetry() { + return this.listVpcFlowLogsConfigsRetry; + } + + public void setListVpcFlowLogsConfigsRetry(Retry listVpcFlowLogsConfigsRetry) { + this.listVpcFlowLogsConfigsRetry = listVpcFlowLogsConfigsRetry; + } + + public Retry getGetVpcFlowLogsConfigRetry() { + return this.getVpcFlowLogsConfigRetry; + } + + public void setGetVpcFlowLogsConfigRetry(Retry getVpcFlowLogsConfigRetry) { + this.getVpcFlowLogsConfigRetry = getVpcFlowLogsConfigRetry; + } + + 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-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringAutoConfiguration.java b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringAutoConfiguration.java index badaa17a7ca..695a4dbf5e8 100644 --- a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringAutoConfiguration.java +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringAutoConfiguration.java @@ -177,6 +177,22 @@ public VpcFlowLogsServiceSettings vpcFlowLogsServiceSettings( .getVpcFlowLogsConfigSettings() .setRetrySettings(getVpcFlowLogsConfigRetrySettings); + RetrySettings queryOrgVpcFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.queryOrgVpcFlowLogsConfigsSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .queryOrgVpcFlowLogsConfigsSettings() + .setRetrySettings(queryOrgVpcFlowLogsConfigsRetrySettings); + + RetrySettings showEffectiveFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.showEffectiveFlowLogsConfigsSettings().getRetrySettings(), + serviceRetry); + clientSettingsBuilder + .showEffectiveFlowLogsConfigsSettings() + .setRetrySettings(showEffectiveFlowLogsConfigsRetrySettings); + RetrySettings listLocationsRetrySettings = RetryUtil.updateRetrySettings( clientSettingsBuilder.listLocationsSettings().getRetrySettings(), serviceRetry); @@ -236,6 +252,35 @@ public VpcFlowLogsServiceSettings vpcFlowLogsServiceSettings( "Configured method-level retry settings for getVpcFlowLogsConfig from properties."); } } + Retry queryOrgVpcFlowLogsConfigsRetry = clientProperties.getQueryOrgVpcFlowLogsConfigsRetry(); + if (queryOrgVpcFlowLogsConfigsRetry != null) { + RetrySettings queryOrgVpcFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.queryOrgVpcFlowLogsConfigsSettings().getRetrySettings(), + queryOrgVpcFlowLogsConfigsRetry); + clientSettingsBuilder + .queryOrgVpcFlowLogsConfigsSettings() + .setRetrySettings(queryOrgVpcFlowLogsConfigsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for queryOrgVpcFlowLogsConfigs from properties."); + } + } + Retry showEffectiveFlowLogsConfigsRetry = + clientProperties.getShowEffectiveFlowLogsConfigsRetry(); + if (showEffectiveFlowLogsConfigsRetry != null) { + RetrySettings showEffectiveFlowLogsConfigsRetrySettings = + RetryUtil.updateRetrySettings( + clientSettingsBuilder.showEffectiveFlowLogsConfigsSettings().getRetrySettings(), + showEffectiveFlowLogsConfigsRetry); + clientSettingsBuilder + .showEffectiveFlowLogsConfigsSettings() + .setRetrySettings(showEffectiveFlowLogsConfigsRetrySettings); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Configured method-level retry settings for showEffectiveFlowLogsConfigs from properties."); + } + } Retry listLocationsRetry = clientProperties.getListLocationsRetry(); if (listLocationsRetry != null) { RetrySettings listLocationsRetrySettings = diff --git a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringProperties.java b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringProperties.java index 957fa0d5b91..92498de28c9 100644 --- a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringProperties.java +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/java/com/google/cloud/networkmanagement/v1/spring/VpcFlowLogsServiceSpringProperties.java @@ -52,6 +52,16 @@ public class VpcFlowLogsServiceSpringProperties implements CredentialsSupplier { * takes precedence over service-level retry configurations for that RPC method. */ @NestedConfigurationProperty private Retry getVpcFlowLogsConfigRetry; + /** + * Allow override of retry settings at method-level for queryOrgVpcFlowLogsConfigs. If defined, + * this takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry queryOrgVpcFlowLogsConfigsRetry; + /** + * Allow override of retry settings at method-level for showEffectiveFlowLogsConfigs. If defined, + * this takes precedence over service-level retry configurations for that RPC method. + */ + @NestedConfigurationProperty private Retry showEffectiveFlowLogsConfigsRetry; /** * Allow override of retry settings at method-level for listLocations. If defined, this takes * precedence over service-level retry configurations for that RPC method. @@ -131,6 +141,22 @@ public void setGetVpcFlowLogsConfigRetry(Retry getVpcFlowLogsConfigRetry) { this.getVpcFlowLogsConfigRetry = getVpcFlowLogsConfigRetry; } + public Retry getQueryOrgVpcFlowLogsConfigsRetry() { + return this.queryOrgVpcFlowLogsConfigsRetry; + } + + public void setQueryOrgVpcFlowLogsConfigsRetry(Retry queryOrgVpcFlowLogsConfigsRetry) { + this.queryOrgVpcFlowLogsConfigsRetry = queryOrgVpcFlowLogsConfigsRetry; + } + + public Retry getShowEffectiveFlowLogsConfigsRetry() { + return this.showEffectiveFlowLogsConfigsRetry; + } + + public void setShowEffectiveFlowLogsConfigsRetry(Retry showEffectiveFlowLogsConfigsRetry) { + this.showEffectiveFlowLogsConfigsRetry = showEffectiveFlowLogsConfigsRetry; + } + public Retry getListLocationsRetry() { return this.listLocationsRetry; } diff --git a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index b67d6c07aa9..a9020dd5398 100644 --- a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -11,6 +11,12 @@ "type": "java.lang.Boolean", "description": "Auto-configure Google Cloud networkmanagement/VpcFlowLogsService components.", "defaultValue": true + }, + { + "name": "com.google.cloud.networkmanagement.v1.organization-vpc-flow-logs-service.enabled", + "type": "java.lang.Boolean", + "description": "Auto-configure Google Cloud networkmanagement/OrganizationVpcFlowLogsService components.", + "defaultValue": true } ] } \ No newline at end of file diff --git a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 035ec09f82d..80ab70d29f2 100644 --- a/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-cloud-previews/google-cloud-network-management-spring-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,3 @@ com.google.cloud.networkmanagement.v1.spring.ReachabilityServiceSpringAutoConfiguration -com.google.cloud.networkmanagement.v1.spring.VpcFlowLogsServiceSpringAutoConfiguration \ No newline at end of file +com.google.cloud.networkmanagement.v1.spring.VpcFlowLogsServiceSpringAutoConfiguration +com.google.cloud.networkmanagement.v1.spring.OrganizationVpcFlowLogsServiceSpringAutoConfiguration \ No newline at end of file